OpenCodeconfigurationbuilt-in
/connect
Add a provider and API key to connect a new AI model provider.
When to use
- ▸Adding OpenAI, Anthropic, or Google credentials
- ▸Connecting a local Ollama or custom endpoint
More OpenCode commands
context-management
/compact
Summarize the current session to save tokens. Alias: /summarize.
configuration
/details
Toggle tool execution details in the conversation output.
context-management
/editor
Open the external $EDITOR for composing messages — useful for long or structured prompts. Keybind: Ctrl+x e.
session-management
/exit
Exit OpenCode. Aliases: /quit, /q. Keybind: Ctrl+x q.