Skip to content

OpenCode Snippets

Source: OpenCode Documentation

Terminal User Interface (TUI) Commands

Terminal window
# Connect to a provider, for example Amazon Bedrock, Anthropic, Azure, GitHub Copilot, OpenAI, Ollama and others
/connect
# Select user interface theme
/theme
# Select models
/model
# Initialize OpenCode for project after cd into project directory, create AGENTS.md
/init
# Undo changes
/undo
# Redo changes
/redo
# View sessions
/sessions
# Start sub agent
@code-reviewer
@security-engineer
# Manage skills
/skills
# Quit, Exit
/exit
/q
# Reference file with @
How is authentication handled in @packages/functions/src/api/index.ts
Terminal window
# Open opencode with directory as context
opencode
# Help
opencode -h
# Create a new agent with guide, prompt injections
opencode agent create
# Manage sessions
opencode session
# Manage sessions, List them
opencode session list

Source: Configuration originally from MCP Servers - microsoft/skils - GitHub

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"microsoft-docs": {
"type": "remote",
"url": "https://learn.microsoft.com/api/mcp"
}
}
}