OpenCode is a free, open-source AI coding agent that lives in your terminal instead of a browser tab, and it works with whichever LLM provider you already pay for, Anthropic, OpenAI, or 70-plus others, including fully local models. It is back on GitHub's daily trending list today, adding more than 300 stars on top of a base near 204,000, and the whole setup, install, connect a provider, run your first session, takes about ten minutes.

  • OpenCode is provider-agnostic: it uses the AI SDK and Models.dev to support 75+ LLM providers, from Anthropic and OpenAI to Ollama for fully local, offline models.
  • It ships three ways to use it: a terminal UI, a desktop app (currently in beta), and editor extensions, all sharing the same session engine.
  • Two built-in agents, Plan (read-only, suggests changes) and Build (full access, writes files), switch with a single Tab keypress mid-conversation.
  • It is MIT licensed and free to install; the only ongoing cost is whatever your chosen LLM provider charges for tokens.

The exact steps, start to finish

  1. Step 1. Check your prerequisites. OpenCode needs a modern terminal (Windows Terminal, WezTerm, Alacritty, Ghostty, or Kitty all work) and, for the npm install path, Node.js. Confirm what you have before you start:
    # confirm Node and Git are on your PATH
    node --version
    git --version
  2. Step 2. Install OpenCode. On Windows, Scoop and Chocolatey are the fastest path (both commands are identical whether you run them from PowerShell or cmd.exe):
    # Windows, via Scoop
    scoop install opencode
    
    # Windows, via Chocolatey
    choco install opencode
    npm works identically on every OS, including Windows without WSL:
    npm install -g opencode-ai
    macOS and Linux users can also use the official install script or Homebrew:
    # macOS / Linux install script
    curl -fsSL https://opencode.ai/install | bash
    
    # macOS / Linux, via Homebrew (OpenCode's own tap, kept most current)
    brew install anomalyco/tap/opencode
  3. Step 3. Connect an LLM provider. OpenCode needs a model to talk to before it can do anything. Launch it, then run /connect:
    opencode
    /connect
    If you already have an Anthropic, OpenAI, or OpenRouter API key, pick that provider from the list and paste the key when prompted. If you don't have one yet, the docs point new users at OpenCode Zen, the project's own curated model list: select opencode from the /connect menu, then sign up at opencode.ai/auth, add billing, and copy the API key it gives you back into the terminal prompt. Either path stores the credential locally in ~/.local/share/opencode/auth.json, never in your project files.
  4. Step 4. Initialize OpenCode inside a real project. Navigate to a codebase you want help with and let OpenCode read it:
    cd /path/to/your/project
    opencode
    /init
    This scans the project and writes an AGENTS.md file describing its structure and conventions, the same context OpenCode reloads on every future session. Commit that file to Git so the whole team benefits from it.
  5. Step 5. Run your first real task. Ask a question to see it read your code:
    How is authentication handled in @packages/api/src/index.ts
    Then try Plan mode before you let it touch anything. Hit Tab to switch into Plan (you'll see the mode name change in the lower right corner), describe a feature in plain language, and OpenCode returns a proposed approach without editing a single file. Hit Tab again to switch to Build mode and tell it to go ahead, and it makes the change for real. If the result isn't right, /undo reverts it and restores your original prompt so you can try again.
How a prompt becomes a code change in OpenCodeYour terminal runs the opencode CLI, which connects to any of 75-plus LLM providers through the /connect command. Every session also loads the project's AGENTS.md file for context. A prompt goes through Plan mode, which proposes changes without touching files, and only becomes a real edit once you switch to Build mode. YOUR TERMINAL opencodeCLI / TUI / desktop /connect Anthropic / OpenAI /OpenCode Zen / Ollama /init AGENTS.mdproject context TAB TOGGLES MODE Plan moderead-only, proposes changes Tab Build modewrites the real files /undo reverts a Build-mode edit and restores your original prompt to try again genztech.blog
Fig 1 OpenCode separates the model (whichever provider you connect), the project's stored context, and the mode toggle that decides whether a suggestion is real or just a proposal.

What is OpenCode and why is it trending?

OpenCode started life inside SST, the team behind the Serverless Stack framework, and now ships under Anomaly, the org now maintaining it at anomalyco/opencode. Its pitch is a terminal-native alternative to browser-based coding assistants: the same agent loop, read the codebase, propose a plan, write the change, but running as a local process you control, with no vendor lock-in on which model powers it. The repository sits at roughly 204,000 stars and more than 26,000 forks, and it is trending again today on GitHub's daily chart. The project releases constantly, the latest tag as of this week is v1.18.28, and recent versions have pushed a desktop app (currently beta) and IDE extensions on top of the original terminal UI, all sharing the same session and provider layer.

RelatedHermes Agent Setup: A Free, Self-Improving AI CLI

How do you install OpenCode on Windows, macOS, and Linux?

Windows has four supported paths: Scoop, Chocolatey, npm, or grabbing the binary straight from the Releases page (a desktop installer, opencode-desktop-win-x64.exe, is there too). The official docs note that Windows Subsystem for Linux gives the best experience and full feature compatibility, but the native Scoop, Chocolatey, and npm installs from Step 2 above work directly in PowerShell or cmd.exe with no WSL required. macOS and Linux both get the install script or Homebrew, and Arch Linux users have a dedicated package: sudo pacman -S opencode for the stable release or paru -S opencode-bin for the latest build from the AUR. A Docker image is also published for anyone who wants OpenCode fully containerized: docker run -it --rm ghcr.io/anomalyco/opencode.

How do you pick a provider without overpaying?

This is the step every other setup guide skips. OpenCode does not include a model, so cost and quality depend entirely on which of the 75-plus providers you connect. If you already pay for Claude or ChatGPT, reuse that subscription's API key; there is nothing extra to sign up for. If you are starting from zero, OpenCode Zen is the project's own curated, tested model list, reachable through /connect and a signup at opencode.ai/auth, and it is the path the docs recommend for newcomers because every model on it has been verified to work well with the agent. For a genuinely offline setup with no API bill at all, the provider directory also lists Ollama and LM Studio, so a local model running on your own GPU is a supported first-class option, not a workaround. Whichever you choose, the /models command inside a session lets you switch or compare providers without reconnecting from scratch.

How does OpenCode compare with Claude Code and GitHub Copilot CLI?

TraitOpenCodeClaude CodeGitHub Copilot CLI
LicenseOpen source, MITProprietaryProprietary
Model choice75+ providers, any modelAnthropic models onlyOpenAI/Copilot models
Local modelsYes, Ollama and LM StudioNoNo
InterfaceTerminal, desktop, IDETerminal, IDETerminal
Cost modelFree tool, pay your providerSubscription or API meteredSubscription required

The honest trade is that OpenCode's provider flexibility means quality varies with what you connect. Claude Code and Copilot CLI ship one tuned model relationship end to end; OpenCode hands you the wheel, for better and worse.

RelatedVibe-Trading Setup: Self-Host an AI Trading Agent Free

What are the gotchas before you rely on it?

Four things worth knowing. First, on Windows the docs explicitly recommend WSL over native PowerShell or cmd for the best experience and full feature compatibility; native installs work but you may hit rough edges the WSL path avoids. Second, OpenCode has no built-in model, so a misconfigured or unfunded provider means the agent simply cannot respond; check your provider's billing page if you get authentication errors after /connect. Third, the desktop app is explicitly labeled BETA in the docs, so treat the terminal UI as the stable default if something in the desktop build feels unfinished. Fourth, if you already have an OpenCode install older than 0.1.x, the project's own tip says to remove it before reinstalling, old and new versions can conflict on the same machine.

What to watch · 2026
  • Desktop app graduating from beta. If the GUI reaches parity with the terminal UI, OpenCode stops being a terminal-only tool and starts competing more directly with IDE-first assistants.
  • OpenCode Zen's model list. Whether the curated, verified provider stays free of the vendor-lock-in the rest of the project explicitly avoids.
  • Release cadence. The project ships new tagged versions multiple times a week; watch for breaking config changes landing faster than docs catch up.

Our take

OpenCode's real differentiator is not any single feature, it is refusing to bet the whole product on one model vendor. Plan and Build modes, the AGENTS.md context file, and the undo/redo flow are all things you can find somewhere else, but the ability to point the exact same agent loop at Claude, GPT, a local Ollama model, or 70-something other providers, and switch between them mid-project, is rarer than it should be given how fast the underlying models keep changing. That flexibility is also the catch: OpenCode gives you no default opinion on which model is good, so a first-time user who picks a weak connected model will get weak results and might blame the tool. Ten minutes gets you installed and connected; the model you choose in that /connect step is what actually determines whether the next hour is impressive or frustrating.

Primary sources

Original analysis by GenZTech. Tool documentation: anomalyco/opencode on GitHub.