OS Manuals

/usr/bin/opencode

OpenCode — AI coding agent for the terminal (CLI + HTTP API server, no embedded web UI)

From opencode 2.2.6-r0 (enterprise-packages), captured 2026-11-08 by running opencode --help (exit 0). permalink

DESCRIPTION
  OpenCode command line interface

USAGE
  opencode <subcommand> [flags] [<directory>]

ARGUMENTS
  directory string    Directory to start OpenCode in (optional)

FLAGS
  --standalone            Run with a private server instead of the background service
  --server string         Connect to a server URL instead of the background service
  --auto                  Auto-approve permissions that are not explicitly denied
  --continue, -c          Continue the last session
  --session, -s string    Session ID to continue, or to create if it does not exist
  --prompt string         Prompt to use

GLOBAL FLAGS
  --help, -h                                                          Show help information
  --version, -v                                                       Show version information
  --wizard                                                            Start wizard mode for a command
  --completions <bash|zsh|fish|powershell|sh|pwsh>                    Print shell completion script (choices: bash, zsh, fish, powershell, sh, pwsh)
  --log-level <all|trace|debug|info|warn|warning|error|fatal|none>    Sets the minimum log level (choices: all, trace, debug, info, warn, warning, error, fatal, none)
  --print-logs                                                        Print logs to stderr (server logs require --standalone)

SUBCOMMANDS
  upgrade, update    Upgrade OpenCode to the latest or a specific version
  uninstall          Uninstall OpenCode, keeping session data, configuration, and state
  acp                Start an Agent Client Protocol server
  api                Make a request to the running server
  debug              Debugging and troubleshooting tools
  auth               manage integrations and credentials
  mcp                Manage MCP (Model Context Protocol) servers
  plugin             Manage plugins
  models             List all available models
  stats              Show shareable usage statistics
  mini               Start the minimal interactive interface
  run                Run OpenCode with a message
  session            Manage sessions
  service            Manage the background server
  reload             Reload configuration
  pair               Print one-time links to connect a browser or app
  serve              Start the v2 API and web server
Options (12)
OptionDescriptionSource
--standaloneRun with a private server instead of the background servicehelp
--server stringConnect to a server URL instead of the background servicehelp
--autoAuto-approve permissions that are not explicitly deniedhelp
--continue, -cContinue the last sessionhelp
--session, -s stringSession ID to continue, or to create if it does not existhelp
--prompt stringPrompt to usehelp
--help, -hShow help informationhelp
--version, -vShow version informationhelp
--wizardStart wizard mode for a commandhelp
--completions bash|zsh|fish|powershell|sh|pwshPrint shell completion script (choices: bash, zsh, fish, powershell, sh, pwsh)help
--log-levelSets the minimum log level (choices: all, trace, debug, info, warn, warning, error, fatal, none)help
--print-logsPrint logs to stderr (server logs require --standalone)help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.