spec-forge-cli is the authoritative Rust runtime for the spec-forge YAML workflow.
Language versions:
- Package:
@cli-forge-bin/spec-forge-cli - Source repository:
ByteLandTechnology/spec-forge - Rust edition:
2024 - Minimum Rust version:
1.85 - Release harness requirements: Node
^22.14.0 || >=24.10.0, npm>=10
Use this CLI when you need to initialize a workspace, resolve the next interaction, update artifacts, record approvals, check gates, advance stages, or validate the UX contract.
npm install -g @cli-forge-bin/spec-forge-cliThe npm package selects a matching native binary for these published targets:
darwin-arm64darwin-x64linux-arm64linux-x64win32-arm64win32-x64
No postinstall download is required.
Run this helper from spec-forge-cli/ inside a checked-out repository clone.
./scripts/install-current-release.shUse the helper script when you already have the repository checked out and want to install the binary from a released tag without going through the npm registry.
Run these examples from the repository root so --target . points at the repo workspace.
spec-forge-cli init --target . --spec-id demo --request-title "Demo Spec"
spec-forge-cli resolve --target . --spec-id demo --skill spec-forge --stage router --write --format json
spec-forge-cli ux validate --target .
spec-forge-cli help gate check --format json| Command | Purpose |
|---|---|
init |
Create .spec-forge/, per-spec YAML skeletons, and initial gate state. |
resolve |
Resolve the current workspace state into the next required interaction or ready state. |
apply |
Persist one accepted parameter answer or choice selection. |
focus |
Select the next journey or component batch to review. |
artifact get |
Read one artifact from the resolved spec workspace. |
artifact put |
Replace or create one artifact through the CLI. |
artifact merge |
Patch one artifact incrementally through the CLI. |
approve |
Record an explicit approval block on an artifact. |
gate check |
Evaluate a stage gate from persisted YAML state. |
stage advance |
Promote a stage only after the current gate passes. |
ux validate |
Validate shared UX contracts and agent metadata alignment. |
help |
Show command help in human-readable or structured form. |
Representative commands:
spec-forge-cli apply --target . --spec-id demo --stage intake --parameter problem_goal --value '"Ship the workflow"'
spec-forge-cli focus --target . --spec-id demo --stage journeys --write
spec-forge-cli artifact get --target . --spec-id demo --file framing/request-context.yaml
spec-forge-cli artifact put --target . --spec-id demo --file journeys/journey-alpha.yaml --value '{}'
spec-forge-cli artifact merge --target . --spec-id demo --file framing/request-context.yaml --value '{problem:{goal:"Ship the native CLI"}}'
spec-forge-cli approve --target . --spec-id demo --file architecture/solution-outline.yaml --note 'Approved after review.'
spec-forge-cli gate check --target . --spec-id demo --stage intake --write
spec-forge-cli stage advance --target . --spec-id demo --stage intakeStructured commands support:
--format yaml--format json--format toml
Use --help for terminal help text, or spec-forge-cli help <command> --format json when you need machine-readable command metadata.
Example:
spec-forge-cli help gate check --format jsonRun these validation commands from the repository root.
cargo test --manifest-path spec-forge-cli/Cargo.toml
cargo fmt --manifest-path spec-forge-cli/Cargo.toml --check
cargo clippy --manifest-path spec-forge-cli/Cargo.toml -- -D warnings
cargo package --manifest-path spec-forge-cli/Cargo.toml --offline
spec-forge-cli ux validate --target .Use the release harness only when preparing packages or verifying the release path.
Run the release-harness commands in this section from spec-forge-cli/.
Run a dry packaging rehearsal before a real release:
npm ci
npm run release:rehearsePrepare release assets and npm prerequisites before the first production publish:
npm run release:prepublishRecovery entry points:
- If the rehearsal fails because dependencies or auth are missing, fix the environment and rerun
npm ciandnpm run release:rehearse. - If a CI release is wedged after a tag already exists, rerun the
ReleaseGitHub Actions workflow with the requiredrecover-versioninput and the optionalrecover-run-idinput when you need to reuse the original build artifacts. - If you need a local install from an already released tag, rerun
./scripts/install-current-release.shfromspec-forge-cli/.
Note
release:rehearse validates packaging without creating Git tags, GitHub Releases, or real npm publishes.