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

  1. Introduction — Positioning, product matrix, comparison with Codex / Claude Code
  2. Installation — Multi-platform install, Provider setup, OpenCode Zen
  3. Quick Start — TUI, Plan/Build modes, /init, and your first task

Architecture

  1. Architecture & Runtime — Agent loop, multi-session, config merge order

Customization

  1. AGENTS.md & Project Init/init, instruction files, @ file references
  2. Agents & Permissions — Build/Plan, Subagents, fine-grained permission control

Extensions

  1. MCP & LSP — External tools, language-server diagnostics

Operations

  1. Config & CLI Referenceopencode.json, run / serve, environment variables

Practice

  1. Practical Examples — Feature development, code review, CI automation
  2. Resources — Official docs and community

Learning Path

StageGoalChapters
Day 1Install and run TUIIntro → Install → Quick Start
Days 2–3Understand Build/Plan and permissionsArchitecture → Agents & Permissions
Week 1Team conventions and extensionsAGENTS.md → MCP/LSP → Config
OngoingAutomation at scaleCLI Reference → Practical Examples

Prerequisites

  • Terminal and Git basics
  • At least one LLM Provider API key (or an OpenCode Zen account)
  • Familiarity with any programming language