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 init

Auto-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 roles

Manage 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 login

Verify 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 map

Run 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 changes

Behavioral 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 parity

Compare 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 dead

List high-confidence dead, broken, and no_effect controls with honest exercised/exercisable denominators.

Flags: --include-unexercised, --role <name|all>, --inventory <PATH>, --json

brokenapp ui

Sub-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 journey

Trace 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 doctor

Validate binary, PATH, Chrome, .brokenapp/config.toml (including unknown keys), resumable runs, target reachability, and role readiness.

Flags: --json

brokenapp projects

List locally registered projects and their latest map summaries.

Flags: --json

brokenapp feedback

Strictly 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.

CommandBudget & BehaviorWhen to Use
brokenapp map --changedAffected routes only (falls back to full budget on app-wide edits)Default after code edits
brokenapp map --quick3 min / 25 viewsFast smoke check
brokenapp map --route /xSingle route; writes isolated partial snapshot (read via --inventory)Debugging one page without clobbering latest
brokenapp map10 min / 80 views · depth 2 · 25 controls/viewStandard baseline map / routine refresh
brokenapp map --fullOpt-in exhaustive: no global time/view caps · depth 4 (up to 10) · 1000 controls/view · 300s view budget · convergence offGiant state-heavy SPAs, 100% button/route audits, deep journeys
Exhaustive SPA audit + resume
brokenapp map --full --depth 8 --view-budget 600
brokenapp map --resume
Multi-step customer journey
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_HOME

Global 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_DIR

Override the per-project state directory (default: .brokenapp; same as --state-dir).

BROKENAPP_CHROME_EXECUTABLE

Explicit path to Google Chrome or Chromium (also accepts BROKENAPP_CHROME or CHROME_PATH).

BROKENAPP_NO_SANDBOX / BROKENAPP_CHROME_ARGS

Linux CI & container launch options (e.g., BROKENAPP_NO_SANDBOX=1 and BROKENAPP_CHROME_ARGS="--disable-dev-shm-usage").

BROKENAPP_FEEDBACK_OPT_IN / BROKENAPP_FEEDBACK_URL

Session-scoped opt-in (=1) and optional endpoint override for strictly opt-in brokenapp feedback.

Deterministic exits

Exit codes

0

Success or clean no-op (e.g., map --changed skipped).

1

CLI/config error, --fail-on gate violation, INCONCLUSIVE missing baseline, or unmatched journey.

3

Partial multi-role failure (e.g., anonymous mapped, admin login_failed or timed_out_empty — prior good map preserved).

130

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.

stdout on invocation error (exit 1)
{
  "exit_code": 1,
  "status": "error",
  "error": "cookie: OWNER_COOKIE is not set (export it, or store the value with `brokenapp roles add owner --force`)"
}