@bugcapsule/cli
v0.4.1
Published
BugCapsule CLI: sign in, inspect, replay, verify, gate releases and upload source maps. No Dart or Flutter required to install.
Maintainers
Readme
BugCapsule CLI
Install with Node.js 20 or newer:
npm install -g @bugcapsule/[email protected]
bugcapsule login
bugcapsule --helpNo Dart or Flutter installation is required. The first command downloads and
verifies the standalone CLI engine (0.4.2), then caches it in
~/.bugcapsule/bin. macOS ARM64/x64, Linux ARM64/x64 and Windows x64 are
supported. Direct binaries are available from the CLI release.
The CLI includes the reviewed patch compiler. Local bugcapsule patch
compilation commands require Node.js24 or newer; no engine checkout is needed.
Authenticated patch uploads do not require a separate compiler installation.
Use bugcapsule inspect, run, verify, regress, and gate for capsules
from all four runtimes. Replay/build operations need only the target app's
toolchain. Existing bugcapsule-cli sourcemaps commands remain supported;
bugcapsule sourcemaps works too.
Build tooling for the BugCapsule web SDK: injects debug ids into your bundles and uploads source maps, so error events from minified code show your original files and lines. Guide: Release symbols and source maps.
The same package installs the standalone bugcapsule replay CLI described above.
npm install -D @bugcapsule/[email protected]
# 1. after the build, before deploying
npx bugcapsule-cli sourcemaps inject dist
# 2. in CI, with the project secret key from your CI secrets (never in the app)
BUGCAPSULE_SECRET_KEY=bcs_… npx bugcapsule-cli sourcemaps upload dist \
--url https://api.bugcapsule.com --release [email protected]+52
# 3. do not deploy the maps
find dist -name '*.map' -deleteinject gives every bundle (.js, .mjs, .cjs; node_modules skipped) a
debug id derived from its content and writes it
- into the bundle:
//# debugId=<id>and a one-line snippet that registers the id at runtime (the SDK reads it into the event'sdebugImages). Both are appended before thesourceMappingURLcomment, so no mapping moves; - into the source map (found through
sourceMappingURLor<bundle>.map):"debugId".
It is idempotent: bundles that already have a debug id are left alone.
upload sends, for every bundle with a map (gzipped):
- the map:
kind=sourcemap,debugId,release(with--release),name(<url-prefix><path>.map); - with
--release, the bundle:kind=minified_source,release,name,debugId(--no-sourcesskips it).
Bundles without a debug id are uploaded by release + name only (run
inject first for exact matching). --url-prefix (default ~/, which
matches any origin) must match the path the bundles are served from, e.g.
--url-prefix '~/static/js' for dist/app.js served as /static/js/app.js.
--url defaults to BUGCAPSULE_URL; --key (or BUGCAPSULE_SECRET_KEY) is
the project secret key. --dry-run shows what would change or be uploaded.
Uploads retry on rate limits and temporary server errors (honouring Retry-After).
The functions are also exported (injectFile, uploadSourcemaps,
findBundles, debugIdFromContent) for bundler plugins.
