Skip to content

feat(installer): add CoDev Code target (opencode fork)#1271

Closed
quickbeard wants to merge 1 commit into
colbymchenry:mainfrom
quickbeard:codev-target
Closed

feat(installer): add CoDev Code target (opencode fork)#1271
quickbeard wants to merge 1 commit into
colbymchenry:mainfrom
quickbeard:codev-target

Conversation

@quickbeard

Copy link
Copy Markdown

What

Adds a codev installer target for CoDev Code (codev-code on npm, repo) — a fork of opencode that keeps opencode's config format but renames the on-disk app identity.

Why

CodeGraph's opencode target writes to ~/.config/opencode/opencode.jsonc (or ./opencode.jsonc locally). The CoDev fork reads only ~/.config/codev/codev.jsonc / ./codev.jsonc, so a CodeGraph install is invisible to it — and detect() checks for ~/.config/opencode, so on a machine with only CoDev installed, --target=auto never even offers it. We maintain the fork and hit this directly: CodeGraph simply doesn't work with CoDev today, and manual config editing is the only workaround.

Everything except the paths is already compatible. We verified against the fork's source that it keeps opencode's config shape byte-for-byte: the same mcp.<name> wrapper with { "type": "local", "command": [...], "enabled": true }, the same https://opencode.ai/config.json $schema (the fork stamps that URL into fresh configs itself), the same XDG-only dir resolution via xdg-basedir on every platform, .jsonc preferred over .json, and the same global + project AGENTS.md instructions convention.

How

The opencode target's mechanics apply to the fork verbatim, so rather than copy the file, this PR:

  • targets/opencode-family.ts (new) — the previous opencode.ts implementation, unchanged in behavior, parameterized by a small spec: { id, displayName, docsUrl, appName, sweepLegacyWindowsAppData }. appName drives both the config dir and the config file base name.
  • targets/opencode.ts — now a thin spec over the factory (appName: 'opencode', sweepLegacyWindowsAppData: true). Behavior is identical, including the opencode config path on Windows uses %APPDATA% instead of ~/.config/opencode/ #535 legacy %APPDATA% sweep.
  • targets/codev.ts (new) — the CoDev spec (appName: 'codev'), following the "one new file + one registry entry" architecture. The %APPDATA% sweep is off: the pre-opencode config path on Windows uses %APPDATA% instead of ~/.config/opencode/ #535 misplacement is opencode install history the fork never had, so the codev target must never touch %APPDATA%.
  • Registry + TargetId union entries, the install/uninstall location-prompt hints, README/site-docs agent lists, and a CHANGELOG entry under [Unreleased].

Tests

  • The parameterized contract suite (install/idempotency/sibling-preservation/uninstall/printConfig) picks the new target up automatically from the registry; the two mcp-vs-mcpServers shape checks now cover both family members.
  • New codev-specific tests pin: the global paths (~/.config/codev/codev.jsonc + AGENTS.md), .jsonc-over-.json preference, .json fallback, local ./codev.jsonc, fork independence (installing/uninstalling one never touches the other's files), and that detection and install ignore %APPDATA%/codev entirely.
  • __tests__/installer-targets.test.ts: 172/172 pass. Full npm test: 2008 pass (three unrelated worker-exit flakes under parallel run; those files pass individually).

End-to-end verification

Against a scratch $HOME with the built dist/:

  1. codegraph install --target=auto --yes with only a ~/.config/codev dir present → detects CoDev, writes codev.jsonc + AGENTS.md.
  2. The real codev binary pointed at that config: codev mcp list✓ codegraph connected.
  3. codegraph uninstall --target=codev --yes → config back to the bare $schema file, AGENTS.md block gone.

Notes for review

  • Left the codegraph install/uninstall command descriptions in src/bin/codegraph.ts untouched — they list only 5 of the 8 existing agents already, so updating them felt like separate cleanup.
  • Happy to rename opencode-family.ts or restructure the spec if you'd prefer a different shape for downstream-fork targets.

🤖 Generated with Claude Code

…nfig paths)

CoDev Code (npm codev-code) is an opencode fork that keeps opencode's
config shape byte-for-byte but renames the on-disk app identity, so an
opencode install was invisible to it: the fork reads
~/.config/codev/codev.jsonc / ./codev.jsonc, never
~/.config/opencode/opencode.jsonc.

The opencode target's mechanics (XDG resolution, .jsonc-preferred
fallback, surgical jsonc-parser edits, AGENTS.md block) all apply
verbatim, so they move to a shared opencode-family factory that both
targets are thin specs over. The pre-colbymchenry#535 %APPDATA% sweep stays
opencode-only — the fork never shipped through those versions.

Verified end-to-end: --target=auto detects a ~/.config/codev dir,
writes codev.jsonc, and the real codev binary connects to the
codegraph MCP server from that config; uninstall reverses it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard quickbeard closed this Jul 13, 2026
@quickbeard quickbeard deleted the codev-target branch July 13, 2026 02:27
@quickbeard

Copy link
Copy Markdown
Author

Superseded by #1272 — same change; the head branch was renamed to follow the repo's type/kebab-description branch convention (feat/codev-installer-target), which auto-closed this fork PR.

@quickbeard quickbeard changed the title feat(installer): add CoDev Code target (opencode fork with renamed config paths) feat(installer): add CoDev Code target (opencode fork) Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant