Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

bdd init

Scaffold build files, a Cucumber runner, an empty requirements spec, and the CLI’s configuration in the project root. Existing files are never overwritten — they are reported as skipped.

Usage: bdd init [OPTIONS]

Flags

FlagDescription
--language <LANGUAGE>Target language: java, javascript, typescript, dotnet, or rust. Prompted interactively when omitted.
--name <NAME>Project name used inside the generated build files. Defaults to the root directory’s name.
--root <ROOT>Project root to scaffold into. Defaults to ..
--model <MODEL>Accepted (global flag) but unused — init is fully deterministic.

What gets created

Every language gets the two spec-driven anchors:

  • requirements/requirements.json — an empty, valid spec.
  • .bdd-mcp.toml — the CLI/MCP configuration.

Plus the language’s build and BDD harness:

LanguageScaffolded files
javapom.xml (Maven + Cucumber-JVM), src/test/java/RunCucumberTest.java, features/.gitkeep
javascriptpackage.json (Cucumber-JS), cucumber.js, features/step_definitions/.gitkeep
typescriptpackage.json, tsconfig.json, cucumber.js (ts-node hooked in), features/step_definitions/.gitkeep
dotnet<Name>.Tests.csproj (Reqnroll), features/.gitkeep
rustCargo.toml (cucumber-rs dev-dependency), src/lib.rs, a Cucumber test harness, features/.gitkeep

Examples

Scaffold a Rust kata in a fresh directory:

mkdir calculator && cd calculator
bdd init --language rust --name "String Calculator"
{
  "language": "rust",
  "framework": "cucumber-rs",
  "created": [
    "requirements/requirements.json",
    ".bdd-mcp.toml",
    "Cargo.toml",
    "src/lib.rs",
    "tests/cucumber.rs",
    "features/.gitkeep"
  ],
  "skipped": [],
  "nextStep": "Draft your first requirement with 'bdd spec draft', then 'bdd spec validate'."
}

Re-running is safe — everything that already exists is skipped:

bdd init --language rust
{
  "language": "rust",
  "framework": "cucumber-rs",
  "created": [],
  "skipped": [
    "requirements/requirements.json",
    ".bdd-mcp.toml",
    "Cargo.toml",
    "src/lib.rs",
    "tests/cucumber.rs",
    "features/.gitkeep"
  ],
  "nextStep": "Draft your first requirement with 'bdd spec draft', then 'bdd spec validate'."
}

Omit --language and the CLI prompts with the supported list; an unrecognized answer re-prompts.

Notes

  • init writes directly to the working tree (there is nothing to protect in an empty project); everything after init goes through staged changes.
  • init does not install runtimes. Run bdd inspect to see whether the language’s runtime is present before expecting bdd test to execute.

See also