Ninja
$ ninja Community Low RiskNinja (ninja) is a minimal C++ build executor focused on maximum incremental build speed for build.ninja manifests generated by CMake, Meson, or GN. It supports -n (--dry-run), -t query, -t targets, and -t compdb (compile_commands.json export), though regular build logs are unstructured text.
brew install ninja ninja executes parallel local compile/link DAGs directly from build.ninja on disk; MCP is inapplicable.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports -n (--dry-run), --quiet, -C <dir>, -t targets/query, and JSON output via -t compdb, though compiler stdout/stderr remains plain text.
ninja -nprovides exact build dry-run command outputninja -t compdbgeneratescompile_commands.json
Local-only build execution scoped to the -C build directory, with -n dry-run and -t clean tools.
ninja -nverifies exact commands before executing
Tiny standalone C++ binary available via Homebrew, PyPI, apt, and GitHub releases across macOS, Linux, and Windows.
- Zero-dependency static binary across macOS, Linux, and Windows
Unmatched no-op / incremental stat speed on large C/C++ build graphs, far faster than GNU Make.
- Sub-second no-op rebuild checks on large codebases
Widely deployed ninja-build/ninja project under Apache-2.0 license.
- Official
ninja-build/ninjarepository
Concise manual at ninja-build.org/manual.html and clear -h / -t list help.
- Single-page reference manual at ninja-build.org/manual.html
Security, Auth & Guardrails
No authentication required; build state is stored locally in .ninja_log and .ninja_deps inside the build directory.
Apache-2.0 open-source CLI; free to use.
# Ninja (ninja) Agent Rules - Always preview stale targets with `ninja -C build -n` when checking if a build is clean. - Use `ninja -C build -t compdb` to inspect exact compiler flags and `--quiet` during builds to save context tokens.
Agent-Ready Command Recipes
Safe Read-Only Queries
ninja -C build -n
Prints the exact compile/link commands that would execute without running any tools.
ninja -C build -t compdb
Outputs compile_commands.json entries for all build rules to stdout.
Controlled Writes & Previews
ninja -C build --quiet
Rebuilds out-of-date targets in parallel while suppressing [N/M] progress lines unless errors occur.
Strengths for Agents
- +
ninja -ngives agents an exact dry-run of every command Ninja would execute. - +
ninja -t compdbemits JSON compilation databases for static analysis tools. - + Blazingly fast parallel execution and near-instant no-op rebuild verification.
Caveats & Pitfalls
- ! Requires a higher-level generator (CMake, Meson, GN) to author
build.ninja. - ! Build diagnostics from underlying compilers (
clang/gcc) are emitted as unstructured text.