opencode-acp-control
Control OpenCode directly via the Agent Client Protocol (ACP). Start sessions, send prompts, resume conversations, and manage OpenCode updates.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bjesuiter/opencode-acp-controlOpenCode ACP Skill
Control OpenCode directly via the Agent Client Protocol (ACP).
Metadata
- For ACP Protocol Docs (for Agents/LLMs): https://agentclientprotocol.com/llms.txt
- GitHub Repo: https://github.com/bjesuiter/opencode-acp-skill
- If you have issues with this skill, please open an issue ticket here: https://github.com/bjesuiter/opencode-acp-skill/issues
Quick Reference
| Action | How |
|---|---|
| Start OpenCode | bash(command: "opencode acp", background: true) |
| Send message | process.write(sessionId, data: "<json-rpc>\n") |
| Read response | process.poll(sessionId) - repeat every 2 seconds |
| Stop OpenCode | process.kill(sessionId) |
| List sessions | bash(command: "opencode session list", workdir: "...") |
| Resume session | List sessions → ask user → session/load |
| Check version | bash(command: "opencode --version") |
Starting OpenCode
bash(
command: "opencode acp",
background: true,
workdir: "/path/to/your/project"
)
Save the returned sessionId - you'll need it for all subsequent commands.
Protocol Basics
- All messages are JSON-RPC 2.0 format
- Messages are newline-delimited (end each with
\n) - Maintain a message ID counter starting at 0
Step-by-Step Workflow
Step 1: Initialize Connection
Send immediately after starting OpenCode:
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":true,"writeTextFile":true},"terminal":true},"clientInfo":{"name":"clawdbot","title":"Clawdbot","version":"1.0.0"}}}
Poll for response. Expect result.protocolVersion: 1.
Step 2: Create Session
{"jsonrpc":"2.0","id":1,"method":"session/new","params":{"cwd":"/path/to/project","mcpServers":[]}}
Poll for response. Save result.sessionId (e.g., "sess_abc123").
Step 3: Send Prompts
{"jsonrpc":"2.0","id":2,"method":"session/prompt","params":{"sessionId":"sess_abc123","prompt":[{"type":"text","text":"Your question here"}]}}
Poll every 2 seconds. You'll receive:
session/updatenotifications (streaming content)- Final response with
result.stopReason
Step 4: Read Responses
Each poll may return multiple lines. Parse each line as JSON:
- Notifications:
method: "session/update"- collect these for the response - Response: Has
idmatching your request - stop polling whenstopReasonappears
Step 5: Cancel (if needed)
{"jsonrpc":"2.0","method":"session/cancel","params":{"sessionId":"sess_abc123"}}
No response expected - this is a notification.
State to Track
Per OpenCode instance, track:
processSessionId- from bash tool (clawdbot's process ID)opencodeSessionId- from session/new response (OpenCode's session ID)messageId- increment for each request you send
Polling Strategy
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bjesuiter-opencode-acp-control": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
Prd
Skill by bjesuiter
nb
Manage notes, bookmarks, and notebooks using the nb CLI. Create, list, search, and organize notes across multiple notebooks with Git-backed versioning.
bridle
Unified configuration manager for AI coding assistants. Manage profiles, install skills/agents/commands, and switch configurations across Claude Code, OpenCode, Goose, and Amp.
exe-dev
Manage persistent VMs on exe.dev. Create VMs, configure HTTP proxies, share access, and set up custom domains. Use when working with exe.dev VMs for hosting, development, or running persistent services.
mole-mac-cleanup
Mac cleanup & optimization tool combining CleanMyMac, AppCleaner, DaisyDisk features. Deep cleaning, smart uninstaller, disk insights, and project artifact purge.