badgr-ci-triage
v0.1.0
Published
Local-first CI log triage for flaky tests, dependency failures, build errors, and race conditions.
Maintainers
Readme
badgr-ci-triage
Paste a failing CI log and get a plain-English diagnosis — dependency conflict, flaky test, build error, race condition, or environment issue.
npx badgr-ci-triage --log "npm ERR ERESOLVE unable to resolve dependency tree"Free. No signup required. Runs entirely on your machine.
The problem it solves
CI failures produce walls of text. Finding the root cause means scanning hundreds of log lines to spot the one error that matters. badgr-ci-triage classifies the failure instantly and tells you exactly what to do — no log reading required.
Quick start
# Pass log text directly
npx badgr-ci-triage --log "npm ERR ERESOLVE unable to resolve dependency tree"
# Pipe from a file or command
cat ci-output.txt | npx badgr-ci-triage
# Machine-readable JSON (for CI dashboards or scripts)
npx badgr-ci-triage --log "TypeError: Cannot read properties of undefined" --jsonCLI flags
| Flag | Description |
|------|-------------|
| --log <text> | CI log text to triage (alternatively, pipe via stdin) |
| --json | Output machine-readable JSON |
Exit codes: 0 = failure categorized with a recommended action, 1 = unknown or empty log
Failure categories
| Category | Detected from |
|---|---|
| dependency | ERESOLVE, lockfile errors, package not found |
| build | TypeScript errors (tsc), SyntaxError, webpack/vite failures |
| test | assert, snapshot mismatches, test failed |
| deployment | Deploy/release failures, health check timeouts |
| race | Flaky failures, timeouts, deadlocks |
| environment | Missing env vars, permission denied, secret references |
Example output
badgr-ci-triage — dependency failure
✗ ERESOLVE: unable to resolve dependency tree
Recommended action: Delete node_modules and package-lock.json, then reinstall from scratch.
rm -rf node_modules package-lock.json && npm installbadgr-ci-triage — environment failure
✗ Missing environment variable: DATABASE_URL
Recommended action: Add DATABASE_URL to your CI environment secrets.
Check your CI settings or .env.example for required variables.TypeScript API
import { triageCiLog } from "badgr-ci-triage";
const result = triageCiLog(`
npm ERR code ERESOLVE
npm ERR ERESOLVE unable to resolve dependency tree
`);
console.log(result.category); // "dependency"
console.log(result.checks); // [{ status: "fail", label: "ERESOLVE", detail: "..." }]Types:
interface CiTriageResult {
category:
| "dependency"
| "build"
| "test"
| "deployment"
| "race"
| "environment"
| "unknown";
checks: DiagnosticCheck[];
report: JsonReport;
}
function triageCiLog(log: string): CiTriageResultUse in CI
Triage your own CI logs as part of the pipeline to get structured failure data:
# GitHub Actions example
- name: Triage CI failure
if: failure()
run: echo "${{ steps.build.outputs.stderr }}" | npx badgr-ci-triage --jsonRequirements
- Node.js 18+
