CLI Index CLI Index
← Back

OpenCode

Community MCP

Open-source AI coding agent in the terminal with TUI, 75+ model support, and MCP integration

Agent Support
5/5
Platforms
macoslinuxwindows
Authentication

API Key — Run opencode auth login to configure provider API keys, or set them via environment variables

Agent Usage Example

shell
opencode run 'Fix the failing test in src/auth.test.ts and explain what was wrong'

Installation

npm i -g opencode-ai

OpenCode is an open-source AI coding agent built with Go that runs entirely in the terminal. It features a Bubble Tea-powered TUI with vim-like keybindings, support for 75+ LLM models (OpenAI, Anthropic, Google Gemini, AWS Bedrock, Groq, Azure OpenAI, OpenRouter), and built-in MCP server integration.

For AI agents, OpenCode provides both interactive (opencode) and non-interactive (opencode run) modes, making it suitable for both human-driven and automated workflows. The opencode serve command starts a headless HTTP server that other agents or tools can interact with programmatically. It connects local files, git history, and LLMs together — gathering context from the working directory and passing it to the chosen model.

Key capabilities include session management with persistent SQLite storage, Language Server Protocol support for code intelligence, MCP server management (opencode mcp add/list), GitHub automation (opencode github), and token usage tracking (opencode stats). The tool requires no subscription — users pay only their chosen provider’s API costs.

Related Tools