CLI reference

Install the CLI as a dev dependency in any project that produces Kensho results:

pnpm add -D @kaizenreport/kensho

The binary is kensho (so npx kensho ...).

kensho generate

Read a results directory and emit the static report site.

kensho generate [--input <dir>] [--output <dir>] [--history <dir>] [--no-compress]
                [--codeowners <path>] [--no-codeowners] [--config <path>]

| Flag | Default | Description | |---|---|---| | --input | ./kensho-results | Where the adapter wrote its results | | --output | ./kensho-report | Where the static site lands | | --history | (none) | Optional kensho-history/ directory of prior run.json files for trend & flake roll-ups | | --config | <input>/../kensho.config.json | Path to a custom config | | --no-compress | off | Skip JSON minification + .gz companions (slower load, easier to debug) | | --codeowners | <repo>/.github/CODEOWNERS | Path to a CODEOWNERS file for owner inference | | --no-codeowners | off | Skip CODEOWNERS owner lookup entirely |

The viewer's JSX is pre-compiled at generate time; if the bundles are missing the CLI auto-runs the viewer build.

kensho open

Serve a generated report locally and open it in the browser.

kensho open [--report <dir>] [--port <n>]

| Flag | Default | Description | |---|---|---| | --report | ./kensho-report | Directory to serve | | --port | auto | Port number (auto-selects a free one) |

Path traversal is blocked; the server only serves files inside --report.

kensho validate

Type-check a results directory against the canonical Kensho v1 schema.

kensho validate [<dir>]

Defaults to ./kensho-results. Exits non-zero on schema violation — use this in CI to gate a push.

kensho diff

Compute a punch-list diff between two kensho-results/ directories.

kensho diff <prev-results-dir> <new-results-dir> [--out <dir>] [--no-terminal]

| Flag | Default | Description | |---|---|---| | --out | (none) | Emit a static HTML diff report into this directory | | --no-terminal | off | Skip the printed punch list (when only --out is wanted) |

Single-pair only — for multi-run history use the Kaizen platform.

kensho badge

Render a status badge SVG you can drop into a README.

kensho badge [--input <dir>] [--type passrate|status|tests] [--out <file>]

| Flag | Default | Description | |---|---|---| | --input | ./kensho-results | Source results | | --type | passrate | passrate · status · tests | | --out | stdout | Write SVG to file |

kensho login

Interactive browser-based auth against the Kaizen platform. Stores a token in your OS keychain (or ~/.config/kensho/credentials as a fallback).

kensho login [--server <url>]

| Flag | Default | |---|---| | --server | https://api.kaizenreports.com |

kensho push

Upload a results directory to your Kaizen workspace.

kensho push [--input <dir>] [--workspace <slug>] [--project <slug>]
            [--token <token>] [--server <url>] [--label k=v]...
            [--dry-run] [--no-attachments] [--quiet] [--force] [--strict]

| Flag | Description | |---|---| | --input | Results directory (default ./kensho-results) | | --workspace | Target workspace slug (else uses the one from kensho.config.json) | | --project | Target project slug | | --token | Skip login and pass a token directly (CI flow) | | --label k=v | Repeatable. Attach a label to the run (e.g. --label release=1.4.0) | | --dry-run | Validate + plan upload, but don't transmit anything | | --no-attachments | Skip uploading screenshots/videos (useful for debugging) | | --quiet | Suppress progress output | | --force | Re-upload even if the run was already ingested | | --strict | Exit non-zero on any warnings — recommended for CI |

The CLI uses two-phase upload: it first calls /v1/ingest/kensho/init for presigned attachment URLs (with sha256 dedup), then /v1/ingest/kensho/finalize with the validated run.json.

kensho version

Print the CLI version. Use this in bug reports and when filing schema issues.

kensho version