Core Modes Explained
The biggest difference between Opencode and traditional IDEs is its introduction of Plan (Planning) and Build (Building) modes.
Plan Mode (Planning Mode)
When you press the Tab key to switch to Plan Mode, Opencode transforms into an "architect".
- Purpose: It will not directly modify code, but will analyze your requirements, read existing code, and then provide a detailed implementation plan.
- Use Cases:
- "I want to add a user login feature to this app, how should I do it?"
- "Help me refactor the database module."
- Any task involving multiple files and complex logic.
- Interaction: You can discuss the plan with it repeatedly until you're satisfied.
Tip: In Plan mode, you can drag in design diagrams or screenshots to have the AI generate solutions based on visual mockups.
Build Mode (Building Mode)
Once you confirm the plan is correct, press Tab again (or confirm in the dialog) to enter Build Mode.
- Purpose: Opencode transforms into a "senior engineer" and begins executing the plan, directly writing, modifying, and deleting code in your files.
- Capabilities:
- Automatically creates new files.
- Runs terminal commands (like
npm install), requires authorization. - Fixes compilation errors (it sees terminal errors and automatically fixes them).
- Undo: If something goes wrong, type
/undoto roll back with one command.
Summary
| Mode | Role | Behavior | Shortcut |
|---|---|---|---|
| Plan | Architect | Read-only analysis, outputs steps | Tab |
| Build | Engineer | Read/write code, execute commands | Tab |
Common Commands (CLI Commands)
In Opencode's dialog box, you can use the following Slash Commands (/) for quick operations:
/init: Initialize the current project, generateAGENTS.md(project manual) to help AI understand your architecture./connect: Connect to cloud account, manage subscriptions and API Keys./undo: Undo the last AI code change./redo: Redo the last undone operation./share: Generate a shareable link for the current conversation to send to colleagues./reset: Clear current context and start a new topic.