Files
claude-agent-acp/src/binary-entry.ts
Ben Brandt 0ce2751808 Ship the Claude CLI next to the executable instead of embedding it
A child process can't run a file inside $bunfs, so the embedded CLI had
to be copied to the temp directory on first run (~300 MB, a second copy
on disk). Shipping it in the archive next to claude-agent-acp needs no
extraction, and the entry no longer has to be generated per target.
2026-11-04 11:27:20 +01:00

13 lines
646 B
TypeScript

// Entry of the release executable (`scripts/build-binary.mjs`). It registers the
// Claude CLI shipped next to the executable before importing the agent:
// index.ts starts serving (or, with --cli, spawns the CLI) while it evaluates,
// and a static import would evaluate it before this module's body runs.
import { realpathSync } from "node:fs";
import { dirname } from "node:path";
import { useBundledClaudeCli } from "./claude-cli.js";
// realpath, so a symlink to the executable (e.g. in /usr/local/bin) still finds
// the CLI next to the real file.
useBundledClaudeCli(dirname(realpathSync(process.execPath)));
await import("./index.js");