Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ff10599
Basic dotnet implementation
danielmarbach Feb 17, 2026
be6111f
Better default behavior
danielmarbach Feb 17, 2026
70bd78c
Isolate trx handling
danielmarbach Feb 17, 2026
31e8b3a
Fixtures
danielmarbach Feb 17, 2026
92be082
Actual proper binlog parsing
danielmarbach Feb 17, 2026
c39120f
Fix summary and failure detection
danielmarbach Feb 17, 2026
0136a85
Restore fix
danielmarbach Feb 17, 2026
9dce881
Fix test
danielmarbach Feb 17, 2026
24ef195
Prefer binlog
danielmarbach Feb 17, 2026
18e4177
Set the CLI language
danielmarbach Feb 17, 2026
cafeba1
Simplify
danielmarbach Feb 17, 2026
d6ddc54
Implement hook and tests (small reorg into groups)
danielmarbach Feb 21, 2026
c090cf3
Better parsing of binlog paths and fallback
danielmarbach Feb 21, 2026
da9999a
Proper file cleanup
danielmarbach Feb 21, 2026
9cd6dce
Optimize sensitive scrubbing into a single static regex
danielmarbach Feb 21, 2026
fbd1661
Scrubbing a few more (Better safe than sorry)
danielmarbach Feb 21, 2026
3dd0289
Verify no order dependency in trx parsing
danielmarbach Feb 21, 2026
b459f2f
Switch xml parsing to quick-xml
danielmarbach Feb 21, 2026
2bb6c67
Correct multi project parsing
danielmarbach Feb 21, 2026
1537144
More robust summary handling
danielmarbach Feb 21, 2026
6724a4d
Aggregate trx
danielmarbach Feb 21, 2026
11704ec
Better args handling and results dir filtering especially when user p…
danielmarbach Feb 21, 2026
b4a93b4
Make sure multiple agent sessions don't collide
danielmarbach Feb 21, 2026
a371f6f
Small tweaks
danielmarbach Feb 21, 2026
02d1062
Dotnet format
danielmarbach Feb 21, 2026
610b159
Better error handling for invalid arguments and such
danielmarbach Feb 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .claude/hooks/rtk-rewrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ elif echo "$MATCH_CMD" | grep -qE '^cargo[[:space:]]+nextest([[:space:]]|$)'; th
elif echo "$MATCH_CMD" | grep -qE '^cargo[[:space:]]+fmt([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^cargo fmt/rtk cargo fmt/')"

# --- .NET ---
elif echo "$MATCH_CMD" | grep -qE '^dotnet[[:space:]]+(build|test|restore|format)([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^dotnet/rtk dotnet/')"

# --- File operations ---
elif echo "$MATCH_CMD" | grep -qE '^cat[[:space:]]+'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^cat /rtk read /')"
Expand Down
52 changes: 52 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ toml = "0.8"
chrono = "0.4"
thiserror = "1.0"
tempfile = "3"
flate2 = "1.0"
quick-xml = "0.37"

[dev-dependencies]

Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ rtk pytest # Python tests (failures only, 90% reduction)
rtk pip list # Python packages (auto-detect uv, 70% reduction)
rtk go test # Go tests (NDJSON, 90% reduction)
rtk golangci-lint run # Go linting (JSON, 85% reduction)
rtk dotnet build # .NET build summary with binlog
rtk dotnet test # .NET failures only (auto TRX + fallback parsing)
rtk dotnet restore # .NET restore summary
```

### Data & Analytics
Expand Down Expand Up @@ -256,7 +259,7 @@ rtk prisma migrate dev --name x # Migration summary
rtk prisma db-push # Schema push summary
```

### Python & Go Stack
### Python, Go & .NET Stack
```bash
# Python
rtk ruff check # Ruff linter (JSON, 80% reduction)
Expand All @@ -271,8 +274,19 @@ rtk go test # NDJSON streaming parser (90% reduction)
rtk go build # Build errors only (80% reduction)
rtk go vet # Vet issues (75% reduction)
rtk golangci-lint run # JSON grouped by rule (85% reduction)

# .NET
rtk dotnet build # Build errors/warnings summary with binlog
rtk dotnet test # Failed tests only (auto TRX cleanup, TestResults fallback)
rtk dotnet restore # Restore project/package summary
```

Dotnet behavior notes:
- RTK forwards your dotnet args as-is (`--configuration`, `--framework`, `--project`, `--no-build`, `--no-restore`, `--filter`, etc.).
- RTK only injects defaults when missing (`-bl`, `-v:minimal`, `-nologo`) and does not override your explicit `-v` / `--logger`.
- For `rtk dotnet test`, RTK auto-generates a TRX file, parses it when binlog/console counts are unavailable, then cleans up that temp TRX file.
- If temp TRX is missing, RTK falls back to the newest `./TestResults/*.trx` file.

## Examples

### Standard vs rtk
Expand Down
4 changes: 4 additions & 0 deletions hooks/rtk-rewrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ elif echo "$MATCH_CMD" | grep -qE '^cargo[[:space:]]'; then
;;
esac

# --- .NET ---
elif echo "$MATCH_CMD" | grep -qE '^dotnet[[:space:]]+(build|test|restore)([[:space:]]|$)'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^dotnet/rtk dotnet/')"

# --- File operations ---
elif echo "$MATCH_CMD" | grep -qE '^cat[[:space:]]+'; then
REWRITTEN="${ENV_PREFIX}$(echo "$CMD_BODY" | sed 's/^cat /rtk read /')"
Expand Down
46 changes: 34 additions & 12 deletions hooks/test-rtk-rewrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,16 @@ test_rewrite "env + docker compose" \
"COMPOSE_PROJECT_NAME=test docker compose up -d" \
"COMPOSE_PROJECT_NAME=test rtk docker compose up -d"

test_rewrite "env + dotnet test" \
"DOTNET_CLI_TELEMETRY_OPTOUT=1 dotnet test --nologo" \
"DOTNET_CLI_TELEMETRY_OPTOUT=1 rtk dotnet test --nologo"

echo ""

# ---- SECTION 3: New patterns ----
echo "--- New patterns ---"

# JS/TS
test_rewrite "npm run test:e2e" \
"npm run test:e2e" \
"rtk npm test:e2e"
Expand All @@ -173,6 +179,20 @@ test_rewrite "npx vue-tsc --noEmit" \
"npx vue-tsc --noEmit" \
"rtk tsc --noEmit"

# .NET
test_rewrite "dotnet build" \
"dotnet build" \
"rtk dotnet build"

test_rewrite "dotnet test --nologo" \
"dotnet test --nologo" \
"rtk dotnet test --nologo"

test_rewrite "dotnet restore src/App.sln" \
"dotnet restore src/App.sln" \
"rtk dotnet restore src/App.sln"

# Containers
test_rewrite "docker compose up -d" \
"docker compose up -d" \
"rtk docker compose up -d"
Expand All @@ -193,18 +213,7 @@ test_rewrite "docker exec -it db psql" \
"docker exec -it db psql" \
"rtk docker exec -it db psql"

test_rewrite "find (NOT rewritten — different arg format)" \
"find . -name '*.ts'" \
""

test_rewrite "tree (NOT rewritten — different arg format)" \
"tree src/" \
""

test_rewrite "wget (NOT rewritten — different arg format)" \
"wget https://example.com/file" \
""

# GitHub / Kubernetes
test_rewrite "gh api repos/owner/repo" \
"gh api repos/owner/repo" \
"rtk gh api repos/owner/repo"
Expand All @@ -221,6 +230,19 @@ test_rewrite "kubectl apply -f deploy.yaml" \
"kubectl apply -f deploy.yaml" \
"rtk kubectl apply -f deploy.yaml"

# Intentionally not rewritten (format-specific)
test_rewrite "find (NOT rewritten — different arg format)" \
"find . -name '*.ts'" \
""

test_rewrite "tree (NOT rewritten — different arg format)" \
"tree src/" \
""

test_rewrite "wget (NOT rewritten — different arg format)" \
"wget https://example.com/file" \
""

echo ""

# ---- SECTION 4: Vitest edge case (fixed double "run" bug) ----
Expand Down
Loading