Documentation

From zero to a diffable UI & RBAC map in three minutes.

Prerequisite: Google Chrome or Chromium installed locally (override with BROKENAPP_CHROME_EXECUTABLE, BROKENAPP_CHROME, or CHROME_PATH). In sandboxed environments where ~/.brokenapp is unwritable, set BROKENAPP_HOME=/tmp/brokenapp-home.

01 · Install

Single zero-dependency Rust binary

Build from source with Rust 1.85+ (edition 2024), install via the shell script or Homebrew formula, or run inside Docker with bundled Chromium. Verify anytime with brokenapp doctor.

$brokenapp init && brokenapp map

Detects your stack, dev command and port, then maps anonymous plus every configured role.

Verify your installation
# Check binary, PATH, Chrome, config, and role readiness
brokenapp doctor

# Machine-readable preflight for agents & CI
brokenapp doctor --json

02 · Quick Start

Init, map, edit, diff

brokenapp init detects your framework, dev command, and port (syncing custom --url ports into auto-detected dev_cmd, warning if an absolute codebase path would be written, and listing workspaces in monorepos so you can pass --codebase apps/<app>). Commit only .brokenapp/config.toml and .brokenapp/map/ — everything else is gitignored automatically.

Baseline + incremental workflow
cd my-web-app
brokenapp init

# Baseline write-guarded crawl across anonymous + configured roles
brokenapp map

# After code edits, re-crawl only affected routes & diff
brokenapp map --changed
brokenapp changes --role all

03 · Login Roles & RBAC

Map public routes and every authenticated role

Configure any number of login roles using form, cookie, bearer, supabase, firebase, or session (for SSO/MFA).

Literal secrets are rejected from config.toml. Same-origin auth POST submissions (NextAuth /api/auth/callback/credentials, Better Auth, custom login routes) pass through during form sign-in while logout and app writes stay blocked. Route warm-up reuses available role credentials to pre-compile protected pages, login --check honors ready_timeout_secs with a cold-SSR retry, /login?next=<route> redirects collapse to one canonical view, authenticated roles seed their UI --check route first while deprioritizing public routes already mapped under anonymous, and any login_failed detail is recorded directly in ROLE-ACCESS.md.

Role setup & preflight verification
# Form login (env references only; supports passwordless dev pickers via --submit-selector)
brokenapp roles add admin --method form --login-url /sign-in \
  --username-env ADMIN_EMAIL --password-env ADMIN_PASSWORD --check /admin

# Cookie or Bearer token
brokenapp roles add member --method cookie --cookie-env MEMBER_COOKIE --check /api/me
brokenapp roles add api_user --method bearer --token-env API_TOKEN --check /api/me

# Interactive SSO / MFA capture
brokenapp roles add sso --method session
brokenapp login --role sso

# Always verify a role before crawling
brokenapp login --role admin --json
brokenapp map --role anonymous --role member --role admin

04 · Deep SPAs & Journeys

Opt-in exhaustive crawls and multi-step customer flows

Default brokenapp map stays fast (10 min / 80 views, depth 2) and automatically boosts the first concrete URL discovered for each unvisited dynamic :id / :slug template so detail pages are reached early. When you need exhaustive button and route coverage on a giant SPA, opt into --full: removes global caps, disables convergence stopping, raises depth and interaction limits, and guarantees nested pass floor time.

brokenapp journey stitches route hops and in-page modal/drawer/tab/wizard chains in the same role context — returning exact step counts, control-kind breakdowns, endpoints, and broken/unexercised flags. On dense single-route tabbed SPAs, raise --view-budget 600; any obscured controls automatically report their top covering selectors.

Deep SPA mode + customer journey queries
# Opt-in exhaustive SPA audit (pause/resume anytime with --resume)
brokenapp map --full --depth 8 --view-budget 600
brokenapp map --resume

# Query multi-step customer journeys (offline, <0.2s)
brokenapp journey "POST /api/orders" --role member --max-hops 40 --format md
brokenapp journey /checkout/confirm --role anonymous --json
brokenapp journey "label:Export CSV" --role admin

05 · CI PR Gate

Block broken controls and RBAC leaks before merge

Supported --fail-on categories: dead, broken, no-effect, rewired, removed, route-removed, endpoint-removed, access-gained, access-lost, any.

Missing configured roles, zero-route collapsed roles, or missing baselines return INCONCLUSIVE (exit 1) instead of falsely passing CI. Periodic background polling and heartbeat keepalives (such as setInterval polls or POST /api/session/renew) are excluded from per-control attribution so consecutive runs stay deterministic.

GitHub Actions PR gate step
brokenapp map --changed --json
brokenapp changes --role all \
  --fail-on dead,broken,access-gained,access-lost \
  --format markdown > pr-diff.md

06 · Legacy-to-Rewrite Parity

Verify rewrites before cutting over traffic

Map your legacy app and your rewrite separately, then diff both saved map directories across every matching role to surface missing routes, missing endpoints, dead controls, and access drift.

Cross-app parity comparison
brokenapp parity ./legacy-app/.brokenapp/map ./new-app/.brokenapp/map \
  --format markdown \
  --fail-on dead,broken,access-gained

07 · Opt-In Agent Feedback

Queue redacted bug & UX reports from your agent

BrokenApp never sends silent telemetry. If you explicitly opt in via brokenapp feedback --opt-in (or BROKENAPP_FEEDBACK_OPT_IN=1), your coding agents can submit locally redacted friction reports to the BrokenApp triage queue (with optional --include-stats aggregating numeric coverage across all mapped roles via roles_mapped). Preview the exact payload anytime with --dry-run.

Inspect the exact feedback schema & redaction rules
Opt-in agent feedback
# Opt in once (stored in ~/.brokenapp/settings.json)
brokenapp feedback --opt-in

# Preview redacted payload locally (zero network)
brokenapp feedback "Auth flow detail" --category auth --agent claude-code --include-stats --dry-run

# Queue to https://brokenapp.io/api/feedback
brokenapp feedback "Auth flow detail" --category auth --agent claude-code --include-stats --send