Overview
Proxy for Cargo (Rust build tool) with token-optimized output. Shows only relevant build information and test failures.Syntax
Subcommands
rtk cargo build
Build with minimal output.Build optimized artifact
rtk cargo test
Run tests, show only failures.Pass additional arguments to test binary
rtk cargo clippy
Lint with grouped warnings.rtk cargo check
Type-check without building.rtk cargo install
Install binary, show progress summary.Examples
Build Release Binary
Run Tests with Nocapture
Lint All Targets
Features
- Failures only: For tests, only shows failed cases with context
- Grouped linting: Clippy warnings grouped by file and rule
- Progress stripping: Removes compilation progress bars
- Error context: Shows file location and relevant code snippet
Implementation
Source:src/cargo_cmd.rs
Optimizations
- Strips “Compiling (N/M)” progress lines
- Removes dependency compilation messages
- Groups similar warnings/errors
- Formats durations compactly (“3.2s” vs “3.234567s”)
Related Commands
Token Savings Summary
| Command | Standard | RTK | Savings |
|---|---|---|---|
build (success) | ~1200 tokens | ~180 tokens | 85% |
test (passing) | ~3000 tokens | ~300 tokens | 90% |
clippy | ~2000 tokens | ~400 tokens | 80% |
install | ~1500 tokens | ~120 tokens | 92% |
