Quick Start

Launch the TUI

cd your-project
opencode

Or pass a directory:

opencode /path/to/project

Step 1: Connect a Model

If no Provider is configured yet, in the TUI:

/connect

Finish API key setup before continuing.


Step 2: Initialize the Project

/init

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:

ModeAgentBehavior
PlanPlanWrites and bash disabled by default; good for design
BuildBuildFull tools; good for implementation

Switch: press Tab (current mode shown in the corner).

  1. Switch to Plan and describe the task:
Add soft delete to the notes app: mark deleted on delete, add a "Recently deleted" page with restore and permanent delete.
  1. Review steps; add details (you can drag in screenshots):
Match the list UI in my screenshot to the existing Notes page.
  1. Tab back to Build:
Looks good—implement and run tests to verify.

Questions and @ References

Explain code

How does auth work in @packages/functions/src/api/index.ts?

@ references files or directories to narrow context.

Edit directly (skip Plan)

Using auth in @packages/functions/src/notes.ts as reference, add the same logic to @packages/functions/src/settings.ts.

Undo and Redo

/undo

Restore undone changes:

/redo

Share a Session

/share

Generates a link and copies it—use carefully with sensitive code.


Non-interactive: opencode run

For scripts and CI:

opencode run "List all TODO comments under src" -m anthropic/claude-haiku-4-5

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:

!npm test

First Task Checklist

  1. cd to repo root
  2. opencode to start TUI
  3. /connect to configure Provider
  4. /init to generate AGENTS.md
  5. Tab → Plan, describe a small feature
  6. Tab → Build, implement
  7. !git diff or /undo to review changes
  8. Commit manually with git commit

Next Steps