Skip to content

OpenCode: A Complete Guide to the Open-Source AI Terminal Coding Agent

Mar 31, 2026 1 min
TL;DR OpenCode is an open-source AI coding agent written in TypeScript (MIT, ~198K GitHub stars, repo at anomalyco/opencode) with a built-in TUI, 75+ LLM providers, LSP integration, a Vim-style editor, SQLite session management, and a desktop app. Free, no subscription, local or cloud models.
Table of Contents
  1. Installation
  2. Core Features
  3. Dual Agent Modes
  4. Supported Model Providers
  5. GitHub Actions Integration
  6. OpenCode vs. Aider
  7. Typical Use Cases
  8. How OpenCode Compares to Other Tools
  9. Resources
  10. References
  11. Changelog

🌏 中文版

OpenCode is an open-source AI coding agent written in TypeScript (MIT licensed) that runs in your terminal. No subscription, 75+ LLM providers, and around 198K GitHub stars — the highest in this space. The repo has moved a few times and now lives at anomalyco/opencode (formerly sst/opencode).

⚠️ Don't confuse it with the identically named Go project: an earlier opencode-ai/opencode was written in Go with Bubble Tea and is not the same codebase. Most "OpenCode is written in Go" claims online trace back to that.

Installation

# One-liner install via curl
curl -fsSL https://opencode.ai/install | bash

# npm
npm i -g opencode-ai@latest

# Homebrew
brew install anomalyco/tap/opencode

# Other options
# Scoop / Chocolatey (Windows), pacman (Arch), Nix

Core Features

FeatureDescription
TUI interfaceInteractive terminal UI close to an IDE experience; a desktop app (beta) and IDE extension also exist
75+ LLMsOpenAI, Anthropic, Google, AWS Bedrock, Groq, Azure, OpenRouter, local models (Ollama, LM Studio)
LSP IntegrationLanguage Server Protocol support for intelligent completions and semantic analysis
Vim-style EditorEdit files directly in the terminal using Vim keybindings
SQLite SessionsPersistent conversation history with cross-session context retention
GitHub IntegrationTrigger tasks from PR comments using /opencode or /oc

Dual Agent Modes

OpenCode ships with two built-in agents, switchable with Tab:

AgentPermissionsPurpose
Build (default)Full read/writeDevelopment work: writing code, fixing bugs, refactoring
PlanRead-onlyAnalysis and exploration: understanding codebases, planning architecture, code review

This design lets you quickly switch between "doing" and "thinking." Plan mode never accidentally modifies any files.

Supported Model Providers

One of OpenCode's biggest selling points is model freedom:

Cloud:

  • OpenAI (GPT-4o, GPT-5, o3, etc.)
  • Anthropic (Claude Sonnet, Opus, etc.)
  • Google (Gemini Pro, Ultra)
  • AWS Bedrock, Azure OpenAI
  • Groq, OpenRouter, DeepSeek

Local:

  • Ollama
  • LM Studio
  • Any OpenAI-compatible API

No vendor lock-in — swap providers whenever you want.

GitHub Actions Integration

Add /opencode or /oc to a GitHub PR or Issue comment, and OpenCode will execute the task inside a GitHub Actions runner:

/opencode fix the lint errors and run the tests

Great for automating code review responses and simple fixes.

OpenCode vs. Aider

OpenCodeAider
GitHub Stars95K+39K+
LanguageGoPython
InterfaceTUI (IDE-like)CLI
Key FeaturesLSP integration, parallel sessions, shareable linksGit-first workflow with auto-commits after every AI edit
Best ForInteractive dev sessions, exploratory workSystematic refactoring, repo-wide changes

Many developers use both: Aider for systematic refactoring, OpenCode for interactive development.

Typical Use Cases

  1. Interactive development: Conversational coding in the TUI with real-time feedback
  2. Code exploration: Use Plan mode to read-only analyze an unfamiliar codebase
  3. Multi-model comparison: Switch between providers within the same session to compare results
  4. Local model development: Connect Ollama for fully offline operation
  5. GitHub automation: Trigger AI tasks directly from PRs

How OpenCode Compares to Other Tools

OpenCode's core strengths: completely free and open-source, no vendor lock-in across 75+ model providers, an IDE-like TUI experience, and semantic-level understanding via LSP integration. Ideal for developers who want maximum model flexibility and refuse to be tied to any single provider.

Resources

References

Changelog

  • 2026-08-18: Corrected three substantive errors against the official repo: the language is TypeScript not Go, the license is MIT, and the repo moved to anomalyco/opencode. Stars 95K → ~198K; fixed the npm package name (opencode-ai) and Homebrew tap; added the desktop app; added to the Choosing an Agent CLI series