Skip to content

opencode-cli

Use when working with OpenCode CLI commands, TUI interface, server mode, SDK client, ACP editor integration, GitHub Actions integration, Zen models, or installation/setup.

ModelSource
sonnetpack: opencode

OpenCode runs as a TUI (default), headless server, ACP agent, or GitHub bot. Go-based, client/server architecture, 75+ LLM providers. Current version: v1.2.10 (Feb 2026).

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Full Reference

OpenCode runs as a TUI (default), headless server, ACP agent, or GitHub bot. Go-based, client/server architecture, 75+ LLM providers. Current version: v1.2.10 (Feb 2026).

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ItemValue
Installcurl -fsSL https://opencode.ai/install | bash
Also vianpm, Homebrew, Scoop, Chocolatey, Pacman, Mise, Docker
Start TUIopencode
Start serveropencode serve --port 4096
Start web UIopencode web
SDK packagenpm install @opencode-ai/sdk
ACP commandopencode acp
GitHub bot trigger/opencode or /oc in issue/PR comment
Zen model prefixopencode/model-name
API docshttp://localhost:4096/doc
Upgradeopencode upgrade

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

CommandPurpose
opencode (tui)Interactive TUI — default
opencode runNon-interactive, exits after completion
opencode serveHeadless HTTP server
opencode webServer + web interface
opencode attachConnect TUI to remote server
opencode agent create|listManage agents
opencode auth login|list|logoutProvider credentials
opencode mcp add|list|auth|logout|debugMCP server management
opencode models [provider]List available models
opencode session listSession management
opencode statsToken usage and costs
opencode export [id]Export session as JSON
opencode import <file|url>Import from JSON or share URL
opencode github install|runGitHub Actions setup
opencode acpStart ACP agent for editors
opencode upgrade [target]Update OpenCode
opencode uninstallRemove OpenCode

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

TopicFileWhat’s inside
Installation & upgradereference/installation.mdAll package managers, Docker, Windows notes, uninstall flags
CLI commands & TUIreference/commands.mdAll commands with full flag tables, slash commands, keybindings, debugging
Server modereference/server-mode.mdArchitecture, auth env vars, full API endpoint catalog
SDKreference/sdk.mdNode.js setup, all client methods, structured output, Python SDK
ACP editor integrationreference/acp.mdZed, JetBrains, Neovim configs, supported features, troubleshooting
GitHub Actionsreference/github.mdTriggers, manual setup, workflow YAML, usage patterns
Zen modelsreference/zen.mdPricing, model format, Black tier, when to use vs direct provider

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.


┏━ 💻 opencode-cli ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ CLI commands, TUI, server mode, SDK, ACP, and GitHub Actions for OpenCode ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛