cli-binary-size
Installation
SKILL.md
CLI Binary Size
The standalone composio executable is a Bun single-file executable, so most of it is the Bun runtime, not the CLI's code. Measure that floor before crediting any change with a size difference.
Read references/experiments.md before trying a build mode, Bun version, compiler, or runtime: it records what was already measured and what broke.
Measure first
- Run
pnpm --filter @composio/cli size:report(scripts/size-report.ts;--allfor every target,--jsonfor data). It compiles a one-line program with the release flags (the floor, what Bun alone weighs) and the CLI, and reports the executable, the CLI's share of it (executable minus floor), companion modules, installed footprint, zip,.tar.xz, and the latest stable release's zip. - Measure what users get: the download per target and the installed footprint, against the last release. An unchanged executable does not mean an unchanged download: companions ship next to it.
- Credit a change with a size difference only after running the report on its base and its branch with the same Bun version and flags. A build mode that removes a fixed amount (plain
--trim) gives the same saving on any code. - If the goal is below the floor, say so before trimming code, and look at distribution options (below) and the Bun version instead.
Build the way the release does
Every executable is compiled by compileExecutable in scripts/_shared.ts (executableBuildArgs holds the flags). Experiment through it, or with the same flags; a hand-written bun build --compile measures a different build. test/src/scripts/executable-build-paths.test.ts fails on a --compile flag in any other tracked file except documentation and vendored code.