Core Modes Explained
The biggest difference between Opencode and traditional IDEs is the introduction of Plan and Build working modes.
Plan Mode
When you press the Tab key to switch to Plan Mode, Opencode transforms into an "Architect".
- Role: It will not directly modify the code but will analyze your requirements, read existing code, and then provide a detailed implementation plan.
- Scenarios:
- "I want to add a user login feature to this app, how should I do it?"
- "Refactor the database module for me."
- Any task involving multiple files and complex logic.
- Interaction: You can discuss the plan with it repeatedly until you are satisfied.
Tip: In Plan mode, you can drag in design drawings or screenshots and let AI generate a solution based on visual drafts.
Build Mode
When you confirm the plan is correct, press the Tab key again (or confirm in the dialog box) to enter Build Mode.
- Role: Opencode transforms into a "Senior Engineer", starting to execute the plan, directly writing, modifying, and deleting code in your files.
- Capabilities:
- Automatically create new files.
- Run terminal commands (such as
npm install), authorization required. - Fix compilation errors (it will look at terminal errors and automatically fix them).
- Undo: If a mistake is made, input
/undoto rollback with one click.
Summary
| Mode | Role | Behavior | Shortcut |
|---|---|---|---|
| Plan | Architect | Read-only analysis, output steps | Tab |
| Build | Engineer | Read-write code, execute commands | Tab |
Common CLI Commands
In the Opencode 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 cloud account, manage subscriptions and API Key./undo: Undo the last AI code change./redo: Redo the last undone operation./share: Generate a share link for the current conversation to send to colleagues./reset: Clear current context and start a new topic.