* feat(cargo): aggregate test output into single line (#83)
Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".
Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```
After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```
Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)
Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback
Closes#83
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(ci): prevent Python/Go benchmark sections from being silently skipped
**Problem:**
Python and Go benchmark sections were silently skipped in CI because
the RTK repository doesn't contain pyproject.toml or go.mod files.
The sections only ran when these project files existed.
**Solution:**
1. Create temporary fixtures with minimal project structure:
- Python: pyproject.toml + sample.py + test_sample.py
- Go: go.mod + main.go + main_test.go
2. Resolve RTK to absolute path to work after cd into temp dirs
3. Install required tools in CI workflow:
- Python: ruff, pytest
- Go: stable version + golangci-lint
**Impact:**
- Python/Go sections now appear in CI benchmark output
- Self-contained fixtures ensure consistent benchmarking
- No dependency on RTK project structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(hooks): add missing RTK command rewrites
Add 8 missing command rewrites to rtk-rewrite.sh and rtk-suggest.sh:
- cargo check/install/fmt
- tree, find, diff
- head → rtk read (with --max-lines transformation)
- wget
Fixes BSD sed compatibility for head transformation by using literal
spaces instead of \s+ (which doesn't work on macOS).
Impact: ~18.2K tokens saved on previously missed commands discovered
by `rtk discover`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
- Build from source automatically instead of requiring a pre-built binary
- Default install dir to ~/.cargo/bin
- Skip rebuild when binary is up to date
- Warn if install dir is not in PATH
* feat(cargo): aggregate test output into single line (#83)
Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".
Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```
After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```
Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)
Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback
Closes#83
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat: add Python and Go language support
Implements comprehensive support for Python and Go development tooling
with 70-90% token reduction across all commands.
Python commands (3):
- rtk ruff: Linter/formatter with JSON (check) and text (format) parsing (80%+)
- rtk pytest: Test runner with state machine text parser (90%+)
- rtk pip: Package manager with auto-detect uv (70-85%)
Go commands (4):
- rtk go test: NDJSON streaming parser for interleaved test events (90%+)
- rtk go build: Text filter showing errors only (80%)
- rtk go vet: Text filter for issues (75%)
- rtk golangci-lint: JSON parser grouped by rule (85%)
Architecture:
- Standalone Python commands (mirror lint/prettier pattern)
- Go sub-enum (mirror git/cargo pattern)
- 5 new modules: ruff_cmd, pytest_cmd, pip_cmd, go_cmd, golangci_cmd
- Hook integration in rtk-rewrite.sh for transparent rewrites
- Comprehensive tests (47 new tests, all passing)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat(benchmark): add Python and Go commands
Add benchmark sections for Python (ruff, pytest, pip) and Go (go test/build/vet, golangci-lint) to validate >80% token savings in CI pipeline.
Sections conditionally execute based on project markers (pyproject.toml, go.mod) and tool availability.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".
Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```
After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```
Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)
Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback
Closes#83
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Problem: `cargo test` shows 24+ summary lines even when all pass.
An LLM only needs to know IF something failed, not 24x "ok".
Before (24 lines):
```
✓ test result: ok. 2 passed; 0 failed; ...
✓ test result: ok. 0 passed; 0 failed; ...
... (x24)
```
After (1 line):
```
✓ cargo test: 137 passed (24 suites, 1.45s)
```
Changes:
- Add AggregatedTestResult struct with regex parsing
- Merge multiple test summaries when all pass
- Format: "N passed, M ignored, P filtered out (X suites, Ys)"
- Fallback to original behavior if parsing fails
- Failures still show full details (no aggregation)
Tests: 6 new + 1 modified, covering all cases:
- Multi-suite aggregation
- Single suite (singular "suite")
- Zero tests
- With ignored/filtered out
- Failures → no aggregation (detail preserved)
- Regex fallback
Closes#83
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Cargo.toml: add homepage field
- README.md: add website/github/install links
- Formula/rtk.rb: update homepage to website
- release.yml: update homepage and docs link in formula template
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Replaces the commented-out TODO homebrew section with a working
automation modeled on rtk-ai/vox's release pipeline.
On each release, the new homebrew job:
1. Downloads checksums.txt from the just-published release
2. Parses sha256 for all 4 platforms (macOS/Linux × Intel/ARM)
3. Generates the formula with correct version and hashes
4. Pushes to rtk-ai/homebrew-tap via GitHub API
Requires HOMEBREW_TAP_TOKEN org secret (already used by vox).
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Closes#77
- install.sh: update REPO to rtk-ai/rtk (was using old fork name)
- INSTALL.md: fix curl URL from /blob/ (returns HTML) to raw URL
- Cargo.toml: update repository field
- Formula/rtk.rb: update all download URLs and tap reference
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Closes#73
Three issues prevented release-please from uploading build artifacts:
1. Upload steps had `if: github.event_name == 'workflow_call'` conditions
that evaluated to false when called from release-please (event_name
reflects the caller's `push` event, not `workflow_call`)
2. Missing `secrets: inherit` in release-please.yml workflow_call
3. Dead `on: release: published` trigger (GITHUB_TOKEN actions can't
trigger other workflows)
Fix aligned with working rtk-ai/vox pipeline:
- Remove conditional `if` on upload step (always upload)
- Simplify version detection with `inputs.tag` fallback
- Remove dead `release: published` trigger
- Add `secrets: inherit` to workflow_call
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Strip dep compilation, downloading, locking noise from cargo install output.
Keep only installed/replaced/error lines with compact summary format.
Closes#69
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
## Code Quality Improvements
**Extracted helper functions:**
- `prepare_hook_paths()`: Prepare hook directory and paths (DRY)
- `ensure_hook_installed()`: Idempotent hook installation with chmod
- `write_if_changed()`: Generic file write with idempotence
**Before (duplicated):**
- Hook path logic repeated in default_mode + hook_only_mode
- Hook write logic repeated (lost idempotence in hook-only)
- RTK.md write logic duplicated
**After (DRY):**
- Single source of truth for each operation
- Consistent idempotence across all modes
- Reusable helpers for future file operations
## Error Handling Enhancements
**Improved error context:**
- `.with_context(|| format!("Failed to write hook to {}", path))`
- All fs operations now include the path that failed
- Migration warnings include line numbers and actionable steps
**Better Windows messaging:**
- Clear explanation of platform limitations
- Explicit fallback behavior
## API Improvements
**Idiomatic Rust:**
- `&PathBuf` → `&Path` for all function parameters
- Pattern match tuple instead of if/else chain
- `anyhow::bail!` for Windows hook-only error
## Impact
- **Maintainability**: Single place to update hook/file logic
- **Debuggability**: Error messages show exact paths
- **Robustness**: Consistent idempotence prevents conflicts
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Problem:
- `rtk git add -A` failed with "unexpected argument '-A' found"
- Git flags like -A, -p, --all were rejected by Clap parser
- Only filenames could be passed to `git add`
Solution:
- Add `allow_hyphen_values = true` to Add command args (following PR #5 pattern)
- Change Add enum variant from `Add { files }` to `Add` (unified with other git commands)
- Modify run_add() to accept args slice and pass all arguments to git
- Add exit code propagation for consistency with other git commands
Impact:
- All native git add flags now work: -A, -p, --all, --update, etc.
- Maintains RTK compact output format ("ok ✓ 2 files changed, ...")
- Preserves backward compatibility (no args defaults to ".")
Testing:
- Manual: `rtk git add -A` works correctly
- All existing tests pass (154 passed)
- Smoke tests unchanged (git add not included in test-all.sh)
Fixes: Argument parsing error for git add with native flags
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>