@mockingbirdjs/cli
v0.1.0
Published
CLI for Mockingbird fixture directories: status, mode switching, listing, clearing, and secret scanning.
Readme
@mockingbirdjs/cli
CLI for Mockingbird fixture directories — inspect status, switch modes, list endpoints, clear fixtures, and scan for secrets.
Installed automatically as the mockingbird binary when you add @mockingbirdjs/cli.
Install
npm i -D @mockingbirdjs/cliOr use without installing:
npx @mockingbirdjs/cli statusCommands
status
Print the current mode, endpoint count, and fixture count.
mockingbird status
mockingbird status --dir ./fixturesmode <live|mock|hybrid>
Switch the operating mode. A running dev server picks it up instantly without a restart.
mockingbird mode mock # go offline
mockingbird mode hybrid # back to default
mockingbird mode live # always hit the real backendlist [glob]
List recorded endpoints and their fixture files. Optionally filter by a path glob.
mockingbird list
mockingbird list "/api/users/**"clear [glob] --yes
Delete fixtures. Without a glob, clears everything. Pass --yes (or -y) to skip the confirmation prompt — useful in scripts.
mockingbird clear # clears all, prompts first
mockingbird clear "/api/users/**" --yessanitize --check
Scan all fixture files for secret-shaped values (tokens, passwords, API keys). Exits non-zero if any are found — wire this into CI to catch leaks before they reach the remote.
mockingbird sanitize --checkOptions
| Flag | Default | Description |
|---|---|---|
| --dir <path> | ./mockingbird | Fixture directory |
| --yes / -y | false | Skip confirmation on clear |
| --check | false | Non-zero exit on findings (sanitize) |
| --help / -h | | Print usage |
Environment variable
Set MOCKINGBIRD_MODE to override the mode without touching .state.json:
MOCKINGBIRD_MODE=mock next dev