OpenCode Tutorial
Welcome to the OpenCode tutorial. Based on official OpenCode docs and the open-source anomalyco/opencode project, this guide helps you master this open-source, multi-model, privacy-first AI coding agent from scratch.
Table of Contents
Basics
- Introduction — Positioning, product matrix, comparison with Codex / Claude Code
- Installation — Multi-platform install, Provider setup, OpenCode Zen
- Quick Start — TUI, Plan/Build modes,
/init, and your first task
Architecture
- Architecture & Runtime — Agent loop, multi-session, config merge order
Customization
- AGENTS.md & Project Init —
/init, instruction files,@file references - Agents & Permissions — Build/Plan, Subagents, fine-grained permission control
Extensions
- MCP & LSP — External tools, language-server diagnostics
Operations
- Config & CLI Reference —
opencode.json,run/serve, environment variables
Practice
- Practical Examples — Feature development, code review, CI automation
- Resources — Official docs and community
Learning Path
Prerequisites
- Terminal and Git basics
- At least one LLM Provider API key (or an OpenCode Zen account)
- Familiarity with any programming language