Skip to content

Intro

opencode is an AI coding agent built for the terminal. It features:

  • A responsive, native, themeable terminal UI.
  • Automatically loads the right LSPs, so the LLMs make fewer mistakes.
  • Have multiple agents working in parallel on the same project.
  • Create shareable links to any session for reference or to debug.
  • Log in with Anthropic to use your Claude Pro or Claude Max account.
  • Supports 75+ LLM providers through Models.dev, including local models.

opencode TUI with the opencode theme


Install

Terminal window
npm install -g opencode-ai

You can also install the opencode binary through the following.

Using the install script
Terminal window
curl -fsSL https://opencode.ai/install | bash
Using Homebrew on macOS
Terminal window
brew install sst/tap/opencode
Using Paru on Arch Linux
Terminal window
paru -S opencode-bin

Providers

We recommend signing up for Claude Pro or Max, running opencode auth login and selecting Anthropic. It’s the most cost-effective way to use opencode.

Terminal window
$ opencode auth login
Add credential
Select provider
Anthropic (recommended)
OpenAI
Google
Amazon Bedrock
Azure
DeepSeek
Groq
...

opencode is powered by the provider list at Models.dev, so you can use opencode auth login to configure API keys for any provider you’d like to use. This is stored in ~/.local/share/opencode/auth.json.

The Models.dev dataset is also used to detect common environment variables like OPENAI_API_KEY to autoload that provider.

If there are additional providers you want to use you can submit a PR to the Models.dev repo. You can also add them to your config for yourself.