OpenCodecontext-managementbuilt-in
/editor
Open the external $EDITOR for composing messages — useful for long or structured prompts. Keybind: Ctrl+x e.
When to use
- ▸Writing a long detailed prompt in your preferred editor
- ▸Composing structured prompts with formatting
More OpenCode commands
context-management
/compact
Summarize the current session to save tokens. Alias: /summarize.
configuration
/connect
Add a provider and API key to connect a new AI model provider.
configuration
/details
Toggle tool execution details in the conversation output.
session-management
/exit
Exit OpenCode. Aliases: /quit, /q. Keybind: Ctrl+x q.