Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.19 KB

File metadata and controls

69 lines (49 loc) · 2.19 KB
layout default
title Chapter 1: Getting Started
nav_order 1
parent OpenCode Tutorial

Chapter 1: Getting Started

Welcome to Chapter 1: Getting Started. In this part of OpenCode Tutorial: Open-Source Terminal Coding Agent at Scale, you will build an intuitive mental model first, then move into concrete implementation details and practical production tradeoffs.

This chapter gets OpenCode running and establishes a clean baseline for deeper customization.

Learning Goals

  • install OpenCode using your preferred package path
  • validate local model/provider connectivity
  • run first tasks in terminal agent mode
  • understand the difference between build and plan modes

Installation Paths

Path Command Best For
install script `curl -fsSL https://opencode.ai/install bash`
npm npm i -g opencode-ai@latest Node-centric environments
Homebrew brew install anomalyco/tap/opencode macOS/Linux package-managed setup

First Run Checklist

  1. launch opencode
  2. confirm provider credentials are available
  3. run a simple repo analysis task
  4. switch between build and plan modes
  5. verify output and suggested edits are coherent

Early Failure Triage

Symptom Likely Cause First Fix
no model responses missing provider credentials configure provider key and retry
unsafe command concerns wrong agent mode for task use plan mode for analysis-first sessions
poor repo understanding insufficient context scope add clearer task framing and target files

Source References

Summary

You now have OpenCode installed and validated for day-to-day terminal workflows.

Next: Chapter 2: Architecture and Agent Loop

How These Components Connect

flowchart LR
    A[opencode CLI] --> B{Mode}
    B -->|build| C[Agent Loop]
    B -->|plan| D[Analysis Only]
    C --> E[File Tools]
    C --> F[Shell Tools]
    C --> G[Model Provider]
    G --> H[Response / Patch]
Loading