OpenCode is a terminal-based AI coding assistant (TUI).
opencode # Launch in interactive mode
opencode run "Explain this file" # Single prompt
opencode run -m "provider/model-name" "Fix the bug" # Specific model
opencode run -c "Continue where we left off" # Continue last session| Topic | Description | Documentation |
|---|---|---|
| Configuration file | opencode.json format, locations, all keys |
configuration.md |
| Storage & persistence | SQLite, sessions, compaction, cross-session data | storage.md |
| AGENTS.md | Project instructions for the agent | agents-md.md |
| Providers | Custom LLM providers setup | providers.md |
| Agents | Internal agent roles (build, plan, explore, etc.) | agents.md |
| Environment variables | System vars, feature toggles, debug | environment-variables.md |
| Superpowers | Agentic workflow plugin (brainstorm, plan, TDD) | superpowers.md |
See cli-flags.md for the full reference (opencode run [message..] --model --continue --format --file ...).
Available via the command palette (Ctrl+P) or by typing / in the input.
| Command | Description | Documentation |
|---|---|---|
/new |
New session | command-palette.md |
/sessions |
Switch sessions | command-palette.md |
/models |
Switch model | command-palette.md |
/compact |
Compact session | compact.md |
/skills |
Browse skills | command-palette.md |
/init |
Create/update AGENTS.md | init.md |
| ... | + 15 more commands | slash-commands-extra.md |
.md files sent as prompts, with argument support. See custom-commands.md.
| Location | Description |
|---|---|
~/.config/opencode/commands/ |
User-level commands |
<project>/.opencode/commands/ |
Project-level commands |
SKILL.md files with YAML frontmatter, loaded automatically by the agent. See configuration.md (skills key).
| Location | Description |
|---|---|
~/.config/opencode/skills/ |
User-level skills |
<project>/.opencode/skills/ |
Project-level skills |
OpenAI-compatible providers with custom models. See providers.md.
External tool servers connected via the Model Context Protocol.
| Server | Description |
|---|---|
| context7 | Up-to-date documentation for any library |
| chrome-devtools | Browser automation, debugging, performance audits |
37 built-in language servers (21 auto-installed). See lsp/ for the full list.
Intercept and modify agent behavior (system prompt, tool execution, shell env, etc.). See hooks.md.
Extend OpenCode with third-party plugins installed via opencode.json. See Superpowers -- agentic workflow (brainstorm, design, plan, TDD) with 14 skill guides.
The leader key defaults to Ctrl+X (configurable in tui.json). <leader>KEY means press Ctrl+X, release, then press KEY.
Full reference: global-shortcuts.md
| Shortcut | Action | Documentation |
|---|---|---|
Ctrl+C / Ctrl+D / <leader>q |
Quit | quit-dialog.md |
Ctrl+P |
Command palette | command-palette.md |
Escape |
Interrupt session | global-shortcuts.md |
| Shortcut | Action | Documentation |
|---|---|---|
<leader>n |
New session | chat.md |
<leader>l |
List / switch sessions | session-dialog.md |
<leader>c |
Compact session | compact.md |
<leader>u |
Undo message | chat.md |
<leader>r |
Redo message | chat.md |
| Shortcut | Action | Documentation |
|---|---|---|
<leader>m |
List models | model-dialog.md |
<leader>a |
List agents | global-shortcuts.md |
F2 |
Cycle recent models | model-dialog.md |
Tab |
Cycle agents | global-shortcuts.md |
| Shortcut | Action | Documentation |
|---|---|---|
<leader>t |
List themes | theme-dialog.md |
<leader>e |
Open external editor | editor.md |
<leader>b |
Toggle sidebar | global-shortcuts.md |
<leader>s |
View status | global-shortcuts.md |
| Shortcut | Action | Documentation |
|---|---|---|
Return |
Submit message | editor.md |
Shift+Return / Ctrl+Return / Alt+Return / Ctrl+J |
Insert newline | editor.md |