feat(du): add du disk usage filter with compact output#414
Closed
TheAgentWire wants to merge 4 commits intortk-ai:developfrom
Closed
feat(du): add du disk usage filter with compact output#414TheAgentWire wants to merge 4 commits intortk-ai:developfrom
TheAgentWire wants to merge 4 commits intortk-ai:developfrom
Conversation
add security check cicd on dev branch PR Signed-off-by: aesoft <43991222+aeppling@users.noreply.github.com>
fix(cicd): Add security check on dev branch PR
- New src/du_cmd.rs: strips padding, sorts by size desc, strips common path prefix, shows total as Σ - Registered in main.rs (mod, Commands enum, match arm) - Hook rewrite support in discover/rules.rs (pattern + rule) - 9 unit tests covering single/multi entry, sorting, raw blocks, prefix stripping, size parsing, and >=60% token savings - Closes rtk-ai#284 Signed-off-by: TheAgentWire <login@theagentwire.ai>
Collaborator
|
Hey @TheAgentWire, thanks for this work! However, since PRs #349, #351, #386 landed, RTK now includes a built-in TOML filter for The TOML filter covers the core use case declaratively in ~6 lines. Closing this PR as the functionality is already shipped. If you'd like to contribute more advanced filtering (e.g., sorting, aggregation), feel free to open a new PR building on top of the TOML filter. Thanks again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
rtk du— a compact filter fordu(disk usage) output. Closes #284.84 invocations in the last 30 days (per issue reporter) — this is a frequently used command that benefits from token-optimized output.
What it does
Σat bottom — clearly distinguishable from directory entriesduoutput)-hflag passthrough —disable_help_flagprevents clap from swallowing-h(human-readable), sincedu -his the most common usage pattern. Help is still accessible via--help.Examples
rtk du -sh /path/to/project/src/*Before (raw du):
After (rtk du):
Sorted largest-first, common
src/prefix stripped, padding normalized.rtk du -h -d 1 /path/to/projectRoot directory detected as total, shown with
Σmarker. Immediately obvious thattarget/dominates.rtk du -sh /path/to/workspace/*Quick disk audit across all projects, sorted by size.
Token savings
≥60% verified in tests. Biggest wins on recursive output with long absolute paths — common prefix stripping + sort + padding removal compound significantly.
Files changed
src/du_cmd.rssrc/main.rssrc/discover/rules.rsdu → rtk dutests/fixtures/du_*.txtTesting
cargo fmt --all --check && cargo clippy --all-targets && cargo test✅Checklist
cargo fmt && cargo clippy && cargo testpassesrtk duinspected and verified