Configuration
rnr uses two configuration files: rnr.yaml for task definitions and .rnr/config.yaml for platform setup.
Directory Structure
After running rnr init, your repository will have:
your-repo/
├── .rnr/
│ ├── config.yaml # Platform configuration
│ └── bin/
│ ├── rnr-linux-amd64
│ ├── rnr-macos-amd64
│ ├── rnr-macos-arm64
│ ├── rnr-windows-amd64.exe
│ └── rnr-windows-arm64.exe
├── rnr # Unix shell wrapper
├── rnr.cmd # Windows batch wrapper
└── rnr.yaml # Task definitions
.rnr/config.yaml
Stores which platforms are configured for this repository:
version: "0.1.0"
platforms:
- linux-amd64
- macos-arm64
- windows-amd64
This file is created by rnr init and updated when you add or remove platforms.
rnr.yaml
Your task definitions. See Task Definitions for full documentation.
build: cargo build --release
test: cargo test
lint: npm run lint
Wrapper Scripts
Unix Wrapper (rnr)
The rnr shell script automatically detects your OS and architecture:
- Checks
uname -sfor OS (Linux, Darwin) - Checks
uname -mfor architecture (x86_64, arm64, aarch64) - Executes the correct binary from
.rnr/bin/
Windows Wrapper (rnr.cmd)
The rnr.cmd batch file:
- Uses
PROCESSOR_ARCHITECTUREenvironment variable - Supports both x86_64 (AMD64) and ARM64
- Executes the correct
.exefrom.rnr/bin/
Project Root Detection
rnr searches upward from the current directory to find rnr.yaml. This allows you to run tasks from any subdirectory:
cd my-project/src/components
../../../rnr build # Works - finds rnr.yaml in my-project/
All task paths (dir field) are relative to the project root where rnr.yaml is located.
Monorepo Support
For monorepos, you can have nested rnr.yaml files:
monorepo/
├── rnr.yaml # Root tasks
├── packages/
│ ├── api/
│ │ └── rnr.yaml # API-specific tasks
│ └── web/
│ └── rnr.yaml # Web-specific tasks
└── .rnr/
└── bin/
Delegate to nested task files:
# Root rnr.yaml
api:build:
dir: packages/api
task: build # Runs 'build' from packages/api/rnr.yaml
web:build:
dir: packages/web
task: build # Runs 'build' from packages/web/rnr.yaml
build-all:
steps:
- parallel:
- task: api:build
- task: web:build
Git Integration
The .rnr/ directory and wrapper scripts should be committed to git:
git add .rnr/ rnr rnr.cmd rnr.yaml
git commit -m "feat: add rnr task runner"
This ensures anyone who clones the repository can immediately run tasks without any setup.
Upgrading
When a new version of rnr is released:
./rnr upgrade
This downloads the latest binaries for all configured platforms and updates them in .rnr/bin/.