OpenCode is an open-source AI coding agent that integrates with OpenClaw via ACP (Agent Client Protocol). It provides specialized coding capabilities including game development, multi-file projects, complex refactoring, and production-ready code generation.
Status: ✅ Fully tested - Built 12 production-ready games including Pac-Man, Space Invaders, Tetris, Q*bert, and more.
Use OpenCode when:
javascript
// One-shot task (recommended for most builds)
sessions_spawn({
runtime: "acp",
agentId: "opencode",
task: "Create a complete [game/app] in HTML/CSS/JavaScript...",
mode: "run",
cwd: "/path/to/project"
})
// Parallel builds (run multiple simultaneously)
sessions_spawn({...}) // Game 1
sessions_spawn({...}) // Game 2
sessions_spawn({...}) // Game 3
OpenCode supports parallel execution - spawn multiple subagents simultaneously:
javascript
// Launch 3 games at once
const game1 = sessions_spawn({... Asteroids ...})
const game2 = sessions_spawn({... Doodle Jump ...})
const game3 = sessions_spawn({... Flappy Bird ...})
// All build concurrently, limited by slowest
Performance: 3 parallel games completed in ~1m 20s (same as single game)
Based on 12-game test suite:
ComplexityExamplesBuild TimeLinesSimplePong, Flappy Bird30-60s300-600MediumSnake, 2048, Breakout1m - 1m 30s500-800ComplexPac-Man, Q*bert, Tetris1m 30s - 2m+1000-1300
The following game types have been fully tested and verified:
GameKey FeaturesTest ResultTetrisGhost piece, hold, preview, levels✅ CompletePac-Man4 AI ghosts, maze, power pellets✅ CompleteSpace InvadersEnemy formation, bunkers, UFO✅ CompleteSnakeGrid movement, progressive speed✅ CompletePongAI opponent, physics✅ CompleteBreakoutMulti-level, power-ups✅ Complete2048Merge algorithm, undo, swipe✅ CompleteMinesweeperFlood-fill, 3 difficulties✅ CompleteQ*bertIsometric, pyramid, enemies✅ Complete (fixed spawn)AsteroidsVector physics, screen wrap✅ CompleteFlappy BirdGravity, pipes, medals✅ CompleteDoodle JumpBouncing, power-ups, black holes✅ Complete (fixed spawn)
CommandDescriptionopencodeStart interactive TUIopencode run <message>Run non-interactive modeopencode acpStart ACP server (for OpenClaw integration)opencode serveStart headless serveropencode webStart web interface
CommandDescriptionopencode providersManage AI providersopencode modelsList available modelsopencode statsShow token usageopencode upgradeUpdate to latest versionopencode sessionManage sessions
OpenCode is configured in OpenClaw. The ACP command is:
bash
opencode acp
This starts JSON-RPC over stdio for ACP-compatible communication.
OpenCode supports multiple AI providers:
Set API keys via opencode providers or environment variables.
javascript
sessions_spawn({
runtime: "acp",
agentId: "opencode",
task: "Create a complete Snake game in HTML/CSS/JavaScript...",
mode: "run",
cwd: "/Users/jadegaul/.openclaw/workspace/codeprojects"
})
javascript
// Build 3 games simultaneously
const builds = [
sessions_spawn({ task: "Asteroids...", ... }),
sessions_spawn({ task: "Doodle Jump...", ... }),
sessions_spawn({ task: "Flappy Bird...", ... })
]
javascript
// Fix existing code
sessions_spawn({
runtime: "acp",
agentId: "opencode",
task: "Fix the bug in /path/to/file.html where...",
mode: "run"
})
javascript
subagents({ action: "list" })
javascript
subagents({
action: "steer",
target: "<runId>",
message: "Continue with the implementation"
})
OpenCode has full file system access:
/undo and /redo commands/share creates shareable linksFix: Spawn OpenCode to add starting platform/position
Fix: Add spawn delay or ensure safe starting position
Fix: Check that touch + keyboard controls both specified
See references/opencode-docs.md for complete ACP documentation.
Total Games Built: 12
Total Build Time: ~15 minutes
Total Lines of Code: ~8,000+
Success Rate: 100% (with minor spawn fixes)
Average Build Times:
OpenCode via ACP is production-ready for game development and coding tasks.