Troubleshooting
Encountering problems while using Opencode? Here are the solutions.
Common Errors
Opencode Bad Request
- Cause: Usually API Key is invalid or quota is exhausted.
- Solution: Run
/connectto rebind the Key, or check your LLM provider's dashboard.
Exit Plan Mode
- Issue: Stuck in Plan mode and cannot generate code.
- Solution: Press
Tabkey to switch back to Build mode, or input/resetto reset the session.
Export Session
- Requirement: Want to save the conversation just now to share with colleagues.
- Command: Input
/shareto generate a URL, or use/exportto export as a Markdown file.
Installation & Environment
Terminal Compatibility (Best Terminal for Opencode)
Although Opencode supports all terminals, the following terminals have the best experience:
- Ghostty / Kitty: GPU accelerated, smooth rendering.
- iTerm2 / WezTerm: Classic and stable.
- Windows Terminal: The best choice for Windows users.
Paths & Configuration
- Where is Opencode Config File:
~/.opencode/config.json - Where Opencode JSON: Same as above, used to store session state and preferences.
- Opencode Environment Variable: If you encounter PATH problems, please check if your
.zshrcor.bashrccorrectly exports the Opencode bin directory.
Seeking Help
If the above does not solve your problem, please visit Opencode Docs or join the Opencode Discord community to ask questions.