The Open Source AI Coding Agent
Not just autocomplete — a coding agent that plans, edits files, runs terminal commands, and debugs itself. Bring your own model or use free built-in ones. No lock-in, no subscription.
What is Opencode?
Opencode is an open source AI coding agent (MIT) that runs where you work — as a terminal TUI, a native desktop app, an IDE extension, or a web UI. It plans the task, edits files, runs commands, and checks its own work. Bring Claude, GPT, Gemini, or any of 200+ providers — or start instantly with the built-in model catalog (OpenCode Console, formerly Zen): free models are included, and paid models are pay-as-you-go or from $10/month with a Go subscription.
Up and running in five minutes
Three commands, no signup wall.
- 1 — Install (OpenCode 2) $
curl -fsSL https://opencode.ai/v2/install | bashmacOS, Linux, and Windows (WSL2)
- 2 — Launch $
opencodeOpens the TUI in your project
- 3 — Connect & init $
/connectSelect OpenCode, paste your API key (free models included); run /init inside the TUI for AGENTS.md
What can Opencode do?
Six things people actually search for — each card links to the doc that shows how.
Terminal AI coding agent
Run a real agent in your terminal — it plans, edits files, executes commands, and validates results inside your project.
// run AI coding agent in terminal
Bring your own model
Claude, GPT, Gemini, Copilot, Ollama — 200+ providers via Models.dev, switched per session.
// connect your own API key to a coding agent
Free models, no key
The built-in catalog (OpenCode Console, formerly Zen) includes free models for coding — daily limits apply; paid models are pay-as-you-go or from $10/month with Go.
// AI coding agent free without API key
Desktop app
A native GUI for macOS, Windows, and Linux — parallel sessions, diff view, drag-and-drop files.
// AI coding agent desktop app
MCP servers & plugins
Declare local or remote MCP servers in config; community plugins add memory, orchestration, and more.
// add MCP servers to a coding agent
Task recipes
Step-by-step recipes for commits, refactors, browser automation, and docs — each with a verification step.
// automate coding tasks with AI agent
Opencode vs other AI coding agents
The short version — the full table lives on the compare page.
| OpenCode | Claude Code | Cursor | Cline | |
|---|---|---|---|---|
| Open source | Yes (MIT) | No (proprietary) | No (proprietary) | Yes (Apache 2.0) |
| Free models included | Yes (Console) | No | No | No |
| Bring your own model | Yes — 200+ providers | Anthropic only | Limited (their catalog) | Yes (multiple providers) |
| Surfaces (CLI/Desktop/TUI/IDE) | All four | CLI + IDE | IDE only | IDE only |
| Price / Free tier | Free + paid built-in models | Requires Claude sub | From $20/mo | Free (bring your key) |
Frequently asked questions
Is Opencode free?
Yes. Opencode is open source (MIT) and free to install. The built-in catalog (OpenCode Console, formerly Zen) includes a set of free models — daily request limits apply — and you can bring your own provider keys. Paid models are pay-as-you-go per token, or from $10/month with an OpenCode Go subscription.
How do I install Opencode?
For OpenCode 2 (the current release), run curl -fsSL https://opencode.ai/v2/install | bash or npm install -g @opencode/cli. For OpenCode 1 (the previous release), use curl -fsSL https://opencode.ai/install | bash or npm install -g opencode-ai. Homebrew, Scoop, and Chocolatey are covered in the installation guide. A desktop app is available as a beta download for macOS, Windows, and Linux.
Which operating systems are supported?
macOS, Linux, and Windows. On Windows, WSL2 is the recommended setup; a native Windows build exists as experimental. The desktop app ships for all three platforms.
Do I need an API key?
Not necessarily. Run /connect in the TUI (or opencode auth login) and select the built-in OpenCode provider — free models are included. If you prefer your own provider — Claude, GPT, Gemini, GitHub Copilot, Ollama, and 200+ more providers — connect with your own key anytime.
Can Opencode use MCP servers?
Yes. Declare local or remote MCP servers in opencode.json and their tools become available to the agent automatically — alongside the built-in file, shell, and web tools.
What is the difference between the terminal, desktop app, and IDE extension?
Same agent, different surface. The TUI runs in your terminal, the desktop app is a standalone native GUI (beta) with parallel sessions and a diff view, and the IDE extension brings the agent into your editor.
Does Opencode store my code?
No. Your code and context stay on your machine or go directly to your model provider — Opencode stores nothing. The optional /share command uploads a session only when you run it, and it can be disabled in config.
Built in the open
Opencode is MIT-licensed and developed in public on GitHub. Official SDKs ship for JavaScript, Go, and Python, and the community ecosystem includes plugins, MCP servers, and an awesome-opencode list — all maintained in the open.
Why Opencode?
Built for developers who care about control. 231K+ GitHub stars, 1K+ contributors, 24K+ commits.
Model Agnostic
Not locked to one vendor. Bring your own model — Claude, GPT, Gemini, or any of 200+ providers via Models.dev. Closed-source tools tie you to their pricing; Opencode lets you switch anytime.
Full Agency
Not just a chat window. Opencode plans the work, edits files, runs terminal commands, validates results, and debugs itself — the full loop, not single-shot suggestions.
Zen Models
Not a $20/month subscription. Free handpicked models tuned for coding agents — no setup, no API keys. Start coding immediately, upgrade only if you outgrow the free tier.
Multi-Session
Not one conversation at a time. Run multiple agents in parallel on the same project — like browser tabs, each with its own context. Start, pause, and switch without losing state.
Desktop App
Not just an IDE plugin. A full native app for macOS, Windows, and Linux — tabs, pinned sessions, diff viewer, and background agents. Runs standalone, not bolted onto your editor.
Real-World Recipes
Reproducible workflows that show exactly how to use OpenCode for real tasks — step by step, with prompts and pitfalls.
Slide Generation from a Topic
Turn a one-line topic into a structured slide deck. Outline the narrative, generate per-slide copy, and export to PPTX or HTML.
Check: Deck opens cleanly in target tool
Read the recipe →Explore an Unfamiliar Codebase
Land in a new repo and get a working mental model fast. Map architecture, find entry points, produce a navigation guide.
Check: CODEBASE_MAP committed and shared
Read the recipe →Browser Automation with Playwright
Let OpenCode drive a real browser to test, scrape, or verify web flows. Connect the Playwright MCP server and capture regression artifacts.
Check: Snapshot and screenshot captured
Read the recipe →Who is this for?
Whatever your role, there’s a path into OpenCode that fits.
New Developer
Go from zero to your first AI-assisted coding session in minutes.
Start here →Senior Engineer
Refactor with confidence, hunt bugs faster, and ship cleaner diffs.
Start here →Team Lead
Standardize agent behavior across your repo with AGENTS.md and policies.
Start here →Non-Developer
Generate slides, docs, and automate tasks without writing code.
Start here →Where to start
Four tiers, from 5 minutes to team rollout. Follow the path that matches your goal.
Get Started
5 minInstall OpenCode, pick a model, run your first task.
Daily Work
30 minLearn the CLI and TUI, follow real recipes, make it part of your workflow.
Customize
Half daySkills, MCP servers, permissions, policies — bend OpenCode to your needs.
Team Adoption
1 dayAGENTS.md, enterprise config, shared policies — roll out to your whole team.
Pick your surface
Four ways to run OpenCode — choose the one that matches your workflow.
CLI
Refactor, commit, and script tasks from the terminal.
Power users, automationDesktop
Multi-session, diff viewer, and background agents on macOS, Windows, Linux.
Visual workflow, parallel tasksTUI
Fast terminal interface with panels for sessions, messages, and tools.
Keyboard-first, quick iterationIDE
Inline assistance and agent control without leaving your editor.
In-editor codingThriving Ecosystem
Power up your workflow with community plugins and MCP servers.
Latest News
View all news →- OpenCode v2.4.5: resilient MCP servers, the new Question UI, and run-now automations OpenCode v2.4.5 keeps MCP servers usable through dropped connections, turns the new Desktop Question UI on by default, and adds run-now for timer automations.
- OpenCode in early December: plugin HTTP hook responses, pop-out settings, and session deep links This week's digest covers v2.4.4: plugin HTTP hook responses, pop-out settings with a swatch theme picker, and jump-to-session deep links.
- OpenCode v2.4.3: Desktop automations management, 11 new themes, and find in session OpenCode v2.4.3 adds a Desktop Automations view, 11 new themes, the OpenMono default font, and an experimental TUI find-in-session.
Pick a task, get going
Every path below leads to a step-by-step guide — no dead ends.