TUI
OpenCode provides an interactive terminal user interface for collaborating with LLMs. Launch by running opencode in your project directory.
Core Features
File References
Use @ to reference files in messages:
How is auth handled in @packages/functions/src/api/index.ts?Bash Command Execution
Prefix messages with ! to execute shell commands:
!ls -laSlash Commands
| Command | Description | Keybind |
|---|---|---|
/connect | Add provider and API keys | — |
/compact | Compact session | ctrl+x c |
/details | Toggle tool details | ctrl+x d |
/editor | Open external editor | ctrl+x e |
/exit | Exit OpenCode | ctrl+x q |
/export | Export to Markdown | ctrl+x x |
/help | Display help | ctrl+x h |
/init | Create AGENTS.md | ctrl+x i |
/models | List models | ctrl+x m |
/new | Start new session | ctrl+x n |
/redo | Redo message | ctrl+x r |
/sessions | Switch sessions | ctrl+x l |
/share | Share session | ctrl+x s |
/themes | List themes | ctrl+x t |
/undo | Undo last message | ctrl+x u |
Editor Configuration
Set your EDITOR environment variable:
# Linux/macOS
export EDITOR=nano
export EDITOR="code --wait"
# Windows PowerShell
$env:EDITOR = "code --wait"Configuration
Customize TUI behavior in opencode.json:
{
"tui": {
"scroll_speed": 3,
"scroll_acceleration": {
"enabled": true
}
}
}Options:
scroll_acceleration.enabled- macOS-style scroll accelerationscroll_speed- Scrolling velocity (minimum: 1)