opencode

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

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/xu1713/openhorse --skill opencode-xu1713
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencode
Source: https://github.com/xu1713/openhorse/tree/main/openhorse/openhorse/skills/autonomous-ai-agents/opencode
Command: npx skills add https://github.com/xu1713/openhorse --skill opencode-xu1713

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Delegating coding work to an external autonomous agent requires managing CLI sessions, interactive TUIs, and long-running processes, 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 resuming prior sessions. - 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 starts an OpenCode session, 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'` in the target repository 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 <number>` in the repository to use the built-in PR review command. For isolation, clone the repo into a temporary directory and run a review prompt against the diff versus the main branch.

Does OpenCode interactive mode require a pty terminal?

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

Why does OpenCode behave differently between my terminal and the agent?

PATH mismatches can resolve different OpenCode binaries with different model configurations. Check with `which -a opencode` and `opencode --version`, then pin an explicit binary path if needed.

How do I exit an OpenCode TUI session cleanly?

Send Ctrl+C (`\x03`) to the session or kill the process directly. Do not use `/exit`, which is not a valid OpenCode command and opens an agent selector dialog instead.

Can I run multiple OpenCode tasks in parallel?

Yes, launch separate background sessions in isolated workdirs or git worktrees so they do not collide. Avoid sharing one working directory across parallel OpenCode sessions.