Skip to content
OpenCode
Esc
navigateopen⌘Jpreview
On this page

Intro

Run the CLI in a project to open the full-screen terminal interface:

opencode2

Pass a directory to work in a different project:

opencode2 ~/code/my-project

Suggested terminals:

Truecolor support gives themes their most accurate colors; terminals without it use an approximation of the available palette.

Automation

Use opencode2 run to submit a prompt without opening the interactive interface. It is designed for scripts, CI jobs, and other workflows that need model output directly in the terminal.

opencode2 run "Explain this repository"

Mini

Use opencode2 mini to start OpenCode’s minimal interactive interface instead of the full-screen TUI.

opencode2 mini

Run opencode2 mini --help to see its session, model, agent, prompt, and replay options.

Background service

By default, OpenCode discovers or starts one shared background server for your user account. Every local OpenCode client connects to that server, which owns sessions, configuration, integrations, permissions, and tool execution.

Use --standalone to run with a private server, or --server to connect to a specific server URL:

opencode2 --standalone
opencode2 --server http://localhost:4096

See Troubleshooting for shared service diagnostics and the API reference for server endpoints.

Was this page helpful?