OpenCode Snippets
Source: OpenCode Documentation
Terminal User Interface (TUI) Commands
# 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
# Use skill called skill-name/skill-name/find-skills
# Quit, Exit/exit/q
# Reference file with @How is authentication handled in @packages/functions/src/api/index.ts
# Include file and line numbers in prompt contextReview @README.md#5-10Command Line Interface (CLI)
Section titled “Command Line Interface (CLI)”# Open opencode with directory as contextopencode
# Helpopencode -h
# Create a new agent with guide, prompt injectionsopencode agent create
# Manage sessionsopencode session# Manage sessions, List themopencode session listOpenCode Configuration
Section titled “OpenCode Configuration”Microsoft Documentation External MCP Server and Terraform Local MCP Server
Section titled “Microsoft Documentation External MCP Server and Terraform Local MCP Server”Source: Microsoft Docs configuration originally from MCP Servers -
microsoft/skills -
GitHub,
Install Terraform MCP
locally with
go install github.com/hashicorp/terraform-mcp-server/cmd/terraform-mcp-server@main
or package manager/nix.
{ "$schema": "https://opencode.ai/config.json", "mcp": { "microsoft-docs": { "type": "remote", "url": "https://learn.microsoft.com/api/mcp" }, "terraform": { "type": "local", "command": "/path/to/terraform-mcp-server", "env": { "TFE_TOKEN": "<<TFE_TOKEN_HERE>>" }, }}