opencode

Delegate coding tasks to the OpenCode CLI through terminal and process tools.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Offloading implementation, refactoring, and PR review work to an external autonomous coding agent requires knowing the right commands, session handling, and exit behavior. This Skill provides tested invocation patterns for running OpenCode CLI from ZeusAgent without common pitfalls like stuck TUI sessions or wrong binary resolution. ## 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: Start the OpenCode TUI with pty support, submit prompts, poll progress, and exit cleanly with Ctrl+C. - PR Review & Parallel Work: Review pull requests in isolated clones and run parallel tasks in separate workdirs or worktrees. - Use Case: Ask the agent to implement OAuth refresh flow with tests in your repository; it launches OpenCode in the background, monitors progress via process logs, and reports files changed and test results. ## Quick Start Use the opencode skill to run a one-shot task that adds retry logic to API calls and updates the tests in my project.

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 workdir for bounded, non-interactive tasks. Attach context files with `-f`, force a model with `--model provider/model`, and show reasoning with `--thinking`. No pty is needed for run mode.

How do I run interactive OpenCode TUI sessions in the background?▼

Start `opencode` with background=true and pty=true, then send prompts via process submit and monitor with poll or log actions. Interactive TUI sessions require pty mode to function correctly.

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

Shell environments may resolve different OpenCode binaries from PATH. Check with `which -a opencode` and `opencode --version`, then pin an explicit binary path like `$HOME/.opencode/bin/opencode` if needed.

How do I exit an OpenCode TUI session cleanly?▼

Send Ctrl+C (\x03) via the process write action or kill the process directly. Do not use `/exit` — it is not a valid OpenCode command and opens an agent selector dialog instead.

Can OpenCode review pull requests automatically?▼

Yes, OpenCode has a built-in `opencode pr <number>` command for PR review. For isolation, clone the repo into a temporary directory and run a review prompt with the changed files attached via `-f`.

What are the limitations of parallel OpenCode sessions?▼

Parallel sessions must use separate workdirs or git worktrees to avoid file collisions. Sharing one working directory across concurrent OpenCode sessions causes conflicts and unpredictable results.