Skip to content

feat(container): data-drive global CLI installs from cli-tools.json#2758

Merged
gavrielc merged 1 commit into
mainfrom
feat/cli-tools-manifest
Jun 14, 2026
Merged

feat(container): data-drive global CLI installs from cli-tools.json#2758
gavrielc merged 1 commit into
mainfrom
feat/cli-tools-manifest

Conversation

@gavrielc

Copy link
Copy Markdown
Collaborator

What

The agent's global Node CLIs (claude-code, agent-browser, vercel) now install from a data manifest — container/cli-tools.json — instead of hardcoded ARG + RUN blocks in the Dockerfile.

A skill that needs a CLI tool now adds a { "name", "version" } row (a json-merge) — the safest change shape: deterministic, idempotent, removable — instead of reaching into the Dockerfile. This is the first "core the hotspot" seam: the ~10 tool-installing skills' Dockerfile edits collapse to a manifest append.

How

  • container/cli-tools.json — the tool list.
  • container/install-cli-tools.sh — parses the manifest with node (no new jq dependency), writes the per-tool only-built-dependencies opt-ins into /root/.npmrc, then runs one pinned pnpm install -g. Every install stays on the pnpm path, so the supply-chain policy is unchanged.
  • container/Dockerfile — three ARGs + three RUN layers → COPY + one RUN.
  • container/cli-tools.test.ts + vitest.config.ts — guard: red if a baseline tool is dropped, a version unpins, or the Dockerfile/pnpm wiring is removed.

Notes

  • Byte-for-byte behavior: identical only-built-dependencies opt-ins and identical pinned install specs (verified by reproducing the install command set from the manifest).
  • agent-browser pinned to 0.27.1 (what latest last resolved to) — removes the one floating version, and the test now enforces exact-semver pins for every entry.
  • Layer trade-off: the three tools install in one layer instead of three, so a manifest change rebuilds all three; the --mount=type=cache pnpm store keeps re-installs fast.
  • Seam properties: dormant (no skill installed → identical image), name-free (no skill/vendor names in core), self-justified (trunk grows a generic tool manifest).

Validation

  • Host guard test: 6/6 pass.
  • Manifest → install-command equivalence verified offline.
  • ⚠️ Full ./container/build.sh end-to-end not yet completed on the authoring machine (intermittent connectivity blocked the apt layer); the change sits below that layer and the install mechanism is proven equivalent. A green CI image build before merge is the remaining check.

🤖 Generated with Claude Code

The agent's global Node CLIs (claude-code, agent-browser, vercel) were each
a hardcoded ARG + RUN layer in the Dockerfile, so adding or bumping one meant
editing the Dockerfile — a code reach-in every tool-installing skill had to make.

Move the tool list into container/cli-tools.json. A skill now adds a CLI by
appending a {name, version} entry (a json-merge) — the safest change shape:
deterministic, idempotent, removable. install-cli-tools.sh parses the manifest
with node (no new jq dep), writes the per-tool only-built-dependencies opt-ins,
and runs one pinned `pnpm install -g`, so the pnpm supply-chain path is unchanged.

Behavior is byte-for-byte: same opt-ins, same pinned installs. agent-browser is
now pinned (0.27.1, what `latest` last resolved to) instead of floating.

container/cli-tools.test.ts guards the seam: red if a baseline tool is dropped,
a version unpins, or the Dockerfile wiring / pnpm path is removed.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
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