Skip to content

feat(eza): add token-optimized eza filter - #1079

Closed
Sathvik-1007 wants to merge 1 commit into
rtk-ai:developfrom
Sathvik-1007:feat/eza-filter
Closed

Sathvik-1007 wants to merge 1 commit into
rtk-ai:developfrom
Sathvik-1007:feat/eza-filter

Conversation

@Sathvik-1007

Copy link
Copy Markdown

Closes #1030

What

rtk eza — filter proxy for eza (modern ls replacement). 3 modes, noise stripped, tokens saved.

Modes

Mode What gets stripped Savings
flat (default) noise dirs, icons, cap 30 entries ~3-65%
long (-l) perms, user, timestamps → name + size only ~70%
tree (-T) noise dir subtrees via --ignore-glob, summary line ~89-94%

Flag-aware

  • -a/--all/--almost-all → skip noise filtering, show everything
  • --git column → detected, parsed correctly (not confused with size)
  • --oneline/-1 → flat mode, minimal already, still caps at 30
  • --icons → stripped from output (nerd font chars removed)
  • --ignore-glob already set → we don't override user's glob
  • --level=N → passed through, no interference

Implementation

  • src/cmds/system/eza_cmd.rs — 414 lines, 21 unit tests
  • run() → runner::run_filtered() + RunOptions::stdout_only().early_exit_on_failure()
  • filter_flat(), filter_long(), filter_tree() — pure &str → String
  • strip_icon() — finds first ASCII byte, trims nerd font prefix
  • is_size_like() — distinguishes git status cols (M-, N-) from sizes (4.0k, -)
  • parse_long_line() — field-split parser, no regex needed
  • Reuses NOISE_DIRS from constants.rs
  • RtkRule added in rules.rs (pattern ^eza(\s|$), savings 70%)

Tests

  • 21 unit tests covering all modes, edge cases, icon stripping, git columns
  • cargo fmt + clippy + test → 1371 passed, 0 failed, 6 ignored
  • E2E verified: flat, long, tree, -a, -1, error path, --git

Docs updated

  • CHANGELOG.md
  • README.md (command list + mapping table)
  • src/cmds/system/README.md

Not tested

  • Windows (Linux only)
  • macOS (should work — same eza output format)

@CLAassistant

CLAassistant commented Apr 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Sathvik-1007
Sathvik-1007 changed the base branch from master to develop April 8, 2026 06:49
strip icons, noise dirs, perms, timestamps
flat/long/tree modes, 70%+ savings
21 unit tests, e2e verified linux
@rtk-release-bot

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet.

@rtk-release-bot rtk-release-bot Bot added the stale label Sep 3, 2026
@rtk-release-bot

Copy link
Copy Markdown
Contributor

Closing this pull request after a prolonged period of inactivity. If this is still relevant, please ask for it to be reopened. Thank you!

@rtk-release-bot rtk-release-bot Bot closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add eza filter support

2 participants