Skip to content

epicenter-so/opencode

 
 

Repository files navigation

opencode logo

AI coding agent, built for the terminal.

Fork designed for seamless integration with epicenter.sh

npm GitHub

opencode Terminal UI


About This Fork

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.

Consuming via CLI

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

Direct Usage

You can also use this package directly with bunx:

bunx @epicenter/opencode serve --port 4096 --cors-origins https://epicenter.sh

Programmatic Usage

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.

Development & Release Process

This repository uses a custom Bun TypeScript release script for the @epicenter/opencode package.

Release Process

This monorepo only releases the packages/opencode package to npm. To create a release:

  1. Ensure you're on the epicenter branch with a clean working directory
  2. 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.

Version Strategy

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.

Workspace Structure

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.

Documentation & Support

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.

About

AI coding agent, built for the terminal.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 56.5%
  • TypeScript 36.4%
  • MDX 3.9%
  • CSS 1.6%
  • Astro 0.6%
  • Shell 0.6%
  • Other 0.4%