with one click
pokemon-player
// Play Pokémon games via headless emulation. Start a game server, read game state, make strategic decisions, and send actions — all from the terminal.
// Play Pokémon games via headless emulation. Start a game server, read game state, make strategic decisions, and send actions — all from the terminal.
| name | pokemon-player |
| description | Play Pokémon games via headless emulation. Start a game server, read game state, make strategic decisions, and send actions — all from the terminal. |
| tags | ["gaming","pokemon","emulator","pyboy","gameplay"] |
| triggers | ["play pokemon","pokemon game","start pokemon","play pokemon red","play pokemon firered","pokemon firered","pokemon red","play gameboy"] |
Play Pokémon games autonomously via headless emulation. Uses the pokemon-agent
package to run a game server, then interacts via HTTP API.
# Install the package + emulator + dashboard
pip install pokemon-agent[dashboard] pyboy
# User must provide their own ROM file
# The agent CANNOT download or distribute ROMs
Ask the user for the ROM file path if not provided. Common locations:
~/roms/pokemon_red.gb~/pokemon_red.gb# Start the game server as a background process
pokemon-agent serve --rom <ROM_PATH> --port 8765 &
# Verify it's running
curl -s http://localhost:8765/health
Tell the user: "Dashboard available at http://localhost:8765/dashboard"
Each turn, follow this cycle:
curl -s http://localhost:8765/state | python3 -m json.tool
Parse the JSON to understand:
Priority order:
a_until_dialog_end)Use Hermes memory to track:
PKM:OBJECTIVE: Defeat Brock in Pewter CityPKM:MAP: Viridian Forest has bug catchers, exit north to PewterPKM:STRATEGY: Brock's Onix is weak to Water — use Bubble# Single action
curl -s -X POST http://localhost:8765/action \
-H "Content-Type: application/json" \
-d '{"actions": ["press_a"]}'
# Movement sequence
curl -s -X POST http://localhost:8765/action \
-H "Content-Type: application/json" \
-d '{"actions": ["walk_up", "walk_up", "walk_right", "press_a"]}'
# Advance dialog
curl -s -X POST http://localhost:8765/action \
-H "Content-Type: application/json" \
-d '{"actions": ["a_until_dialog_end"]}'
After each action, the response includes state_after. Check:
If stuck (same state after 3+ actions), try:
| Action | What It Does |
|---|---|
press_a | Press A (confirm, talk, interact) |
press_b | Press B (cancel, run from battle) |
press_start | Open menu |
press_select | Select button |
walk_up/down/left/right | Walk one tile |
wait_60 | Wait ~1 second |
a_until_dialog_end | Mash A until dialog finishes |
hold_a_30 | Hold A for 30 frames |
# Save before important battles
curl -s -X POST http://localhost:8765/save \
-d '{"name": "before_brock"}'
# Load if things go wrong
curl -s -X POST http://localhost:8765/load \
-d '{"name": "before_brock"}'
# List available saves
curl -s http://localhost:8765/saves
Save before: Gym battles, catching rare Pokémon, entering dungeons.
Track these in memory as you complete them:
Use these prefixes in Hermes memory for Pokémon-related entries:
PKM:OBJECTIVE: — Current goalPKM:MAP: — Map/navigation knowledgePKM:STRATEGY: — Battle/team strategy notesPKM:PROGRESS: — Milestone completionPKM:STUCK: — Notes about stuck situations and how they were resolved# Save screenshot for vision analysis
curl -s http://localhost:8765/screenshot -o /tmp/pokemon_screen.png
Use vision_analyze on the screenshot when:
When done playing:
curl -X POST localhost:8765/save -d '{"name": "session_end"}'