Complete command reference for the z3ed CLI tool, including all automation and AI-powered features.
z3ed rom readRead bytes from ROM at specified address.
Syntax:
Notes:
--data-format controls the hex/ascii view of bytes.--format controls the output structure (json/text).Examples:
Output:
z3ed rom writeWrite bytes to ROM at specified address.
Syntax:
Notes:
--sandbox writes to a sandbox copy instead of the original ROM.Examples:
z3ed rom infoShow basic ROM metadata.
Syntax:
Examples:
z3ed rom diffCompare two ROM files.
Syntax:
Examples:
z3ed rom compareCompare a ROM against a baseline to identify differences.
Syntax:
Examples:
z3ed rom validateValidate ROM integrity and structure.
Syntax:
Examples:
Output:
z3ed rom generate-goldenGenerate a golden ROM file for testing.
Syntax:
Examples:
These commands operate directly on ROM data (no GUI required).
dungeon-describe-room --room <hex> [--include-objects]dungeon-list-sprites --room <hex>dungeon-list-objects --room <hex>dungeon-list-custom-collision --room <hex> [--tiles <hex,hex,...>] [--nonzero] [--all]dungeon-export-custom-collision-json --out <path> [--room <hex> | --rooms <hex,hex,...> | --all] [--report <path>] [--sandbox]dungeon-import-custom-collision-json --in <path> [--dry-run [--report <path>]] [--sandbox | --mock-rom] [--replace-all --force]dungeon-export-water-fill-json --out <path> [--room <hex> | --rooms <hex,hex,...> | --all] [--report <path>] [--sandbox]dungeon-import-water-fill-json --in <path> [--dry-run [--report <path>]] [--sandbox | --mock-rom] [--strict-masks]dungeon-minecart-audit [--room <hex> | --rooms <hex,hex,...> | --all] [--only-issues]dungeon-map --room <hex> [--layer <0|1|2>] *(overlays Oracle custom collision tiles when present)*dungeon-list-chests --room <hex>dungeon-get-entrance --entrance <hex> [--spawn]entrance-info --entrance <hex> [--spawn]dungeon-export-room --room <hex> --output <file>dungeon-place-object --room <hex> --id <hex> --x <int> --y <int> [--size <int>] [--layer <0|1|2>] [--manifest <path>] [--write]dungeon-get-room-tiles --room <hex> *(stubbed)*dungeon-set-room-property --room <hex> --property <name> --value <value> [--manifest <path>]dungeon-place-object is a dry-run unless --write is supplied. Both modes execute the same immutable capacity preflight. In-place edits can proceed without a manifest, but a shared or growing object stream fails closed unless an explicit manifest defines dungeon_stream_regions.objects with the copy_on_write strategy and allocator-owned space. The manifest remains an ownership guard: protected current-stream, allocation, object-pointer, or door-pointer writes are rejected before either dry-run or write can mutate ROM bytes.
dungeon-set-room-property accepts layout/layout_id values 0-7 and floor1/floor2 values 0-15. These properties are persisted in the two-byte object-stream header with per-field read/modify/write; unrelated bits and the object payload remain unchanged. A shared stream requires the same manifest-backed copy_on_write capability described above. Successful non-mock writes require a completed destination backup before replacement.
The collision and water-fill JSON import commands validate without mutation when --dry-run is present. Without it, they immediately save the active ROM with a required backup. --sandbox redirects that save and backup to the sandbox copy; the source ROM and its directory remain unchanged. --mock-rom is an in-memory test mode and is rejected when combined with --sandbox. --report is accepted only with a non-sandbox --dry-run; write-mode and sandbox imports reject it before ROM or sandbox work. Report paths must not alias the active ROM, including through symlinks or hardlinks. Reports are staged in exclusive same-directory temporary files and published with rename/replace after a final path-identity check. Collision/water JSON exports use the same ROM-alias checks; when --out and --report are published together, a partial publication is rolled back before the command returns. Exports may use --sandbox; their explicit --out and --report artifacts must remain separate from both the sandbox ROM and its source ROM.
When --spawn is set, the ID must be 0x00-0x06. Both entrance commands report the dedicated spawn fields (quadrant, overworld_door_tilemap, and the linked regular entrance_id) and omit the regular-entrance-only door field.
Example:
Add --include-objects for a read-only objects array in ROM-stream order. Each record reports hexadecimal object_id, subtype (1, 2, or 3), x, y, size, and zero-based stream_index. The reported object_count then equals the array length. Lightable torches and pushable blocks are omitted because they come from separate global tables rather than the encoded room object stream. Without the flag, the legacy output and count are unchanged.
overworld-describe-map --map <hex>overworld-find-tile --tile <hex>overworld-list-warps --map <hex>overworld-list-sprites --map <hex>overworld-list-items --map <hex>overworld-get-entrance --entrance <hex>overworld-tile-stats --map <hex>Example:
gui-place-tile --tile <hex> --x <x> --y <y>gui-click (--target <path> | --widget-key <key>) [--click-type <left|right|middle|double>]gui-type (--target <path> | --widget-key <key>) --text <text> [--clear-first]gui-wait [--condition <condition>] [--widget-key <key>] [--timeout-ms <ms>] [--poll-interval-ms <ms>]gui-assert [--condition <condition>] [--widget-key <key>]gui-discover-tool [--window <name>] [--type <type>]gui-summarize-widgetsgui-screenshot [--region <region>]z3ed test-listList available tests.
z3ed test-runExecute tests.
Syntax:
z3ed test-statusCheck test execution status.
resource-list --type <type>resource-search --query <text> [--type <type>]message-list, message-read, message-search --query <text>message-encode --text <text>, message-decode --hex <hex_bytes>message-export-org --output <path>, message-import-org --file <path>message-export-bundle --output <path> [--range <all|vanilla|expanded>]message-import-bundle --file <path> [--apply] [--strict] [--range <all|vanilla|expanded>] [--project <path>] (expanded apply requires a project)message-write --id <id> --text <text> --project <path>message-export-bin --output <path> [--range expanded]message-export-asm --output <path> [--range expanded]dialogue-list, dialogue-read, dialogue-search --query <text>hex-search --pattern <hex>Use scoped help directly from the CLI:
Agent commands are routed through the agent subcommand:
Use z3ed agent with no args for a full list of agent subcommands.
These commands connect to a running Mesen2-OoS instance via the local socket (/tmp/mesen2-<pid>.sock). They do not require a ROM argument. The debug alias is the recommended front door (Mesen2 is the default backend).
z3ed mesen-gamestateRead ALTTP game state from Mesen2.
Syntax:
Examples:
z3ed mesen-spritesList active sprites from Mesen2.
Syntax:
Examples:
z3ed mesen-cpuRead CPU register state.
Syntax:
Examples:
z3ed mesen-memory-readRead emulator memory.
Syntax:
Examples:
z3ed mesen-memory-writeWrite emulator memory (hex bytes).
Syntax:
Examples:
z3ed mesen-disasmDisassemble code at an address.
Syntax:
Examples:
z3ed mesen-traceFetch execution trace.
Syntax:
Examples:
z3ed mesen-breakpointManage breakpoints.
Syntax:
Examples:
z3ed mesen-controlControl emulation state.
Syntax:
Examples:
AI workflows are available via the z3ed agent commands (see Agent CLI).
These options work with all commands:
--rom <file> - Specify ROM file to use--sandbox - Run ROM commands against a sandbox copy--format <json|text> - Output format--data-format <hex|ascii|both> - Byte view for read commands--tui / --interactive - Removed (use z3ed help and command-scoped --help)--list-commands - List all available commands--export-schemas - Export command schemas as JSON--version - Show version information--self-test - Run CLI self-test--verbose - Enable verbose output--quiet - Suppress non-error output--ai_provider <name> - AI provider (auto, ollama, gemini, openai, anthropic, mock)--ai_model <name> - Provider-specific model override--gemini_api_key <key> - Gemini API key--anthropic_api_key <key> - Anthropic API key--ollama_host <url> - Ollama host URL--openai_base_url <url> - OpenAI-compatible base URL (LM Studio: http://localhost:1234)--gui_server_address <host:port> - GUI automation server--prompt_version <name> - Prompt version override--use_function_calling <true|false> - Enable Gemini function calling--mesen-socket <path> - Override Mesen2 socket path--help - Show help for command--http-port <port> - HTTP API port (if enabled in build)--http-host <host> - HTTP API display host (printed URLs only)Environment variable shortcuts for AI providers: GEMINI_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENAI_BASE_URL/OPENAI_API_BASE, OLLAMA_HOST, OLLAMA_MODEL.
0 - Success1 - Error (invalid args, missing ROM, failed command)