| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
We want to make it easy for you to contribute to OpenCode. Here are the most common type of changes that get merged:
However, any UI or core product feature must go through a design review with the core team before implementation.
If you are unsure if a PR would be accepted, feel free to ask a maintainer or look for issues with any of the following labels:
Note
PRs that ignore these guardrails will likely be closed.
Want to take on an issue? Leave a comment and a maintainer may assign it to you unless it is something we are already working on.
New providers shouldn't require many if ANY code changes, but if you want to add support for a new provider first make a PR to: https://github.com/anomalyco/models.dev
Requirements: Bun 1.3+
Install dependencies and start the dev server from the repo root:
bun install
bun devBy default, bun dev runs OpenCode in the packages/opencode directory. To run it against a different directory or repository:
bun dev <directory>To run OpenCode in the root of the opencode repo itself:
bun dev .To compile a standalone executable:
./packages/opencode/script/build.ts --singleThen run it with:
./packages/opencode/dist/opencode-<platform>/bin/opencodeReplace <platform> with your platform (e.g., darwin-arm64, linux-x64).
During development, bun dev is the local equivalent of the built opencode command. Both run the same CLI interface:
# Development (from project root)
bun dev --help # Show all available commands
bun dev serve # Start headless API server
bun dev web # Start server + open web interface
bun dev <directory> # Start TUI in specific directory
# Production
opencode --help # Show all available commands
opencode serve # Start headless API server
opencode web # Start server + open web interface
opencode <directory> # Start TUI in specific directoryTo start the OpenCode headless API server:
bun dev serveThis starts the headless server on port 4096 by default. You can specify a different port:
bun dev serve --port 8080To test UI changes during development:
bun run --cwd packages/app devThis starts a local dev server at http://localhost:5173 (or similar port shown in output). Most UI changes can be tested here, but the server must be running for full functionality.
The desktop app is a native Tauri application that wraps the web UI.
To run the native desktop app:
bun run --cwd packages/desktop tauri devThis starts the web dev server on http://localhost:1420 and opens the native window.
If you only want the web dev server (no native shell):
bun run --cwd packages/desktop devTo create a production dist/ and build the native app bundle:
bun run --cwd packages/desktop tauri buildThis runs bun run --cwd packages/desktop build automatically via Tauri’s beforeBuildCommand.
Note
Running the desktop app requires additional Tauri dependencies (Rust toolchain, platform-specific libraries). See the Tauri prerequisites for setup instructions.
Note
If you make changes to the API or SDK (e.g. packages/opencode/src/server/server.ts), run ./script/generate.ts to regenerate the SDK and related files.
Please try to follow the style guide
Bun debugging is currently rough around the edges. We hope this guide helps you get set up and avoid some pain points.
The most reliable way to debug OpenCode is to run it manually in a terminal via bun run --inspect=<url> dev ... and attach your debugger via that URL. Other methods can result in breakpoints being mapped incorrectly, at least in VSCode (YMMV).
Caveats:
Other tips and tricks:
If you use VSCode, you can use our example configurations .vscode/settings.example.json and .vscode/launch.example.json.
Some debug methods that can be problematic:
With that said, you may want to try these methods, as they might work for you.
All PRs must reference an existing issue. Before opening a PR, open an issue describing the bug or feature. This helps maintainers triage and prevents duplicate work. PRs without a linked issue may be closed without review.
If your PR includes UI changes, please include screenshots or videos showing the before and after. This helps maintainers review faster and gives you quicker feedback.
For non-UI changes (bug fixes, new features, refactors), explain how you verified it works:
Long, AI-generated PR descriptions and issues are not acceptable and may be ignored. Respect the maintainers' time:
PR titles should follow conventional commit standards:
You can optionally include a scope to indicate which package is affected:
Examples:
These are not strictly enforced, they are just general guidelines:
For net-new functionality, start with a design conversation. Open an issue describing the problem, your proposed approach (optional), and why it belongs in OpenCode. The core team will help decide whether it should move forward; please wait for that approval instead of opening a feature PR directly.
This project uses vouch to manage contributor trust. The vouch list is maintained in .github/VOUCHED.td.
Collaborators with write access can manage the vouch list by commenting on any issue:
Changes are committed automatically to .github/VOUCHED.td.
Denouncement is reserved for users who repeatedly submit low-quality AI-generated contributions, spam, or otherwise act in bad faith. It is not used for disagreements or honest mistakes.
All issues must use one of our issue templates:
Blank issues are not allowed. When a new issue is opened, an automated check verifies that it follows a template and meets our contributing guidelines. If an issue doesn't meet the requirements, you'll receive a comment explaining what needs to be fixed and have 2 hours to edit the issue. After that, it will be automatically closed.
Issues may be flagged for:
If you believe your issue was incorrectly flagged, let a maintainer know.
| Back | FazBrowse Home | New Git URL |