AI coding agent, built for the terminal.
Fork designed for seamless integration with epicenter.sh
This is a fork of opencode designed to integrate seamlessly with epicenter.sh. You can view all changes compared to upstream here.
I added a new flag to enable opencode serve
to integrate with epicenter.sh
:
Flag | Purpose | Implementation |
---|---|---|
--cors-origins / -c |
CORS support for epicenter.sh infrastructure compatibility | server.ts |
I removed the opencode
binary in this fork to avoid conflicts with upstream opencode
installations. This fork is designed to be consumed as a library by CLI tools that need OpenCode functionality.
The recommended way to use this fork is through the Epicenter CLI, which provides additional features like tunneling and browser integration:
npm install -g @epicenter/cli
epicenter sh
The epicenter sh
command:
- Automatically finds an available port
- Enables CORS for epicenter.sh
- Provides tunnel options (Cloudflare or ngrok)
- Opens your browser to epicenter.sh with the tunnel URL
You can also use this package directly with bunx:
bunx @epicenter/opencode serve --port 4096 --cors-origins https://epicenter.sh
TypeScript exports allow direct import of the serve command for CLI integration:
npm install -g @epicenter/cli
epicenter sh
Underneath the hood, the epicenter
cli imports the serve.ts
file that we have modified from this fork:
import { ServeCommand } from "@epicenter/opencode/serve"
// Use the serve command in your own CLI tools
This allows CLI tools to integrate OpenCode's functionality while providing their own platform-specific features like tunneling and browser integration.
This repository uses a custom Bun TypeScript release script for the @epicenter/opencode
package.
This monorepo only releases the packages/opencode
package to npm. To create a release:
- Ensure you're on the
epicenter
branch with a clean working directory - Run the release script:
bun scripts/release.ts
The release script validates git state, fetches the latest upstream version tags, resolves Bun's catalog:
references to actual versions, calculates the new epicenter patch version, publishes to npm, creates a git commit and tag, and pushes to the origin
remote.
This fork uses a two-part versioning strategy. When syncing with upstream, versions follow the pattern {upstream-version}-epicenter.1
(e.g., 0.3.58-epicenter.1
). For subsequent patch releases, the script increments the patch number (e.g., 0.3.58-epicenter.2
). The package.json is updated before publishing, but git commits only happen after successful publication to avoid inconsistent states.
These are the relevant changed files in this fork:
├── packages/opencode/ # Main package published to npm
├── scripts/release.ts # Consolidated release script (Bun + TypeScript)
└── README.md # This file (development focus)
The packages/opencode
directory contains its own README focused on usage and installation.
For all other opencode features, configuration, and documentation, see the original opencode repository.
For issues specific to this epicenter.sh integration, please open an issue in this repository.