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.

Get Started
$curl -fsSL https://opencode.ai/v2/install | bash OpenCode 2 📋
★ ★ Star on GitHub
opencode — zsh
$ opencode
> Refactor src/auth to the new session API
planning · 6 files touched
✓ src/auth/session.ts +42 −18
✓ src/auth/middleware.ts +12 −9
✓ tests pass 24/24
Try the recipe →

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. 1 — Install (OpenCode 2)
    $ curl -fsSL https://opencode.ai/v2/install | bash

    macOS, Linux, and Windows (WSL2)

  2. 2 — Launch
    $ opencode

    Opens the TUI in your project

  3. 3 — Connect & init
    $ /connect

    Select OpenCode, paste your API key (free models included); run /init inside the TUI for AGENTS.md

Full quick start guide →

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)
See the full comparison →

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

231K+ GitHub stars
1K+ contributors
24K+ commits
MIT license

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.

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 →