enhancement: ls filter removes file metadata (permissions, sizes, dates) needed by agents
#1,162 opened on Apr 10, 2026
Repository metrics
- Stars
- (48,085 stars)
- PR merge metrics
- (Avg merge 11d 1h) (45 merged PRs in 30d)
Description
Problem
`rtk ls` converts standard ls output into a compact tree view that strips file permissions, sizes, modification dates, and other metadata. AI agents often need this metadata to:
- Diagnose permission issues: Is the file executable? Who owns it?
- Identify stale files: When was this file last modified?
- Check file sizes: Is this a large binary or a small config?
- Understand symlinks: Is this a real file or a symlink?
Example
```bash $ ls -la -rw-r--r-- 1 user staff 1234 Jan 15 10:30 config.json lrwxr-xr-x 1 user staff 12 Jan 10 09:00 link -> /other/path drwxr-xr-x 8 user staff 256 Jan 14 14:22 src
$ rtk ls -la my-project/ +-- config.json +-- link +-- src/ (8 files) ```
All metadata is lost.
Proposed fix
-
Add a --metadata or -l flag that preserves permissions, sizes, and dates in the tree output: ``` my-project/ +-- config.json (1.2K, Jan 15, -rw-r--r--) +-- link -> /other/path (Jan 10, lrwxr-xr-x) +-- src/ (8 files, 256B, Jan 14, drwxr-xr-x) ```
-
Detect when -la or -l flags are used and include metadata automatically (the flags are passed through but the filter strips the raw output)
-
Add an env var like `RTK_LS_METADATA=1` that agents can set to always include metadata
Relevant code
- src/cmds/system/ls.rs: ls filtering implementation
- src/discover/rules.rs line 92: ls rewrite rule