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.