An agent-first Gherkin CLI — parse, validate, and diff .feature files with token-efficient, AXI-conformant output. Wraps the canonical @cucumber/gherkin parser.
Built for AI agents that read and reason over Gherkin suites: compact TOON output by default, minimal default schemas, pre-computed aggregates, structured errors, and clean stream discipline (result on stdout, affordances on stderr).
npx gherkin-cli parse features/**/*.feature| Command | Purpose |
|---|---|
parse |
Project a .feature into a compact digest (scenarios, tags, counts) |
validate |
Check .feature well-formedness; exit 1 + structured errors on invalid |
diff |
Classify scenario changes vs a git ref (added/modified/removed) |
Emits a TOON manifest — per file: feature tags, scenario count, section-comment count, and per scenario name, keyword, tags. --full adds step text, step/example counts. --tag <name> filters. --format json for the structured escape. --ast dumps the raw cucumber GherkinDocument.
Reports Gherkin syntax validity. Exit 0 when all files parse, 1 when any fails, with structured file:line: code message errors honoring --format.
Classifies each scenario as added / modified / removed / unchanged against --base. Lists only the changed scenarios by default; --full also lists the unchanged ones. The classification is always over the whole file, so summary.unchanged and the addOnly aggregate — true means the change is purely additive — read the same either way.
pnpm install
pnpm verify # build + typecheck + test across the workspaceMonorepo: pnpm + turbo + biome + changesets. The CLI lives in packages/gherkin-cli.