All apps/OpenCode

OpenCode

opencode

The open source coding agent, model-agnostic by design.

Runs as opencode|macOS, Linux, Windows|opencode.ai

Command form

ai-draft · 4 tasks · 22 fields

Start the opencode TUI, run one-off messages or serve headless. Other subcommands are left out.

Opens the form; the finished command lands at your prompt, unrun
otty gui opencode
OpenCodeExample values, fixed in this page — nothing here reaches a terminal
Basic
Project directory
directory
Model
string
Agent
string
TasksEach one presets the form for one job
Open in a project
projectmodelagent
Continue last session
projectcontinuemodel
ParametersOnly these flags are editable in the form
Project directory
path · positional 0
Model
Format provider/model.
string
-m--model
Continue last session
boolean
-c--continue
Session ID
string
-s--session
Fork session
Use with continue or a session ID.
boolean
--fork
Prompt
string
--prompt
Agent
string
--agent
No external plugins
boolean
--pure

opencode run

Run with a message

Run opencode non-interactively with a message. Server attach options are left out.

Run with a messageExample values, fixed in this page — nothing here reaches a terminal
Basic
Message*
string
Model
string
Attach files
file
TasksEach one presets the form for one job
Ask a question
messagemodelfile
ParametersOnly these flags are editable in the form
Message
string · positional 0 · repeatable
Model
Format provider/model.
string
-m--model
Agent
string
--agent
Continue last session
boolean
-c--continue
Session ID
string
-s--session
Output format
enum
--formatdefaultjson
Attach files
path · repeatable
-f--file
Directory
path
--dir
Show thinking
boolean
--thinking
Share session
boolean
--share

opencode serve

Start a headless server

Run an opencode server without the TUI.

Start a headless serverExample values, fixed in this page — nothing here reaches a terminal
Basic
Port
integer
Hostname
string
TasksEach one presets the form for one job
Start server
porthostname
ParametersOnly these flags are editable in the form
Port
integer
--port
Hostname
string
--hostname
mDNS discovery
boolean
--mdns
CORS domains
string · repeatable
--cors
SourcesEvery flag above is checked against these
fig
completion

github.com

fig
completion

github.com

fig
completion

github.com

Before it fills your prompt, Otty checks the installed opencode against its version. A form that does not match your version is not offered.