Summary
Add the ability for rnr to download and manage native CLI tools from GitHub releases, providing an npx-like experience without requiring Node.js.
Motivation
Many projects use npx to run tools like commitlint, prettier, etc. This requires Node.js to be installed. With the growing ecosystem of native CLI tools (Rust, Go, etc.), rnr could provide a way to download and run these tools without any runtime dependencies.
Example use case: Replace husky + commitlint with a native alternative:
# Before (requires Node.js)
npx --no -- commitlint --edit $1
# After (no Node.js needed)
./rnr lint-commit "$1"
Proposed Design
rnr.yaml tools section
# Define tool dependencies
tools:
cog: cocogitto/cocogitto@6.1.0
dprint: dprint/dprint@0.45.0
# Tasks can reference tools
lint-commit:
description: Validate commit message
cmd: ${tools.cog} check --edit ${1}
format:
cmd: ${tools.dprint} fmt
New commands
rnr tools install # Download all tools to .rnr/tools/
rnr tools install cog # Download specific tool
rnr tools update # Update tools to latest versions
rnr tools list # Show installed tools
rnr hooks install # Set up git hooks that call rnr tasks
rnr hooks remove # Remove git hooks
Tool resolution
- Parse
owner/repo@version format
- Fetch release from GitHub API
- Download appropriate binary for current platform
- Cache in
.rnr/tools/ (gitignored) or .rnr/bin/ (committed)
- Make executable
Git hooks integration
rnr hooks install would create hooks in .git/hooks/ that delegate to rnr:
#!/bin/sh
# .git/hooks/commit-msg
./rnr lint-commit "$1"
Native alternatives to common npx tools
| npx tool |
Native alternative |
Language |
| commitlint |
cocogitto |
Rust |
| prettier |
dprint |
Rust |
| eslint |
oxlint |
Rust |
| typescript |
swc |
Rust |
| husky |
(git hooks directly) |
- |
Open questions
- Should tools be committed (like binaries) or downloaded on first use?
- How to handle tool versioning and updates?
- Should there be a central registry or just GitHub releases?
- How to handle tools that aren't on GitHub?
Priority
Low - nice to have for future enhancement.
Summary
Add the ability for rnr to download and manage native CLI tools from GitHub releases, providing an npx-like experience without requiring Node.js.
Motivation
Many projects use
npxto run tools likecommitlint,prettier, etc. This requires Node.js to be installed. With the growing ecosystem of native CLI tools (Rust, Go, etc.), rnr could provide a way to download and run these tools without any runtime dependencies.Example use case: Replace husky + commitlint with a native alternative:
Proposed Design
rnr.yaml tools section
New commands
Tool resolution
owner/repo@versionformat.rnr/tools/(gitignored) or.rnr/bin/(committed)Git hooks integration
rnr hooks installwould create hooks in.git/hooks/that delegate to rnr:Native alternatives to common npx tools
Open questions
Priority
Low - nice to have for future enhancement.