opencode

Delegates coding tasks to the OpenCode CLI for autonomous implementation, refactoring, and PR review.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill opencode-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencode
Source: https://github.com/CHENHUI-X/toolbox/tree/main/official-skills/autonomous-ai-agents/opencode
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill opencode-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Delegating coding work to an external autonomous agent requires managing CLI sessions, interactive TUIs, background processes, and parallel workdirs, which is error-prone without clear operational guidance. ## Core Features & Use Cases - One-Shot Task Execution: Run bounded coding tasks with opencode run, attaching context files and forcing specific models. - Interactive Background Sessions: Drive the OpenCode TUI via PTY sessions, submitting prompts, polling progress, and exiting cleanly with Ctrl+C. - PR Review & Parallel Work: Review pull requests with opencode pr and run parallel tasks in isolated workdirs or git worktrees. - Use Case: Ask the agent to implement OAuth refresh flow with tests in your repo; it launches OpenCode in the background, monitors progress, and reports files changed and test results. ## Quick Start Ask the agent to use OpenCode to implement a feature or fix a bug in your repository, for example: run opencode to add retry logic to API calls and update the tests.

Frequently Asked Questions about opencode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a one-shot coding task with OpenCode CLI?

Use `opencode run 'your task description'` from the project directory for bounded, non-interactive execution. Attach context files with `-f`, force a model with `--model`, and show reasoning with `--thinking`.

How do I review a pull request with OpenCode?

Run `opencode pr 42` in the repository to use the built-in PR review command. For isolation, clone the repo into a temporary directory and run `opencode run` with a review prompt and the changed files attached.

Does OpenCode interactive mode require a PTY?

Yes, the interactive TUI requires `pty=true` when launched in the background. The `opencode run` one-shot command does not need a PTY and works as a plain terminal command.

Why does /exit not work in the OpenCode TUI?

`/exit` is not a valid OpenCode command and opens an agent selector dialog instead. Exit the TUI by sending Ctrl+C (`\x03`) or by killing the background process.

Can I run multiple OpenCode sessions in parallel?

Yes, launch separate background sessions in distinct workdirs or git worktrees to avoid collisions. Sharing one working directory across parallel OpenCode sessions is not recommended.

How do I resume a previous OpenCode session?

Use `opencode -c` to continue the last session or `opencode -s <session_id>` for a specific one. OpenCode prints the session ID when you exit, and `opencode session list` shows past sessions.