rninja

July 2, 2026 · View on GitHub

Crates.io npm PyPI CI Documentation License: MIT

rninja is a drop-in replacement for Ninja with built-in caching — build faster, cache smarter, change nothing.

Website · Documentation · GitHub

A Rust-powered build tool with modern scheduling that reads your existing .ninja files and cuts build times without changing a line of your build configuration.

Installation

Homebrew (macOS & Linux)

brew tap neul-labs/tap
brew install rninja

NPM

npm install -g rninja-cli

PyPI

pip install rninja-cli

Cargo

cargo install rninja

From GitHub Releases

Download prebuilt binaries from the Releases page.

Build from source

git clone https://github.com/neul-labs/rninja
cd rninja
cargo install --path .

Usage

rninja works exactly like ninja—just swap the binary:

# Use directly
rninja

# Or with your existing workflow
rninja -C out/Release
rninja -j8 my_target

# Symlink as ninja for seamless integration
ln -s $(which rninja) /usr/local/bin/ninja

All ninja flags work: -C, -j, -k, -d, -t, and more.

Why rninja?

FeatureBenefit
Drop-in compatibleWorks with existing .ninja files from CMake, GN, Meson, or any generator
Built-in cachingContent-addressed cache skips redundant work automatically
Modern schedulerRust async runtime keeps all cores busy, minimizing idle time
Remote cache readyShare cached artifacts across machines and CI runners

Performance

ScenarioSpeedup
Warm incremental builds2× – 5×
CI with shared cache2× – 5×
Cold builds1.3× – 2×

See BENCHMARK.md for detailed comparisons.

Configuration

rninja works out of the box with sensible defaults. For customization:

# Generate a sample config
rninja -t config -v

Config files are loaded from:

  1. .rninjarc (project)
  2. ~/.rninjarc (user)
  3. ~/.config/rninja/config.toml (XDG)

Environment Variables

VariableDescription
RNINJA_CACHE_DIRCache directory location
RNINJA_CACHE_ENABLEDEnable/disable caching (0 or 1)
RNINJA_REMOTE_URLRemote cache server URL
RNINJA_CACHE_MODElocal, remote, or both

Subtools

All ninja subtools plus extras:

rninja -t clean       # Remove built files
rninja -t compdb      # Dump JSON compilation database
rninja -t graph       # Output graphviz dot file
rninja -t deps        # Show stored dependencies
rninja -t query       # Show inputs/outputs for a path
rninja -t config      # Show/generate configuration

Run rninja -t list for the complete list.

Who is rninja for?

  • C/C++ projects with multi-minute incremental builds
  • CI pipelines running many builds per day
  • Monorepos with shared code across teams
  • Game studios and performance-sensitive teams already using Ninja
  • Anyone who wants faster builds without changing their workflow

How it works

  1. Parse your existing build.ninja file (no changes needed)
  2. Hash inputs, compiler flags, and environment
  3. Check cache for matching artifacts
  4. Build only what's actually changed
  5. Store results for next time

The local cache uses sled for metadata and content-addressed blob storage for artifacts. Optional remote caching uses nng for high-throughput artifact sharing.

Contributing

Contributions welcome! Please see our GitHub repository for:

  • Bug reports and feature requests
  • Pull requests
  • Architecture discussions

Documentation

Part of the Neul Labs toolchain

Explore the rest of the Neul Labs developer tools:

ProjectDescription
rjestA blazing-fast, Jest-compatible test runner — 100x faster warm runs.
rpytestRun your pytest suite faster. Change nothing.
gityMake large Git repositories feel instant.
stkdStacked diffs for GitHub and GitLab.
griteThe issue tracker that lives in your repo. Built for AI agents.

Learn more at neullabs.com.

License

MIT License - see LICENSE for details.


Built with Rust by Neul Labs