Skip to main content
Get OpenCode running on your first project in under 5 minutes.

Install OpenCode

1

Install via script

The fastest way to install OpenCode:
Or use your preferred package manager:
2

Verify installation

Check that OpenCode is installed:
For Windows users, we recommend using WSL for the best experience.

Configure a Provider

OpenCode works with any LLM provider. We recommend starting with OpenCode Zen for a curated experience.
1

Start OpenCode

Navigate to any directory and launch OpenCode:
2

Connect to a provider

In the OpenCode interface, run:
Select opencode (Zen) from the provider list.
3

Get your API key

Visit opencode.ai/auth, sign in, and copy your API key.
4

Paste the API key

Return to OpenCode and paste your API key when prompted.
You can also configure other providers like Anthropic, OpenAI, or local models. See Providers for more options.

Initialize Your Project

Help OpenCode understand your codebase by initializing it:
This command:
  • Analyzes your project structure
  • Identifies coding patterns
  • Creates an AGENTS.md file with project context
Commit the generated AGENTS.md file to version control so your team benefits from the same context.

Start Coding

You’re ready! Here are some things you can try:

Ask Questions

Ask OpenCode about your codebase:
Use @ to reference specific files:

Make Changes

Request code modifications:
Switch to Plan mode (press Tab) to review changes before applying them.

Run Commands

Execute bash commands with !:
Or use slash commands:

Keyboard Shortcuts

See Keybinds for the complete list.

Next Steps

Core Concepts

Learn about agents, modes, and tools

Configuration

Customize OpenCode for your workflow

CLI Reference

Explore all CLI commands

Integrations

Connect LSP servers, MCP, GitHub, and more

Getting Help

Check the installation with opencode --version. If it’s not found, ensure the installation directory is in your PATH.See Troubleshooting for common issues.
Verify your API key is valid and you have credits available. Run /connect again to reconfigure.Check Providers for provider-specific setup.
Use /undo to revert changes. Switch to Plan mode (Tab) to review suggestions before applying them.Learn more about Modes and Permissions.
Need more help? Join our Discord community or check the FAQ.