@sudobility/raidr_cli
v0.0.24
Published
Reconstruct a web app from an raidr capture bundle
Maintainers
Readme
raidr_cli
Reconstruct a working web app from an raidr capture bundle — plus the agent skill that drives the reconstruction.
bun add -g @sudobility/raidr_cliRequires Bun ≥ 1.2. The CLI ships as TypeScript and runs under Bun directly.
Usage
raidr reconstruct <bundle.zip|dir> --out <dir> [--replay]
raidr token <apiHost> [--print]
raidr install [--claude] [--codex] [--agents] [--all]
raidr uninstall [--claude] [--codex] [--agents]raidr install symlinks the reconstruct skill into the personal skills
directory of a coding agent — .claude/skills, .codex/skills, or the shared
.agents/skills path. The skill itself is runtime-agnostic: it drives a shell
binary and reads JSON, so it works the same in Claude Code, Codex, Gemini CLI,
and Copilot CLI.
raidr token <apiHost> gets a site's auth token for raidr's hosted MCP
server without copying it out of DevTools. It opens the site's sign-in page in
a real browser window on your machine (installed Chrome, then Edge, then
Playwright Chromium) with a persistent profile in ~/.raidr/browser, so you
sign in once. When a request carrying your token to a signed-in-only endpoint
succeeds, the window closes and the token is saved to ~/.raidr/config.json
under siteTokens (mode 0600). Your password never leaves the browser.
--print also writes the token to stdout:
SITE_TOKEN=$(bunx --package @sudobility/raidr_cli raidr token api.example.com --print)How the site sends its token comes from the host's API doc on raidr.app,
fetched with the apiKey in ~/.raidr/config.json; without one, pass
--login <url> --style bearer|header|cookie (plus --header-name,
--cookie-name, --user-path). Exit code 2 means the window was closed
before you were signed in.
The split: CLI does the deterministic work, the agent does the judgment
raidr reconstruct performs every stage that has a right answer — source-map
recovery, bundle unpacking, JSON Schema inference, API and route modelling,
project scaffold, and a Hono replay server that serves the
captured traffic back. Each stage writes a JSON artifact to disk.
The reconstruct skill reads those artifacts and does only the work that needs
judgment: implementing components, naming things, wiring routes. Its governing
rule is that the bundle is evidence, not inspiration — everything written
must trace to something captured, and where the bundle is silent it says so.
That boundary is what keeps the system testable. Everything the CLI does is
covered by bun test; only genuinely model-shaped work lives in prose.
Why this is a separate repository
raidr_processor is imported by
raidr_extension, which ships into
a Chrome MV3 bundle. Its defining constraint is that it performs no I/O — no
filesystem, no DOM in its tsconfig lib — which is what keeps it trivially
testable and safe to bundle for the browser.
A CLI is the opposite: it needs fs, path, process, and zip extraction.
Putting that in raidr_processor would place Node-only code in the dependency graph
of a browser artifact and would end the mechanical enforcement of that purity.
So the dependency shape is a diamond, not a chain:
raidr_processor pure: bundle format, redaction, coverage, inference
├── raidr_extension browser: CDP capture, offscreen buffer, side panel
└── raidr_cli node: unzip, filesystem, codegen + the reconstruct skillThe two consumers never see each other.
Development
bun install
bun run typecheck
bun test
bun run fixtures:build # build the sample apps
bun run fixtures:capture # capture them into fixtures/bundles/The raidr project
| Repository | Role |
|---|---|
| raidr_processor | Bundle format and pure analysis |
| raidr_extension | Chrome MV3 extension that performs the capture |
| raidr_cli | Reconstruction CLI and the agent skill — this repo |
| raidr_web | Landing site |
License
BUSL-1.1 — see LICENSE.md.
