The global --ultra-compact flag used -u as its short form which caused
`rtk git push -u origin <branch>` to silently consume -u as ultra-compact
mode instead of forwarding it to git as --set-upstream. The push succeeded
but the upstream tracking branch was never written to .git/config, causing
subsequent plain `git push` calls to fail with "no upstream branch".
Fixes#1086
Generated by Claude Code
Vibe coded by ousamabenyounes
Co-Authored-By: Claude <noreply@anthropic.com>
When glob_matches processed a pattern like "git -C * diff:*" (normalized
to "git -C * diff *"), middle segment " diff " requires a trailing space
to match. For "git -C /path diff" the remaining text is "/path diff"
which ends with " diff" — no trailing space — so .find(" diff ") returned
None and the command was incorrectly rejected.
Fix: in the middle-segment branch, if the full substring search fails,
also check if the remaining text ends with the trimmed (right-stripped)
segment. This handles commands that terminate at the middle token with
no trailing arguments.
Add regression test covering the exact reproduction case from the issue.
Closes#1105
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rtk find used WalkBuilder with .hidden(true), which skips ALL hidden
files and directories. As a result, `rtk find . -name ".claude.json"`
always returned "0 for '.claude.json'" even when the files existed.
Fix: detect when the -name pattern starts with a dot and set
.hidden(false) for that walk, so hidden entries are visited.
Non-dotfile patterns keep the default .hidden(true) behaviour.
Add regression tests covering both cases.
Closes#1101
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Handle --flag=value forms consistently in both the runtime parser and discover rewrite logic.
Add regression coverage for classify and rewrite paths using inline global flag values before run.
Normalize golangci-lint global flags before run during classification and keep them in rewritten commands.
Add regression coverage for classify_command and rewrite_command with pre-run global flags.
Keep bare golangci-lint invocations as passthrough while preserving compact filtering for golangci-lint run.
Update discover/rewrite rules, regression tests, and docs to advertise only the supported compact run path.
- P0: non-terminal `rtk init` no longer writes consent_given=false leaves consent as None so next interactive run prompts normally
- P1: maybe_ping() loads Config once instead of twice per command
Fixes silent hang when ccusage is not installed globally. npx prompts
for confirmation before installing the package, blocking the subprocess
indefinitely. Adding --yes auto-confirms and the info message sets user
expectations.
Fixesrtk-ai/rtk#1226
go test -json emits both a test-level {"action":"fail","Test":"..."}
and a trailing package-level {"action":"fail"} (no Test field) for
every failing test. The parser was counting both events, so a run with
1 failing test was reported as "2 failed" in the summary header.
Fix: total_pkg_fail now only includes packages where package_failed is
true AND there are no individual test- or build-level failures — i.e.
pure package-level failures such as timeouts and panics. Also exclude
such packages from the [FAIL] display section when test-level results
are already shown below.
Three new tests cover:
- no double-count on a regular test failure
- exact reproduction from issue #958 (signal: quit line)
- timeout with passing tests before the kill
Generated by Claude Code
Vibe coded by ousamabenyounes
Co-Authored-By: Claude <noreply@anthropic.com>
clap's trailing_var_arg=true silently drops -- when it appears as the first
positional argument. This caused `rtk git diff -- <path>` to arrive in
run_diff without the separator, making git treat the path as a revision and
emit "fatal: ambiguous argument". Adds normalize_diff_args() which re-inserts
-- before the first path-like argument (contains /, \, starts with . or ~)
when -- is absent from the args vec. The fix is a no-op when -- is already
present (e.g. rtk git diff HEAD -- file preserves the separator correctly).
Generated by Claude Code
Vibe coded by ousamabenyounes
Co-Authored-By: Claude <noreply@anthropic.com>
Compound commands (`&&`, `||`, `|`, `;`) previously received
PermissionVerdict::Allow when *any single segment* matched an allow
rule. This allowed a permission escalation where an LLM agent could
chain an allowed command with an unapproved one (e.g.
`git status && git add .`) to bypass user confirmation.
Replace the `any_allow` flag with `all_segments_allowed` logic: every
non-empty segment must independently match an allow rule for the chain
to receive Allow. If any segment fails to match, the verdict demotes to
Default (ask). Deny still short-circuits on any match, and Ask still
wins over a partial Allow.
Also add a `saw_segment` guard and a `!allow_rules.is_empty()` check to
prevent a vacuous Allow on empty commands or empty rule sets.
Add 6 regression tests covering the reproduction case from #1213, all
four compound separators, and ask-wins-over-partial-allow precedence.
Fixes#1213
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Previously `filter_cargo_clippy` only captured the first line of each
error diagnostic (truncated to 160 chars), discarding the file location,
code snippet, `^` markers, and `= note:` context that developers need to
actually fix the issue. This made rtk unusable for `cargo clippy -- -D warnings`.
Now errors are collected as full multi-line blocks (up to 15 lines each,
up to 10 errors total), matching the approach used by `filter_cargo_build`.
Warning grouping by lint rule is unchanged.
Fixes#602
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add rtk init --agent kilocode and rtk init --agent antigravity commands.
Kilo Code: installs .kilocode/rules/rtk-rules.md (project-scoped)
Google Antigravity: installs .agents/rules/antigravity-rtk-rules.md (project-scoped)
Both follow the same prompt-level guidance pattern as Cline and Windsurf,
using rules files that instruct the agent to prefix shell commands with rtk.
P0 fixes:
- top_passthrough: GROUP BY first word only, not full command args (privacy leak)
- build_meta_usage: use dedicated count query instead of scanning deduplicated top list (was always returning 0 or 1)
P1 fixes:
- Single Tracker connection per ping (was opening 2 SQLite connections)
- first_seen_days: propagate DB errors instead of unwrap_or(None)
- ecosystem_mix: bound to 90 days instead of full table scan
- avg_savings_per_command: compute per-command mean, not per-row mean
- estimated_savings_usd_30d: use $3/Mtok (Sonnet input rate) not $5/Mtok
Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
When go test times out or is killed by a signal, the JSON stream
contains a package-level {"action":"fail"} with no Test field and no
FailedBuild field. The parser only handled test-level and build-level
failures, so this event was silently dropped. The summary then saw
0 passes + 0 fails and reported "No tests found" instead of the
actual failure.
The fix adds handling for package-level failures: a new else branch
in the fail handler, package-level output capture in the output
handler, and inclusion in the summary count and display.
Before: "Go test: No tests found"
After: "Go test: 0 passed, 1 failed in 1 packages" with the
timeout output shown under the package name.
Fixes#958
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>