OpenCode is a community-driven, open source AI coding agent that works in your terminal, IDE, or desktop. With 120K+ GitHub stars, 800+ contributors, and 5M+ monthly developers, it's one of the most widely-used AI coding tools.
Key distinction from Cursor/Codex: OpenCode is fully open source and privacy-first by design. Your code and context never leave your machine unless you explicitly share it.
Think of OpenCode as an AI pair programmer you run locally that can:
Availability: Terminal TUI, desktop app, IDE extension (VS Code, JetBrains)
Automatically loads the right Language Server Protocols for the code you're working on. No manual setup needed.
Start multiple agents in parallel on the same project. Useful for exploring different approaches simultaneously.
Share a link to any session for reference, debugging, or collaboration. Great for code review or mentoring.
Connect any model from any provider:
Log in with GitHub to use your Copilot account directly.
OpenCode does not store any code or context data. It operates in privacy-sensitive environments (compliance, finance, security teams) where data residency is critical.
| Feature | OpenCode | Cursor | Codex | ChatGPT |
|---|---|---|---|---|
| Open Source | ✅ | ❌ | ❌ | ❌ |
| Privacy First | ✅ (local-only) | ⚠️ (cloud sync) | ⚠️ | ❌ |
| Terminal TUI | ✅ | ❌ | ✅ | ❌ |
| IDE Extension | ✅ | ✅ | ❌ | ✅ (plugin) |
| Plan Mode | ✅ | ✅ | ✅ | ✅ |
| Local Models | ✅ | ⚠️ | ✅ | ❌ |
| Share Links | ✅ | ✅ | ✅ | ✅ |
| Cost | Free + provider fees | $$ (subscription) | $$ | Free/Plus |
Best for:
Complementary to:
curl -fsSL https://opencode.ai/install | bash
macOS (Homebrew):
brew install anomalyco/tap/opencode
Linux (Arch):
sudo pacman -S opencode
# or latest from AUR
paru -S opencode-bin
Windows (Chocolatey):
choco install opencode
Windows (Scoop):
scoop install opencode
npm (Any platform):
npm install -g opencode-ai
Docker:
docker run -it --rm ghcr.io/anomalyco/opencode
Run OpenCode and connect your LLM:
opencode
/connect
Options:
cd /path/to/project
opencode
/init
This creates an AGENTS.md file in your project root that helps OpenCode understand your codebase structure and coding patterns.
Ask OpenCode anything:
How is authentication handled in @packages/functions/src/api/index.ts?
1. Ask in Plan Mode (Tab key to toggle)
When a user deletes a note, we'd like to flag it as deleted in the database.
Then create a screen that shows all the recently deleted notes.
From this screen, the user can undelete a note or permanently delete it.
2. Review the Plan OpenCode suggests an implementation approach. Ask follow-up questions:
Take a look at this design image and use it as a reference for the UI.
(Drag/drop images directly into the terminal)
3. Build It (Switch back to Build mode)
Sounds good! Go ahead and make the changes.
4. Review & Iterate If something's not right:
/undo
Then ask again with feedback. Use /redo to restore the previous attempt.
5. Share for Collaboration
/share
Creates a shareable link to your conversation.
| Command | Purpose |
|---|---|
/init | Initialize project (create AGENTS.md) |
/undo | Revert the last set of changes |
/redo | Restore undone changes |
/share | Generate shareable link to conversation |
/connect | Set up LLM provider |
Tab | Toggle between Plan Mode and Build Mode |
When you run /init, OpenCode creates an AGENTS.md file like this:
# OpenCode Agent Config
## Project Overview
[Auto-generated summary of your codebase]
## Coding Standards
- TypeScript with strict mode
- Functional components with hooks
- Error handling with try/catch
## Dependencies
- React 18+
- Next.js 13+
- Prisma for ORM
## Testing
Run `npm test` to verify changes
## Build & Deploy
- `npm run build` to compile
- `npm run deploy` to production
OpenCode reads this every conversation, so it always understands your project context.
/theme
Pick from built-in themes or create your own.
Create a custom .opencoderc file to remap keys (vim, emacs, etc.)
Configure Prettier, rustfmt, go fmt, etc. in your AGENTS.md.
Add project-specific commands in config.
Example OpenCode prompt:
Implement RFX-40: Phase 2 multi-tenancy account scoping
Context:
- accounts table has an id field
- All queries should filter by account_id
- See the Linear issue for acceptance criteria
OpenCode naturally integrates with Git:
OpenCode = Open source, privacy-first, terminal-native AI coding agent
It's perfect if you value open source software, need privacy guarantees, or prefer command-line workflows. Pair it with Linear for planning and GitHub for code review, and you have a complete AI-assisted development workflow.
Unlike proprietary tools, OpenCode's code is public, its community is large, and you're never locked in to a platform's architecture decisions.
Fabric
Open-source framework for AI prompt patterns
Kimi K2.5 + Fireworks AI + OpenCode: Cost-Effective Daily Driver
The Pattern: Use Kimi K2.5 (Moonshot AI) through Fireworks AI at 200 tokens/sec within OpenCode for fast, cheap everyday coding tasks. Save Claude/GPT-4 for complex work that needs PhD-level reasoning.