OpenCode Quick Start Guide
Get up and running with OpenCode in minutes.
Choose your version
| OpenCode 2 (current) | OpenCode 1 (legacy) | |
|---|---|---|
| Latest version | v2.3.2 (2026-11-18) | v1.19.6 (2026-11-17) |
| Install script | curl -fsSL https://opencode.ai/v2/install | bash | curl -fsSL https://opencode.ai/install | bash |
| npm package | @opencode/cli | opencode-ai |
| Sign in | /connect in the TUI | /connect in the TUI, or opencode auth login (CLI) |
| Project init | Not documented for V2 — use V1’s /init or write AGENTS.md yourself | /init in the TUI |
| Docs | opencode.ai/docs | opencode.ai/v1/docs |
Install
curl -fsSL https://opencode.ai/v2/install | bashOr with a package manager: npm install -g @opencode/cli, brew install anomalyco/tap/opencode-v2, or paru -S opencode-beta (Arch). Windows package managers are not supported for V2 — use the install script (native Windows) or WSL2.
Launch
opencodeSign in
Connect your provider directly in the TUI:
/connectSelect the OpenCode provider to use the built-in Console catalog (formerly Zen — free models included, pay-as-you-go or Go subscription), or pick any other provider and paste your own API key. See also the official V2 Providers docs.
Your first task
Type your prompt and press enter, e.g. “Explain how the authentication flow works in this project”.
For customizing V2 (config, agents, permissions), see the official V2 config docs. Note: the V2 docs do not document an /init project-initialization command; if you want to generate an AGENTS.md, use OpenCode 1’s /init or write it yourself.
Install
curl -fsSL https://opencode.ai/install | bashOr with a package manager: npm i -g opencode-ai@latest, brew install anomalyco/tap/opencode (the V1 tap), scoop install opencode, or choco install opencode (Windows).
Launch
opencodeSign in
The easiest way is connecting in the TUI:
/connectSelect opencode, sign in at opencode.ai/auth, copy your API key, and paste it back — free models are included in the built-in catalog.
From the terminal, opencode auth login opens the same interactive provider picker. Examples:
opencode auth login --provider anthropic # Anthropic API key
opencode auth login --provider github-copilot # GitHub Copilot subscriptionYour keys are stored in ~/.local/share/opencode/auth.json.
Initialize your project
In the TUI, run:
/initThis scans your project and creates an AGENTS.md in the project root.
Your first task
Type your prompt and press enter. Press Tab to switch between the build and plan agents.
Multi-session support
You can run multiple agents in parallel within the same project — just start opencode again in another terminal. Each session operates independently.
Verification
- Run
opencode modelsto see the available models from your configured provider - Run
opencode statsto check your usage statistics - Try a simple query like “Explain how to use promises in JavaScript”
Next Steps
- Explore the Configuration page to customize OpenCode to your workflow
- Check out the CLI Reference for more commands
- Visit the Ecosystem page to discover community tools and resources
- Learn about OpenCode Console (formerly Zen) for the built-in model catalog
- Upgrading between versions? See the upgrade guide and the official migration page
Happy coding!