Install OpenCode
Configure a Provider
OpenCode works with any LLM provider. We recommend starting with OpenCode Zen for a curated experience.Get your API key
Visit opencode.ai/auth, sign in, and copy your API key.
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:- Analyzes your project structure
- Identifies coding patterns
- Creates an
AGENTS.mdfile with project context
Start Coding
You’re ready! Here are some things you can try:Ask Questions
Ask OpenCode about your codebase:@ to reference specific files:
Make Changes
Request code modifications:Tab) to review changes before applying them.
Run Commands
Execute bash commands with!:
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Tab | Switch between Build and Plan agents |
@ | Reference a file |
! | Run a bash command |
/ | Execute a slash command |
Ctrl+C | Cancel current operation |
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
OpenCode won't start
OpenCode won't start
Check the installation with
opencode --version. If it’s not found, ensure the installation directory is in your PATH.See Troubleshooting for common issues.Can't connect to provider
Can't connect to provider
Verify your API key is valid and you have credits available. Run
/connect again to reconfigure.Check Providers for provider-specific setup.Changes aren't working as expected
Changes aren't working as expected
Use
/undo to revert changes. Switch to Plan mode (Tab) to review suggestions before applying them.Learn more about Modes and Permissions.