CLI Reference
One config file. 12 focused commands.
No daemon, no database, no MCP server to keep alive. Every command supports --json with clean stdout/stderr separation and predictable exit codes.
All 12 commands
brokenapp initAuto-detect framework, dev command, monorepo workspaces, and port (syncing custom --url ports into dev_cmd); write .brokenapp/config.toml and install agent instructions.
Flags: --url, --dev-cmd, --codebase, --name, --state-dir, --agent claude-code|agents-md|all|none, --protected, --force, --json
brokenapp rolesManage login roles (list, add <role>, remove <role>) with env: references only — zero literal secrets in config.toml.
Flags: --method form|cookie|bearer|supabase|firebase|session|manual, --login-url, --username-env, --password-env, --cookie-env, --token-env, --anon-key-env, --api-key-env, --submit-selector, --check, --state-dir, --json
brokenapp loginVerify any configured role before mapping (honors ready_timeout_secs + cold-SSR retry on --check; fast HTTP preflight for cookie/bearer, headless check for form/supabase/firebase) or capture an interactive SSO/MFA browser session.
Flags: --role <role>, --timeout, --no-start, --json
brokenapp mapRun a write-guarded multi-role Chrome CDP crawl and refresh .brokenapp/map/ artifacts.
Flags: --changed, --role, --roles none, --route, --quick, --full, --resume, --depth, --max-interactions, --view-budget, --max-minutes, --tabs, --no-start, --headed, --allow-writes, --json
brokenapp changesBehavioral and multi-role RBAC access diff against a previous map; acts as a strict CI PR gate.
Flags: --since N, --between OLD NEW, --role <name|all>, --format text|md|markdown|json, --fail-on <categories>, --json
brokenapp parityCompare two saved map directories (<baseline> <candidate>) across all matching roles during a rewrite or migration.
Flags: --format text|markdown|json, --fail-on <categories>, --json
brokenapp deadList high-confidence dead, broken, and no_effect controls with honest exercised/exercisable denominators.
Flags: --include-unexercised, --role <name|all>, --inventory <PATH>, --json
brokenapp uiSub-200ms query over saved maps with zero browser launch. Filter by route, text, status, endpoint, kind, or role.
Flags: --route, --exact-route, --exclude-shell, --text, --status, --calls, --kind, --role, --inventory <PATH>, --compact, --format table|tsv|md|json, --json
brokenapp journeyTrace multi-step paths across routes and in-page modals, drawers, tabs, and wizards to a route, endpoint, or label:<text>.
Flags: --from, --max-hops (default 15), --role <name|all>, --inventory <PATH>, --format text|md|markdown|json, --json
brokenapp doctorValidate binary, PATH, Chrome, .brokenapp/config.toml (including unknown keys), resumable runs, target reachability, and role readiness.
Flags: --json
brokenapp projectsList locally registered projects and their latest map summaries.
Flags: --json
brokenapp feedbackStrictly opt-in: preview (--dry-run) or queue sanitized bug & UX feedback from you or your AI coding agent (zero silent telemetry; --include-stats aggregates all mapped roles).
Flags: --stdin, --category bug|ux|auth|crawler|rbac|journey|other, --agent, --include-stats, --dry-run, --send, --opt-in, --opt-out, --status, --endpoint, --json
Crawl budgets
Fast bounded defaults, opt-in exhaustive depth.
--max-minutes applies per role. Continue interrupted or budget-stopped --full runs anytime with brokenapp map --resume.
| Command | Budget & Behavior | When to Use |
|---|---|---|
| brokenapp map --changed | Affected routes only (falls back to full budget on app-wide edits) | Default after code edits |
| brokenapp map --quick | 3 min / 25 views | Fast smoke check |
| brokenapp map --route /x | Single route; writes isolated partial snapshot (read via --inventory) | Debugging one page without clobbering latest |
| brokenapp map | 10 min / 80 views · depth 2 · 25 controls/view | Standard baseline map / routine refresh |
| brokenapp map --full | Opt-in exhaustive: no global time/view caps · depth 4 (up to 10) · 1000 controls/view · 300s view budget · convergence off | Giant state-heavy SPAs, 100% button/route audits, deep journeys |
brokenapp map --full --depth 8 --view-budget 600 brokenapp map --resume
brokenapp journey "POST /api/orders" --role member --max-hops 40 --format md brokenapp journey "label:Confirm payout" --from /billing --json
Environment & Sandboxes
Environment variables
BROKENAPP_HOMEGlobal directory for registry.json and settings.json (default: ~/.brokenapp). In sandboxed or isolated runs where ~/.brokenapp is unwritable, set BROKENAPP_HOME=/tmp/brokenapp-home.
BROKENAPP_STATE_DIROverride the per-project state directory (default: .brokenapp; same as --state-dir).
BROKENAPP_CHROME_EXECUTABLEExplicit path to Google Chrome or Chromium (also accepts BROKENAPP_CHROME or CHROME_PATH).
BROKENAPP_NO_SANDBOX / BROKENAPP_CHROME_ARGSLinux CI & container launch options (e.g., BROKENAPP_NO_SANDBOX=1 and BROKENAPP_CHROME_ARGS="--disable-dev-shm-usage").
BROKENAPP_FEEDBACK_OPT_IN / BROKENAPP_FEEDBACK_URLSession-scoped opt-in (=1) and optional endpoint override for strictly opt-in brokenapp feedback.
Deterministic exits
Exit codes
Success or clean no-op (e.g., map --changed skipped).
CLI/config error, --fail-on gate violation, INCONCLUSIVE missing baseline, or unmatched journey.
Partial multi-role failure (e.g., anonymous mapped, admin login_failed or timed_out_empty — prior good map preserved).
Interrupted by Ctrl-C — continue where you left off with brokenapp map --resume.
Machine contract
Uniform JSON error envelope
Every CLI/invocation failure under --json, --compact, or --format json emits a consistent envelope on stdout (plus the human message on stderr). Domain exit-1 results (CI gate failures, INCONCLUSIVE, unmatched journeys) return their structured domain JSON.
{
"exit_code": 1,
"status": "error",
"error": "cookie: OWNER_COOKIE is not set (export it, or store the value with `brokenapp roles add owner --force`)"
}