OpenCode
Open-source terminal coding agent — 75+ LLM providers, runs locally, MIT-licensed.
The Linux-loved, MIT-licensed answer to Claude Code — most flexible coding agent of 2026 with 75+ provider integrations and full TUI + IDE support.
What it is
OpenCode is a fully open-source terminal coding agent built by Anomaly. Shipped as a native TUI plus plugins for Neovim, Helix, Emacs, and a VS Code fork in beta, it speaks 75+ LLM providers through one unified interface — Anthropic, OpenAI, Google, AWS Bedrock, Groq, OpenRouter, and any Ollama-served local model. It comes with LSP support for TypeScript, Go, Python, and Rust built in, and offers an immutable encrypted /share URL mode for handing off sessions. With 158k+ GitHub stars, OpenCode is the largest open-source coding agent not built on top of one vendor's tooling.
Best for
- Linux/server developers who want a coding agent without a desktop GUI
- Teams needing a vendor-neutral, MIT-licensed agent for compliance
- Mixed-cloud setups that span Anthropic + OpenAI + local Ollama
- TUI / Neovim / Helix users wanting agent mode in their editor
Pros
- Fully MIT-licensed, no vendor lock-in
- 75+ LLM providers through one unified CLI
- Built-in LSP for TypeScript / Go / Python / Rust
- Encrypted immutable /share URLs for session hand-off
Cons
- TUI-first interface is not for users wanting a polish-heavy GUI
- VS Code extension is in beta (use Cursor or Windsurf for VS Code-native feel)
- You bring your own API key — costs depend on your provider pick
Quick start
- Install: brew install anomaly/tap/opencode (macOS) / scoop install opencode (Windows) / curl-sh (Linux).
- cd into any git repository → run `opencode` → TUI launcher appears.
- Pick your model provider from the in-app picker: Anthropic / OpenAI / Google / Bedrock / Groq / OpenRouter / local Ollama.
- Type `/` for slash commands: /models, /session, /share; Tab toggles between them.
- For LSP-aware edits: OpenCode ships with TypeScript / Go / Python / Rust LSP support; enable per-project with `opencode.json`.
- Share a session: type `/share` → produces an immutable, encrypted conversation URL (great for handing off debugging sessions to a teammate).
Sample input / output
Repo: acme/multi-tenant-saas (Go module, ~40k LOC, Postgres backend)
opencode> "We're hitting a memory leak in the metrics exporter — p99 RSS climbs 80MB/hour under load. Reproduce in test, identify root cause, fix, run benchmarks. Don't change public APIs."
Selected model: Claude Opus 4 (reasoning mode)
Slash: /share → yields share link after task OpenCode TUI session log (16m elapsed):
Step 1: Created branch fix/metrics-leak.
Step 2: Ran `go test -bench=. ./internal/metrics` to reproduce baseline. RSS climbs at +0.93 MB per 10k req.
Step 3: Traced allocation: found that *http.Request bodies were kept by the global exporter in a sync.Map without eviction.
Step 4: Generated patch (4 file edits, 32 lines net):
- Replaced sync.Map with bounded LRU (size 4096).
- Added per-request context.WithTimeout(15s) for spillover cleanup.
- Added test case testing/replay_test.go.
Step 5: Re-ran benchmarks: RSS growth -94.3% (-88 MB → -5 MB over an hour under the same load).
Step 6: All tests green (12,488 of 12,488 pass). No public API changes.
Step 7: /share generated share URL with full transcript + diff.
Wrote commit: "fix(metrics): bound exporter in-memory map to address RSS leak". Benchmarks
Pricing
Free (MIT); you bring your own API key (Anthropic / OpenAI / Ollama / Groq / etc.).
Underlying models
Self-hosting
Yes — OpenCode can be self-hosted under the MIT license. This gives you full control over data and deployment.