OpenCode is an open-source AI-powered coding agent that runs directly in your terminal. Understand, edit, and build code with any LLM — fast, private, and extensible.
Features
A fully-featured AI coding agent that understands your codebase, writes production-ready code, and keeps you in flow.
Automatically indexes your entire codebase for context-aware suggestions and edits that actually fit your project.
Directly edits your files with surgical precision. No copy-pasting — changes are applied right where they belong.
Runs entirely in your terminal. No IDE plugins, no browser tabs — just your workflow, supercharged with AI.
Switch between Claude, GPT-4, Gemini, local models via Ollama, or any OpenAI-compatible API on the fly.
Your code never leaves your machine with local models. Full control over what gets sent to which provider.
Plugin system for custom tools, MCP servers, and providers. Make OpenCode work the way you want it to.
How It Works
OpenCode reads your files, understands the architecture, and identifies exactly what needs to change.
Surgical edits applied directly to your files — with error handling, types, tests, and best practices built in.
Models
Use the best model for the job. Switch instantly between cloud providers and local models — no config headaches.
View All ProvidersOpenCode is and will always be open source. Inspect the code, contribute features, or fork it and make it your own.
Install OpenCode in seconds and start building with AI right inside your terminal.
Install Now$ npm install -g opencode