Skip to content

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

Open
Sathvik-1007 wants to merge 1 commit intortk-ai:developfrom
Sathvik-1007:feat/eza-filter
Open

feat(eza): add token-optimized eza filter#1079
Sathvik-1007 wants to merge 1 commit intortk-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
Copy link
Copy Markdown

CLAassistant commented Apr 8, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add eza filter support

2 participants