whobroke
v1.0.0
Published
Automatically find the exact commit, author, and lines that broke your tests. No more git bisect by hand.
Maintainers
Readme
whobroke
Find the exact commit, author, and lines that broke your tests.
No moregit bisectby hand. Ever again.
npx whobroke "npm test"
✔ found it.
╭──────────────────────────────────────────────────────────╮
│ commit a3f9c12 ─ 3 days ago │
├──────────────────────────────────────────────────────────┤
│ author Alex Chen <[email protected]> │
│ message refactor: clean up order processing logic │
│ hash a3f9c12e8b4d1f7a2c6e9b0d3f8a1c4e7b2d5f8a1 │
╰──────────────────────────────────────────────────────────╯
✗ failing test
applies discount correctly
△ files changed in this commit
→ src/orders.js
→ src/utils/price.js
⚑ suspect lines
src/orders.js:84 + const total = price * quantity
src/orders.js:91 + if (discount) total = total - discount.value
────────────────────────────────────────────────────────────
to see full diff: git show a3f9c12
to revert: git revert a3f9c12how it works
whobroke runs a fully automated git bisect behind the scenes:
- Runs your test suite on HEAD — confirms it's broken
- Scans backwards through history to find the last passing commit
- Binary-searches between good and bad (O log n — fast)
- Reports the exact breaking commit with author, message, changed files, and suspect lines
- Resets git to your original state — no mess left behind
install
# run instantly without installing
npx whobroke "npm test"
# or install globally
npm install -g whobroke
whobroke "npm test"setup (any project)
Run setup once and whobroke will auto-detect your test command:
cd your-project
npx whobroke --setupSupports auto-detection for:
| Stack | Auto-detected command |
|---|---|
| Node.js / npm | npm test |
| Node.js / yarn | yarn test |
| Node.js / pnpm | pnpm test |
| Jest | npx jest --bail |
| Vitest | npx vitest run |
| Python / pytest | python -m pytest -x |
| Go | go test ./... |
| Rust / cargo | cargo test |
| Ruby / RSpec | bundle exec rspec |
| PHP / PHPUnit | ./vendor/bin/phpunit |
| Java / Maven | mvn test -q |
| Java / Gradle | ./gradlew test |
| Makefile | make test |
After setup, just run:
whobroke # uses saved configusage
# basic
npx whobroke "npm test"
npx whobroke "pytest"
npx whobroke "go test ./..."
npx whobroke "cargo test"
npx whobroke "bundle exec rspec"
# search deeper in history (default: 100 commits)
npx whobroke --depth 200 "npm test"
# auto-detect project + save config
npx whobroke --setup
# skip the banner
npx whobroke --no-banner "npm test"options
Arguments:
testCmd your test command (quoted)
Options:
-d, --depth <n> commits to search back (default: 100)
--setup / --init auto-detect project, save .whobroke.json
--no-banner skip the ASCII art
-V, --version show version
-h, --help show helpconfig file
After running --setup, a .whobroke.json is saved in your project root:
{
"testCmd": "npm test",
"runner": "npm",
"depth": 100,
"detected": "package.json (npm/yarn/pnpm)"
}You can edit this manually too. Add it to .gitignore or commit it — your call.
requirements
- Git — any version with bisect support (git 1.7+)
- Node.js 14+
- Your project must have at least one commit where tests passed
faq
does it mess up my git state?
No. whobroke always runs git bisect reset when done (or on error). Your working tree is untouched.
what if ALL commits are broken?
It'll tell you it couldn't find a good commit and suggest --depth 200.
how fast is it?
100 commits = max ~7 test runs (binary search). 1000 commits = ~10 runs.
works on monorepos?
Yes. Pass whatever command runs the relevant tests:npx whobroke "npm run test:payments"
works in CI?
Yes. Use --no-banner for clean CI output.
license
MIT
