Quick Start
Launch the TUI
Or pass a directory:
Step 1: Connect a Model
If no Provider is configured yet, in the TUI:
Finish API key setup before continuing.
Step 2: Initialize the Project
OpenCode analyzes the project and generates AGENTS.md at the repo root with structure, conventions, and common commands. This is persistent context for the agent, aligned with the AGENTS.md standard used by Codex, Cursor, and others.
Plan vs Build
Two Primary agents map to two workflows:
Switch: press Tab (current mode shown in the corner).
Recommended: Plan first, then Build
- Switch to Plan and describe the task:
- Review steps; add details (you can drag in screenshots):
- Tab back to Build:
Questions and @ References
Explain code
@ references files or directories to narrow context.
Edit directly (skip Plan)
Undo and Redo
Restore undone changes:
Share a Session
Generates a link and copies it—use carefully with sensitive code.
Non-interactive: opencode run
For scripts and CI:
Common flags (see opencode run --help):
-m/--model: specify model-f: attach file context
Bash Shortcut
Prefix with ! in the input to run shell directly:
First Task Checklist
cdto repo rootopencodeto start TUI/connectto configure Provider/initto generateAGENTS.md- Tab → Plan, describe a small feature
- Tab → Build, implement
!git diffor/undoto review changes- Commit manually with
git commit