Configuration Overview¶
rninja is designed to work out of the box with sensible defaults, but offers extensive configuration options for customization.
Configuration Methods¶
rninja can be configured through three methods, in order of precedence (highest to lowest):
- Command-line arguments - Highest priority, per-invocation
- Environment variables - Per-session or CI configuration
- Configuration files - Persistent project or user settings
Quick Configuration¶
Generate Sample Config¶
Generate a sample configuration file:
This outputs a complete sample configuration you can customize.
Show Config Paths¶
See where rninja looks for configuration:
Configuration Sections¶
Build Configuration¶
Control build behavior:
[build]
jobs = 0 # Parallel jobs (0 = CPU count)
keep_going = 1 # Failures before stopping
explain = false # Show rebuild reasons
default_targets = [] # Default targets to build
Cache Configuration¶
Configure the build cache:
[cache]
enabled = true # Enable caching
mode = "auto" # local, remote, or auto
directory = "" # Cache directory (default: ~/.cache/rninja)
max_size = 10737418240 # Max size in bytes (10GB)
Output Configuration¶
Control output behavior:
[output]
verbose = false # Verbose output
stats = false # Show statistics
color = "auto" # auto, always, or never
trace_file = "" # Trace output file
Common Configurations¶
Development Machine¶
[build]
jobs = 0
explain = false
[cache]
enabled = true
mode = "local"
[output]
verbose = false
color = "auto"
CI/CD Pipeline¶
[build]
jobs = 0
keep_going = 0 # Build as much as possible
[cache]
enabled = true
mode = "auto" # Use remote if available
[output]
verbose = true
stats = true
color = "never"
Team with Remote Cache¶
With environment:
export RNINJA_CACHE_REMOTE_SERVER=tcp://cache.internal:9999
export RNINJA_CACHE_TOKEN=your-secret-token
Configuration Precedence¶
When the same option is set in multiple places:
Example:
Viewing Effective Configuration¶
To see what configuration rninja is using:
Next Steps¶
-
Configuration file format and locations
-
All supported environment variables
-
Ready-to-use configuration examples