Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions DIVERGENCES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ upstream maintainers — see README → Syncing with upstream for why and how.
| `packages/core/src/global.ts`, `packages/core/test/global.test.ts`, `packages/opencode/test/cli/mcp-add.test.ts` | `const app = "opencode"` → `"codev-code"`; test expectations `tmpdir()/opencode` → `tmpdir()/codev-code` and `.config/opencode/` → `.config/codev-code/` | Config/data/cache/state dirs under `~/.config/codev-code` etc.; upstream tests assert the literal dir name. | Keep ours (the one constant + expectations); take upstream's surrounding changes. |
| `packages/opencode/src/index.ts`, `packages/opencode/test/cli/error.test.ts`, `packages/opencode/test/cli/help/__snapshots__/help-snapshots.test.ts.snap` | `scriptName("opencode")` → `"codev"`; `show()` prefix check `"opencode "` → `"codev "`; test expectation `` `opencode models` `` → `` `codev models` ``; help snapshots regenerated so usage lines read `codev …` | Help/usage text shows the real user-facing command (the `codev` hub forwards unknown commands to this binary). The `show()` check must always match the scriptName; upstream's error-format test and help snapshots assert the literal command. | Keep our strings + expectation; take upstream's surrounding changes. Regenerate the snapshot file with `bun test test/cli/help --update-snapshots` instead of hand-merging. |
| `package.json` (root) | Added `release` script delegating to packages/opencode | `bun run release` works from the repo root. | Keep our release line; take upstream's other fields. |
| `packages/opencode/package.json` | bin key `opencode` → `codev-code` (shim path `./bin/opencode` unchanged); added `release` script | Installed binary is named `codev-code`; `bun run release` publishes the version in this file (upstream-synced; script/release.ts is fork-only). | Keep our bin key and release line; take upstream's other fields including `version`. |
| `packages/opencode/package.json` | bin key `opencode` → `codev` (shim path `./bin/opencode` unchanged); added `release` script | Installed command is `codev` — matches the CLI's `scriptName` and help text (the hub's command is `codevhub`; it relinquished the `codev` bin in codev-ai ≥ 0.4.0). `bun run release` publishes the version in this file (upstream-synced; script/release.ts is fork-only). | Keep our bin key and release line; take upstream's other fields including `version`. |
| `bun.lock` | Mirrors the bin key rename above | Lockfile records workspace bin mappings. | Regenerate with `bun install`; never hand-merge. |
| `packages/opencode/script/build.ts` | Platform packages' `package.json` name `codev-code-<platform>` (dist dir names unchanged — the bun compile target derives from them) | npm publishing under the fork's names. | Keep our `name:` line; take upstream's surrounding changes. |
| `packages/opencode/script/publish.ts` | `PUBLISH_NAME = "codev-code"` const; npm description "CoDev Code — the AI agent harness"; published-name→dir map; main pkg name + bin key; env-guarded exit before the Docker/AUR/Homebrew section | npm-only publishing under the fork's names (unscoped, public on npmjs); upstream's other channels target anomalyco infra. | Keep our names, description + early exit; take upstream's npm-section changes above the exit. |
| `packages/opencode/script/publish.ts` | `PUBLISH_NAME = "codev-code"` const; npm description "CoDev Code — the AI agent harness"; published-name→dir map; main pkg name + bin key `codev`; embedded README (hub via `codevhub install`, direct install runs `codev`); env-guarded exit before the Docker/AUR/Homebrew section | npm-only publishing under the fork's names (unscoped, public on npmjs); the installed command is `codev`; upstream's other channels target anomalyco infra. | Keep our names, description, bin key + early exit; take upstream's npm-section changes above the exit. |
| `packages/opencode/bin/opencode` | `base` prefix `opencode-` → `codev-code-` | Runtime platform-binary lookup must match the published names. | Keep our prefix. |
| `packages/opencode/script/postinstall.mjs` | `base` prefix `opencode-` → `codev-code-` | Install-time platform-binary fetch must match the published names. | Keep our prefix. |
| `packages/tui/src/logo.ts` | Pixel glyphs "open"+"code" → "co"+"dev"; added hub-style `banner` (ANSI-Shadow CODEV) | Branded wordmark art; `banner` feeds the TUI home banner, CLI help, and presentation mode. | Keep our glyphs and banner. |
Expand Down Expand Up @@ -60,17 +60,20 @@ upstream maintainers — see README → Syncing with upstream for why and how.

## Known rebrand gaps (deliberate, revisit before external distribution)

- **Auto-update**: upstream's updater (`packages/core/src/installation/`) still hardcodes
`opencode-ai` and upstream's release channels. The codev hub launches the agent with
`OPENCODE_DISABLE_AUTOUPDATE=1`, so the notify/auto path is off in normal use — but a
direct `codev-code upgrade` would still install stock opencode. Patch or disable the
upgrade command before distributing outside the team.
- **Auto-update**: the updater (`packages/opencode/src/installation/`) targets the
`codev-code` npm package and the quickbeard/codev-code GitHub releases (see table row),
so `codev upgrade` installs the fork, not stock opencode. The codev hub still launches
the agent with `OPENCODE_DISABLE_AUTOUPDATE=1` so the hub owns updates. Remaining gaps:
the `curl` install path still fetches upstream's install script, and
`packages/opencode/src/cli/cmd/uninstall.ts` still uninstalls `opencode-ai` (wrong
package; unlisted divergence — patch before distributing outside the team).
- **Publishing**: npm packages publish as `codev-code` / `codev-code-<platform>` — unscoped,
therefore PUBLIC on npmjs (like `codev-ai`). Local-only for now (no CI workflow): run
`bun run release [channel] [--skip-build]` from `packages/opencode` with npm publish
auth in place. The version comes from package.json (upstream-synced — releases track
the upstream version the fork was built from; suffix like `-codev.1` for fork-only
re-releases). Docker/AUR/Homebrew/GitHub-release channels are upstream-only and
the upstream version the fork was built from; numeric revision like
`1.17.16-1` for fork-only re-releases, see README → Publishing).
Docker/AUR/Homebrew/GitHub-release channels are upstream-only and
disabled. The binary inside platform packages is still named `opencode` (cosmetic).
- **UI branding**: TUI banner, default-theme accent, desktop/web app names, and favicon/PWA
assets are rebranded (see table). Still upstream-branded, deliberately: in-app i18n strings
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ bun release --skip-build # reuse an existing dist/ (must match the package.js
Notes:

- With 2FA-on-publish, npm may prompt once per package (13 of them). A granular automation token avoids that: `npm config set //registry.npmjs.org/:_authToken <token>`.
- The wrapper refuses to run when the version is already on npm. For a fork-only re-release between upstream syncs, set a suffixed version in `packages/opencode/package.json` (e.g. `1.17.13-codev.1`); the next sync takes upstream's value back.
- Verify after publishing: `npm view codev-code` and `npm install -g codev-code && codev-code --version`.
- The wrapper refuses to run when the version is already on npm. For a fork-only re-release between upstream syncs, add a numeric revision to the version in `packages/opencode/package.json` (e.g. `1.17.16-1`, then `1.17.16-2`) — the Nth fork build of that upstream release; the next sync takes upstream's value back. Semver sorts the suffixed form below the bare `1.17.16`, but installs follow the `latest` dist-tag, so that quirk is harmless.
- Verify after publishing: `npm view codev-code` and `npm install -g codev-code && codev --version`.

## Syncing with upstream

Expand Down
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/opencode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dev:temporary": "bun run --conditions=browser ./src/temporary.ts"
},
"bin": {
"codev-code": "./bin/opencode"
"codev": "./bin/opencode"
},
"exports": {
"./*": "./src/*.ts"
Expand Down
4 changes: 2 additions & 2 deletions packages/opencode/script/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ await Bun.file(`./dist/${pkg.name}/README.md`).write(
"",
"```sh",
"npm install -g codev-ai",
"codev install",
"codevhub install",
"codev",
"```",
"",
Expand Down Expand Up @@ -93,7 +93,7 @@ await Bun.file(`./dist/${pkg.name}/package.json`).write(
url: "git+https://github.com/quickbeard/codev-code.git",
},
bin: {
"codev-code": `./bin/${pkg.name}.exe`,
codev: `./bin/${pkg.name}.exe`,
},
scripts: {
postinstall: "node ./postinstall.mjs",
Expand Down
6 changes: 4 additions & 2 deletions packages/opencode/script/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import pkg from "../package.json"
// The version is read from package.json — the single source of truth. That
// field stays upstream-synced (their release pipeline rewrites it), so fork
// releases track the upstream version they were built from. For a fork-only
// re-release between upstream syncs, bump with a suffix (e.g. 1.17.13-codev.1)
// re-release between upstream syncs, add a numeric revision (1.17.16-1, then
// 1.17.16-2 — the Nth fork build of that upstream release; installs follow
// the latest dist-tag, so the prerelease-sorts-below-base quirk is harmless)
// and let the next sync take upstream's value back.
//
// Channel is the npm dist-tag and defaults to `latest`; pass e.g. `beta` for
Expand Down Expand Up @@ -62,4 +64,4 @@ if (!skipBuild) await $`bun ${import.meta.dirname}/build.ts`.env(env)
await $`bun ${import.meta.dirname}/publish.ts`.env(env)

console.log(`\nReleased codev-code@${version} (dist-tag: ${channel})`)
console.log(`Verify: npm view codev-code@${version} && npm install -g codev-code`)
console.log(`Verify: npm view codev-code@${version} && npm install -g codev-code && codev --version`)
Loading