This document is the local development contract for:
- environment setup
- local test/check execution
- mandatory pre-commit and pre-delivery gates
For runtime dependency details and degradation behavior, see BINARY_DEPENDENCIES.md.
Run once on a new machine:
scripts/setup-rust-tooling.shThis installs/updates:
- rustup + cargo
- Rust components:
rustfmt,clippy,llvm-tools-preview cargo-nextestcargo-llvm-cov
The required-checks entrypoint depends on:
gitnpxcargozshrg
For optional runtime tools used by individual CLIs, see BINARY_DEPENDENCIES.md.
- Build workspace:
cargo build - Example CLI help checks:
cargo run -p nils-cli-template -- --helpcargo run -p nils-git-scope -- --help
Primary local entrypoint:
bash scripts/ci/nils-cli-checks-entrypoint.shThis delegates to ./.agents/skills/nils-cli-verify-required-checks/scripts/nils-cli-verify-required-checks.sh.
If all changed files are documentation-only (*.md, docs/**, crates/*/docs/**, root docs like README.md and DEVELOPMENT.md):
bash scripts/ci/nils-cli-checks-entrypoint.sh --docs-onlyNILS_CLI_TEST_RUNNER=nextest bash scripts/ci/nils-cli-checks-entrypoint.shNotes:
nextestmode runscargo nextest run --profile ci --workspace.- Doctests are not included in nextest and must still be run separately unless coverage flow is used.
Coverage gate is mandatory for non-doc changes (total line coverage must stay >= 85.00%):
NILS_CLI_TEST_RUNNER=nextest \
bash scripts/ci/nils-cli-checks-entrypoint.sh --with-coverage--with-coverage runs, after required checks:
mkdir -p target/coverage
cargo llvm-cov nextest --profile ci --workspace --lcov --output-path target/coverage/lcov.info --fail-under-lines 85
bash scripts/ci/coverage-summary.sh target/coverage/lcov.info
cargo test --workspace --docTo override the threshold locally:
NILS_CLI_COVERAGE_FAIL_UNDER_LINES=85 bash scripts/ci/nils-cli-checks-entrypoint.sh --with-coveragebash scripts/ci/nils-cli-checks-entrypoint.sh includes:
bash scripts/ci/docs-placement-audit.sh --strictbash scripts/ci/docs-hygiene-audit.sh --strictbash scripts/ci/markdownlint-audit.sh --strictbash scripts/ci/test-stale-audit.sh --strictbash scripts/ci/third-party-artifacts-audit.sh --strictbash scripts/ci/completion-asset-audit.sh --strictbash scripts/ci/completion-flag-parity-audit.sh --strictzsh -f tests/zsh/completion.test.zshcargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --workspace(orcargo nextest run --profile ci --workspacewhenNILS_CLI_TEST_RUNNER=nextest)
When completion/alias assets are changed, also run:
zsh -n completions/zsh/_<cli>bash -n completions/bash/<cli>
Canonical completion policy and validation workflow:
docs/runbooks/cli-completion-development-standard.md
- In Rust tests, prefer
pretty_assertions::{assert_eq, assert_ne}for readable diffs.
- Every user-facing CLI must expose root
-V, --version. - For clap-based CLIs, set
#[command(version)]on the rootParser. --helpoutput should show-V, --version.
Build and install workspace binaries into ~/.local/nils-cli/:
./.agents/skills/nils-cli-install-local-release-binaries/scripts/nils-cli-install-local-release-binaries.sh