Programmatic API
Import the engines and call them directly in your own code:
import { parse, validate, diff } from 'gherkin-cli'Each reads .feature source and returns a plain structured result with a pre-computed summary
you can act on without a second pass. They write to no stream and never exit the process, so you
can call them anywhere — inside a build tool, a test, an editor plugin — without touching your
stdout or killing your process.
Determinism
Section titled “Determinism”- Files are returned in input order; scenarios in document order.
- Ids come from a deterministic incrementing generator, so repeat runs over the same input return byte-identical structures.
- No engine mutates its inputs or reaches for ambient state beyond the filesystem (and git, for
diff, through an injectable reader).
The engines
Section titled “The engines”parse— project a suite into a compact scenario/tag/count digest.validate— check.featurewell-formedness.diff— classify scenario changes against a git base.
See also
Section titled “See also”- CLI Reference — the same three capabilities as a command you run.
- AXI output contract — the conventions the CLI layer renders these results through.