v0.5 — Now with multi-model support

AI Coding Agent
In Your Terminal

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.

$ npm install -g opencode
opencode — ~/projects/my-app
~/my-app opencode
⚡ OpenCode v0.5.0 — AI Coding Agent
✓ Connected to Claude 3.5 Sonnet
Add error handling to the auth module
📖 Reading src/auth/login.ts
📖 Reading src/auth/middleware.ts
✏️ Editing src/auth/login.ts — adding try/catch blocks
✓ Done — 3 files modified, 12 lines added

Works with your favorite providers

OpenAI Anthropic Google Ollama Groq Azure

Everything you need
to ship faster

A fully-featured AI coding agent that understands your codebase, writes production-ready code, and keeps you in flow.

Code Understanding

Automatically indexes your entire codebase for context-aware suggestions and edits that actually fit your project.

In-Place Editing

Directly edits your files with surgical precision. No copy-pasting — changes are applied right where they belong.

Terminal Native

Runs entirely in your terminal. No IDE plugins, no browser tabs — just your workflow, supercharged with AI.

Multi-Model

Switch between Claude, GPT-4, Gemini, local models via Ollama, or any OpenAI-compatible API on the fly.

Privacy First

Your code never leaves your machine with local models. Full control over what gets sent to which provider.

Extensible

Plugin system for custom tools, MCP servers, and providers. Make OpenCode work the way you want it to.

From prompt to production
in seconds

// Before — no error handling
async function login(creds) {
  const user = await db.findUser(creds);
  return generateToken(user);
}

Understand & Analyze

OpenCode reads your files, understands the architecture, and identifies exactly what needs to change.

  • Full codebase indexing
  • Context-aware analysis
  • Dependency mapping
// After — production-ready
async function login(creds) {
  try {
    const user = await db.findUser(creds);
    if (!user) throw new AuthError('Invalid credentials');
    return generateToken(user);
  } catch(err) {
    logger.error('Login failed', err);
    throw err;
  }
}

Edit & Improve

Surgical edits applied directly to your files — with error handling, types, tests, and best practices built in.

  • Precise file edits
  • Follows your conventions
  • Production-ready output

Any model,
any provider

Use the best model for the job. Switch instantly between cloud providers and local models — no config headaches.

View All Providers
Claude 3.5 Sonnet GPT-4o Gemini 2.5 Pro Llama 3.1 Groq Mixtral DeepSeek V3 Qwen 2.5 Ollama (local) Azure OpenAI Mistral Large Any OpenAI-compatible Add your own
Open Source

Built in the open,
shaped by the community

OpenCode is and will always be open source. Inspect the code, contribute features, or fork it and make it your own.

14.2k
GitHub Stars
890+
Contributors
50+
Plugins
MIT
License

Ready to code at the
speed of thought?

Install OpenCode in seconds and start building with AI right inside your terminal.

Install Now
$ npm install -g opencode
Copied to clipboard!