Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
d02ea0d
feat(pulumi): add CLI filters for preview/up/destroy/refresh/stack
wlami Apr 15, 2026
888d1a8
fix(pulumi): address review feedback + JSON-safety
wlami Apr 18, 2026
e9b82fc
fix(vitest): preserve explicit reporters
jsiu93 Jun 6, 2026
84616d1
fix(grep): stabilize argument parsing
KuSh Jun 8, 2026
c40b3ef
fix(grep): fix value-taking flags, -rN clusters, multi-path, and -e p…
KuSh Jun 10, 2026
acb3a2d
fix(grep): handle value-taking flags in tail position of short clusters
KuSh Jun 10, 2026
7d6255f
fix(grep): code and test cleanup
KuSh Jun 10, 2026
c126d45
fix(diff): report modified-only diffs and follow diff exit convention
hgunduzoglu Jun 11, 2026
b7d93b5
fix(grep): left-to-right cluster scan, long value flags, format passt…
KuSh Jun 14, 2026
8d29f75
fix(grep): restore strip_r as explicit testable helper + pre-existing…
KuSh Jun 14, 2026
34aac6e
refactor(grep): extract parse_cluster to make cluster parsing directl…
KuSh Jun 14, 2026
307b557
feat(grep): sort content alphabetically
KuSh Jun 14, 2026
d8c550e
Merge pull request #2333 from KuSh/grep_arg_parsing
aeppling Jun 14, 2026
3a73bcd
Merge pull request #2394 from hgunduzoglu/fix/diff-modified-lines-fal…
aeppling Jun 16, 2026
abe7d42
fix(grep): use portable --null in system grep fallback (BSD/macOS)
vegetablechicken233 Jun 15, 2026
c7f493b
feat(oc): add Openshift CLI support with shared k8s filtering
Alcamech Jun 3, 2026
34441dd
fix(hook): treat uv run as a transparent prefix
jbellis Jun 18, 2026
c8722bd
Merge pull request #2416 from BrokkAi/fix/hook-uv-run-pytest
aeppling Jun 18, 2026
d727db3
fix(grep): surface error on exit code >= 2 instead of false "0 matches"
ousamabenyounes Jun 16, 2026
99969e0
test(grep): gate grep_error_test with #![cfg(unix)] for Windows CI
ousamabenyounes Jun 17, 2026
fa7e510
style(test): cargo fmt grep_error_test.rs
ousamabenyounes Jun 17, 2026
3572d11
refactor(grep): extract error-exit decision into pure unit-tested fn
ousamabenyounes Jun 18, 2026
e36dd8c
fix(git): propagate exit code when commit fails instead of reporting ok
hgunduzoglu Jun 18, 2026
756c2a4
fix(git): propagate exit code on git status failure in compact path
hgunduzoglu Jun 18, 2026
ebaaf8d
fix(git): propagate exit code on git worktree list failure
hgunduzoglu Jun 18, 2026
39cbb96
Merge pull request #2243 from Alcamech/feat/oc-support
aeppling Jun 18, 2026
2d9dc1a
fix(dotnet): stop duplicating failures on failing test runs
Tailoo Jun 18, 2026
177242a
Merge remote-tracking branch 'origin/master' into fix/oc-classificati…
aeppling Jun 19, 2026
d2babe2
test(main): classify oc subcommand in PASSTHROUGH allowlist
aeppling Jun 19, 2026
444f1c0
Merge pull request #2514 from rtk-ai/fix/oc-classification-resync
aeppling Jun 19, 2026
f9469d1
fix(vitest): add passthrough recovery hint
jsiu93 Jun 20, 2026
e3f60e9
Merge pull request #2294 from jsiu93/fix/vitest-reporter-passthrough
aeppling Jun 20, 2026
5e7eab5
fix(dotnet): keep raw fallback when parsed failures incomplete
Tailoo Jun 21, 2026
729ac36
Merge remote-tracking branch 'upstream/develop' into feat/pulumi-add-…
wlami Jun 22, 2026
6946bf9
Merge pull request #2502 from Tailoo/fix/2501-dotnet-test-failure-dedup
aeppling Jun 22, 2026
1f6e36b
fix(pulumi): keep stack identity in pulumi-stack filter
wlami Jun 23, 2026
0adfae6
fix(grep): correctly handle all flag shapes and never exceed raw output
aeppling Jun 23, 2026
5cfe4d5
fix(pulumi): keep Owner and version in pulumi-stack filter
wlami Jun 23, 2026
3a59d23
test(grep): cover bundled -rln files-with-matches cluster (#2543)
aeppling Jun 23, 2026
ced70c6
Merge pull request #1334 from wlami/feat/pulumi-add-cli-filters
aeppling Jun 23, 2026
861a46d
fix(core): never-worse output guard so RTK never exceeds the raw command
aeppling Jun 23, 2026
ee9e2f8
Merge pull request #2550 from rtk-ai/fix/grep-context-flags
aeppling Jun 23, 2026
223dda2
fix(env): clean up feature from secrets rewrite
aeppling Jun 24, 2026
9d9ad7c
fix(pipe): apply the never-worse guard
aeppling Jun 24, 2026
9a2ad90
fix(read): make guard baseline faithful to cat/cat -n output
aeppling Jun 24, 2026
b52db52
fix(docker): make the agent's command authoritative for the guard bas…
aeppling Jun 24, 2026
25a095e
fix(aws): guard the s3 ls and s3 sync/cp text emits
aeppling Jun 24, 2026
9870c1c
Merge remote-tracking branch 'origin/develop' into fix/global-never-w…
aeppling Jun 24, 2026
3d4189c
fix(docker): report 0 containers/images instead of empty output
aeppling Jun 24, 2026
5a34452
test(bench): drop env --show-all (flag removed)
aeppling Jun 24, 2026
af81b08
Merge pull request #2554 from rtk-ai/fix/global-never-worse-guard
aeppling Jun 25, 2026
ee5a675
refactor(git): drop explanatory comment on status failure guard
hgunduzoglu Jun 26, 2026
d8e1428
refactor(git): drop explanatory comment on worktree list failure guard
hgunduzoglu Jun 26, 2026
8ef08cf
refactor(git): trim verbose comments on commit outcome to a concise note
hgunduzoglu Jun 26, 2026
a271b5e
chore: re-trigger CI (transient crates.io download failure on windows…
hgunduzoglu Jun 26, 2026
d86f007
Merge pull request #2498 from hgunduzoglu/fix/git-status-compact-exit…
aeppling Jun 26, 2026
c04dec1
test(git): cover exit-code propagation for git stash list/show failure
hgunduzoglu Jun 26, 2026
23aae98
Merge pull request #2500 from hgunduzoglu/fix/git-stash-list-show-exi…
aeppling Jun 26, 2026
adaf2b2
Update git.rs
aeppling Jun 26, 2026
a9b2ef5
Update git.rs
aeppling Jun 26, 2026
2927248
Merge pull request #2496 from hgunduzoglu/fix/git-commit-false-success
aeppling Jun 26, 2026
9a52647
Merge pull request #2499 from hgunduzoglu/fix/git-worktree-list-exit-…
aeppling Jun 26, 2026
eafadce
fix(grep): run the invoked engine instead of substituting rg for grep
aeppling Jun 26, 2026
37ee6cf
fix(grep): match real grep output and read piped stdin
aeppling Jun 26, 2026
c66e510
test(grep): cover #1436 comment-reported cases
aeppling Jun 26, 2026
059131c
test(grep): rename compress suite to search_compress, cover binary skip
aeppling Jun 26, 2026
05f3c54
fix(grep): surface the engine error and exit code, add nothing
aeppling Jun 26, 2026
d3553fb
Merge pull request #2641 from rtk-ai/fix/grep-faithful-engine
aeppling Jun 26, 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
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The LLM doesn't know RTK is involved for which commands, hooks rewrite commands

Don't invent new output formats. Don't add RTK-specific headers or markers in the default output. The filtered output should be indistinguishable from "a shorter version of the real command."

Enforce it with `guard::never_worse(raw, filtered)` — print and track the value it returns (use `runner::emit_guarded(filtered, hint, raw)` when appending a tee hint). It guarantees RTK never emits more tokens than the raw command, down to emitting nothing when the command produced nothing.

### Never Block

If a filter fails, fall back to raw output. RTK should never prevent a command from executing or producing output. Better to pass through unfiltered than to error out. Same for hooks: exit 0 on all error paths so the agent's command runs unmodified.
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ rtk read file.rs -l aggressive # Signatures only (strips bodies)
rtk smart file.rs # 2-line heuristic code summary
rtk find "*.rs" . # Compact find results
rtk grep "pattern" . # Grouped search results
rtk diff file1 file2 # Condensed diff
rtk diff file1 file2 # Condensed diff (exit 1 if files differ)
```

### Git
Expand Down Expand Up @@ -230,6 +230,18 @@ rtk docker compose ps # Compose services
rtk kubectl pods # Compact pod list
rtk kubectl logs <pod> # Deduplicated logs
rtk kubectl services # Compact service list
rtk oc get pods # OpenShift pod summary
rtk oc get services # OpenShift service list
rtk oc logs <pod> # Deduplicated logs
```

### Infrastructure as Code
```bash
rtk pulumi preview # Strip header/URL/duration noise
rtk pulumi up # Compact apply output
rtk pulumi destroy # Compact destroy output
rtk pulumi refresh # Drift summary
rtk pulumi stack # Stack metadata (strips owner/timestamps)
```

### Data & Analytics
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ Single-threaded execution with `Mutex<Option<Tracker>>` for future-proofing. No
└────────────────────────────────────────────────────────────────────────┘

main.rs:47-49
#[arg(short, long, action = clap::ArgAction::Count, global = true)]
#[arg(short, long, action = clap::ArgAction::Count)]
verbose: u8,

Levels:
Expand All @@ -773,7 +773,7 @@ if verbose > 0 {
└────────────────────────────────────────────────────────────────────────┘

main.rs:51-53
#[arg(short = 'u', long, global = true)]
#[arg(long, global = true)]
ultra_compact: bool,

Features:
Expand Down
18 changes: 13 additions & 5 deletions scripts/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,19 @@ bench "git show" "git show HEAD --stat 2>/dev/null || true" "$RTK git show HEAD
# grep
# ===================
section "grep"
bench "grep fn" "grep -rn 'fn ' src/ || true" "$RTK grep 'fn ' src/"
bench "grep struct" "grep -rn 'struct ' src/ || true" "$RTK grep 'struct ' src/"
bench "grep -l 40" "grep -rn 'fn ' src/ || true" "$RTK grep 'fn ' src/ -l 40"
bench "grep -c" "grep -ron 'fn ' src/ || true" "$RTK grep 'fn ' src/ -c"
bench "grep fn" "grep -rn 'fn ' src/ || true" "$RTK grep -rn 'fn ' src/"
bench "grep struct" "grep -rn 'struct ' src/ || true" "$RTK grep -rn 'struct ' src/"
bench "grep -l 40" "grep -rn 'fn ' src/ || true" "$RTK grep -rn 'fn ' src/ -l 40"
bench "grep -c" "grep -ron 'fn ' src/ || true" "$RTK grep -rc 'fn ' src/"

# ===================
# rg (native ripgrep, recursive by default, same output filter)
# ===================
section "rg"
bench "rg fn" "rg -n 'fn ' src/ || true" "$RTK rg 'fn ' src/"
bench "rg struct" "rg -n 'struct ' src/ || true" "$RTK rg 'struct ' src/"
bench "rg -l files" "rg -l 'fn ' src/ || true" "$RTK rg -l 'fn ' src/"
bench "rg -c count" "rg -c 'fn ' src/ || true" "$RTK rg -c 'fn ' src/"

# ===================
# json
Expand Down Expand Up @@ -248,7 +257,6 @@ bench "deps" "cat Cargo.toml" "$RTK deps"
section "env"
bench "env" "env" "$RTK env"
bench "env -f PATH" "env | grep PATH" "$RTK env -f PATH"
bench "env --show-all" "env" "$RTK env --show-all"

# ===================
# err
Expand Down
4 changes: 3 additions & 1 deletion scripts/test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,9 @@ assert_ok "rtk discover" rtk discover

section "Diff"

assert_ok "rtk diff two files" rtk diff Cargo.toml LICENSE
assert_ok "rtk diff identical files" rtk diff Cargo.toml Cargo.toml
assert_fails "rtk diff differing files" rtk diff Cargo.toml LICENSE
assert_contains "rtk diff shows changes" "added" rtk diff Cargo.toml LICENSE

# ── 37. Wc ────────────────────────────────────────────

Expand Down
2 changes: 1 addition & 1 deletion src/cmds/cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Specifics

- `aws_cmd.rs` — 25 specialized filters covering STS, S3, EC2, ECS, RDS, CloudFormation, CloudWatch Logs, Lambda, IAM, DynamoDB, EKS, SQS, Secrets Manager. Forces `--output json` for structured parsing, uses `force_tee_hint()` for truncation recovery, strips Lambda secrets. Shared runner `run_aws_filtered()` handles boilerplate for JSON-based filters; text-based filters (S3 ls, S3 sync/cp) have dedicated runners
- `container.rs` handles both Docker and Kubernetes; `DockerCommands` and `KubectlCommands` sub-enums in `main.rs` route to `container::run()` -- uses passthrough for unknown subcommands
- `container.rs` handles Docker, Kubernetes, and OpenShift; `DockerCommands`, `KubectlCommands`, and `OcCommands` sub-enums in `main.rs` route to `container::run()` -- uses passthrough for unknown subcommands
- `curl_cmd.rs` truncates long responses, saves full output to file for recovery
- `wget_cmd.rs` wraps wget with output filtering
- `psql_cmd.rs` filters PostgreSQL query output
49 changes: 20 additions & 29 deletions src/cmds/cloud/aws_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! Replaces verbose `--output table`/`text` with JSON, then compresses.
//! Specialized filters for high-frequency commands (STS, S3, EC2, ECS, RDS, CloudFormation).
use crate::core::guard::never_worse;
use crate::core::tee::force_tee_hint;
use crate::core::tracking;
use crate::core::truncate::{CAP_INVENTORY, CAP_LIST};
Expand Down Expand Up @@ -258,6 +259,7 @@ fn run_generic(subcommand: &str, args: &[String], verbose: u8, full_sub: &str) -

let filtered = match json_cmd::filter_json_compact(&raw, JSON_COMPRESS_DEPTH) {
Ok(compact) => {
let compact = never_worse(&raw, &compact).to_string();
println!("{}", compact);
compact
}
Expand Down Expand Up @@ -361,19 +363,14 @@ fn run_aws_filtered(
FilterResult::new(stdout.clone())
});

if result.truncated {
if let Some(hint) = crate::core::tee::force_tee_hint(&raw, &slug) {
println!("{}\n{}", result.text, hint);
} else {
println!("{}", result.text);
}
} else if let Some(hint) = crate::core::tee::tee_and_hint(&raw, &slug, 0) {
println!("{}\n{}", result.text, hint);
let hint = if result.truncated {
crate::core::tee::force_tee_hint(&raw, &slug)
} else {
println!("{}", result.text);
}
crate::core::tee::tee_and_hint(&raw, &slug, 0)
};
let shown = crate::core::runner::emit_guarded(&result.text, hint.as_deref(), &raw);

timer.track(&cmd_label, &rtk_label, &raw, &result.text);
timer.track(&cmd_label, &rtk_label, &raw, &shown);
Ok(0)
}

Expand Down Expand Up @@ -410,17 +407,14 @@ fn run_s3_ls(extra_args: &[String], verbose: u8) -> Result<i32> {
}

let result = filter_s3_ls(&stdout);
if result.truncated {
if let Some(hint) = crate::core::tee::force_tee_hint(&raw, "aws_s3_ls") {
println!("{}\n{}", result.text, hint);
} else {
println!("{}", result.text);
}
let hint = if result.truncated {
crate::core::tee::force_tee_hint(&raw, "aws_s3_ls")
} else {
println!("{}", result.text);
}
None
};
let shown = crate::core::runner::emit_guarded(&result.text, hint.as_deref(), &raw);

timer.track("aws s3 ls", "rtk aws s3 ls", &raw, &result.text);
timer.track("aws s3 ls", "rtk aws s3 ls", &raw, &shown);
Ok(0)
}

Expand Down Expand Up @@ -463,17 +457,14 @@ fn run_s3_transfer(operation: &str, extra_args: &[String], verbose: u8) -> Resul
}

let result = filter_s3_transfer(&stdout);
if result.truncated {
if let Some(hint) = force_tee_hint(&raw, &slug) {
println!("{}\n{}", result.text, hint);
} else {
println!("{}", result.text);
}
let hint = if result.truncated {
force_tee_hint(&raw, &slug)
} else {
println!("{}", result.text);
}
None
};
let shown = crate::core::runner::emit_guarded(&result.text, hint.as_deref(), &raw);

timer.track(&cmd_label, &rtk_label, &raw, &result.text);
timer.track(&cmd_label, &rtk_label, &raw, &shown);
Ok(0)
}

Expand Down
Loading
Loading