Opencode Primer
Master OpenCode, the open-source AI coding agent — setup, agents, skills, plugins, MCP, Zen & headless CI.
Install
npm i -g opencode-ai@latestInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →OpenCode Primer
Everything you need to know about OpenCode — from your first prompt to custom agents, skills, plugins, and MCP integrations. Clear mental models, real examples, every fact verified against the current release.
curl -fsSL https://opencode.ai/install | bash
Who this is for: Developers using (or about to use) OpenCode. Beginners get a guided path; power users get depth on Custom Commands, Skills, Plugins, MCP, and Agents.
⚖️ Not affiliated with the OpenCode team. This is a community-maintained guide. For canonical sources, check opencode.ai/docs and github.com/anomalyco/opencode.
💡 Pro Tip: If this guide saves you an afternoon, a ⭐ helps other developers find it.
🧭 Choose your path
| You are… | Start with | Time |
|---|---|---|
| 🚀 New to OpenCode | What is it → Setup → Prompt Engineering | ~15 min |
| ⚡ Already using it | Custom Commands · Skills · Plugins · MCP | ~20 min each |
| 🧠 Configuring or headless | Agents · Headless & CI · Models & Providers | varies |
Getting started
What is OpenCode?
OpenCode is an open-source AI coding agent — a terminal app (TUI), desktop app, and IDE extension that reads your repo, runs commands, edits files, and talks to any LLM you point it at. Maintained by Anomaly, MIT-licensed — and as of July 2026 the most-starred coding agent on GitHub (182K+ stars), with 8M monthly users by the founder's count.
Three things it does that a chat UI can't:
- Reads your actual repo — not pasted snippets. Greps your files, follows imports, grounds answers in real context using built-in
read/grep/globtools. - Edits in place and runs your stack — diff-aware
edit/write/apply_patch, thenbashto run your tests, linter, or build on the spot. - Composes with the rest of your toolchain — multi-provider models, custom slash commands, agent skills, JS/TS plugins, MCP servers, LSP, formatters, and an HTTP server for CI use.
Three interfaces:
| Surface | Command | When |
|---|---|---|
| TUI (default) | opencode |
Interactive day-to-day work in your terminal |
| CLI / headless | opencode run "" |
Scripts, CI jobs, one-shot prompts |
| Server | opencode serve or opencode web |
Headless API, web UI, or remote attach |
opencode # start TUI in the current repo
opencode run "fix the failing test in src/api.test.ts"
opencode serve --port 4096 # headless server
OpenCode sits in the same space as Claude Code, Codex CLI, and Cursor — same problem, different trade-offs. None is universally better; pick the one whose model, surface, and ecosystem fit your workflow. (The field consolidated hard in 2026: Gemini CLI was retired in June in favor of the closed-source Antigravity CLI, and Roo Code shut down in May.)
Similar plugs
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…
Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
Production-grade engineering skills for AI coding agents.
The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create prototypes, websites, apps, dashboards, presentations, images, and videos with your team…