
OpenCode
Plan a feature in OpenCode before letting it build
An open-source AI coding agent for the terminal. Use its plan mode to agree the approach first, then switch to build mode and undo what you do not want.
Written from the tool's official pages, listed under Official sources at the end of this guide. Check them for current features, limits and terms.
Try it (opens in a new tab)Steps to try
- Follow the install steps in the official documentation, then connect a model provider. The documentation says you need API keys for the providers you want to use.
- Open a terminal in your project folder and start OpenCode. Run the initialise command so it analyses the project and writes an AGENTS.md file, then read that file and correct it.
- Ask it to explain a part of the code you did not write, so you can judge whether it understands the project.
- Switch to plan mode, which the documentation says cannot make changes, and describe the feature in detail. Give feedback on the plan until it matches what you want.
- Switch to build mode and ask it to carry out the plan.
- Review the changes. If a change is wrong, use the undo command, adjust your prompt and try again.
Limitations
You need a model provider, and the quality of the result depends on the model you choose. The documentation describes two major versions that share one command name and cannot be installed side by side, so check which one you are following. As with any agent, it can change more than you intended.
Pricing
OpenCode is described as open source, but the model providers it connects to usually charge for use. The documentation mentions a curated model service that needs billing details. Check the official site for current terms.
Privacy and data
Your code and prompts go to whichever model provider you configure. Choose the provider deliberately, keep secrets out of the project, and review the provider's data terms before using private code.
About the sources
Based on the official getting-started documentation, which describes OpenCode as an open-source AI coding agent with a plan mode, a build mode and an undo command. Results depend on the model provider you choose.
Alternatives
Codex and other coding agents offer similar workflows. Your editor's built-in assistant may be enough for small edits.
Official sources
The official pages this guide was written from. Read them for current features, limits and terms.