feat(build): single-binary distribution via bun --compile#1
Merged
Conversation
- Add `bun build --compile` build scripts producing standalone binaries for darwin-arm64/x64, linux-x64/arm64, windows-x64 (~63MB host target) - Embed template files via auto-generated `src/cli/templates/embedded.ts`, with filesystem-first / embedded-fallback loader so npm/npx/dev still reads from `templates/` and the compiled binary uses inline strings - Lazy-load pyodide (13MB WASM) via dynamic import — keeps it out of the compiled binary unless `PYTHON_SANDBOX_READY=true` enables it at runtime - Skip `npm install -g` self-bootstrap when running as compiled binary (new `runtime-detect.ts` heuristic on `process.execPath`) - Add `.github/workflows/release.yml` that builds the 5-target matrix on tag push and attaches binaries + SHA256SUMS to a GitHub Release - README: document npm / bunx / standalone-binary install paths
…pServers
Adds an "Installation Options → Build Standalone Binary (from Source)"
section covering `npm run build:binary{,:all}`, Bun 1.1+ prerequisite,
template embedding step, and a sample mcpServers JSON snippet that
points `command` at the compiled binary instead of `npx`/`node`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bun build --compilepipeline producing standalone binaries for all five targets (darwin-arm64/x64, linux-x64/arm64, windows-x64); host build is ~63 MB.scripts/embed-templates.ts+ filesystem-first / embedded-fallback loader), so npm/npx/dev still reads fromtemplates/while the compiled binary uses the embedded copy.--external pyodide, keeping it out of the binary unlessPYTHON_SANDBOX_READY=trueis set at runtime.runtime-detect.tsheuristic onprocess.execPathskips thenpm install -gself-bootstrap when running as the compiled binary..github/workflows/release.ymlbuilds the 5-target matrix on tag push and attaches binaries + SHA256SUMS to a GitHub Release.mcpServerswiring example.Smoke test (darwin-arm64, this branch)
npm run build:binaryproducedbin/code-executor-mcp(Mach-O 64-bit arm64, 63 MB).command/argsin~/.mcp.jsonwith the absolute binary path; Claude Code started the server cleanly (single process, nonode/npxparent).mcp__code-executor__health→healthy: true, 350 wrapped tools connected.executeTypescriptround-trip through a child MCP (basic-memory.list_memory_projects) succeeded in 66 ms.Test plan
npm run build:binarysucceeds on the host target.npm run build:binary:allcross-compiles all five targets..github/workflows/release.ymland attaches all five binaries + SHA256SUMS.code-executor-mcp setup.PYTHON_SANDBOX_READY=trueis set.🤖 Generated with Claude Code