pub const HELP_TEXT: &str = "duvis - Disk usage visualizer for both AI agents and humans
Usage:
duvis [PATH] [options]
duvis --explain-category <NAME>
duvis is strictly read-only — it never deletes anything and never recommends what to delete.
The default output is a colorized terminal tree. Pass --summary, --json, --ndjson, --largest,
or --ui to get a different view of the same scan.
Display options
-d, --max-depth <N> Maximum depth to display. Affects display only — sizes always sum
the full subtree.
-n, --top <N> Show only the largest N entries at each level. Selection by size;
display order follows --sort.
--sort <size|name> Sort order. Default: size.
--reverse Reverse the --sort order.
--hardlinks <count-once|count-each>
Attribution for hardlinked files. Default: count-once (matches
`du`). count-each inflates totals when many links share an inode
(e.g. pnpm stores). Unix only.
Output formats (mutually exclusive; default = colorized terminal tree)
--json Structured JSON tree to stdout. Shape: `{meta, tree}`.
--ndjson Newline-delimited JSON, one entry per line, in DFS pre-order.
Designed for jq / streaming agents.
--summary Per-category size summary (cache / build / log / media / vcs /
ide / other).
--largest <N> Flat list of the N largest entries globally, ordered by size.
Combines with --json / --ndjson for structured output.
--ui Browser UI with treemap, sunburst, and list views. Starts an
embedded HTTP server (default port 7515).
--port <PORT> Port for the --ui HTTP server. Default: 7515. Falls back to a
free OS-assigned port if busy.
Filters (AND-combined; affect display only, not totals; rejected with --ui)
--category <CAT> Restrict to one or more categories. Repeatable / CSV:
`--category cache,build`. Categories: cache, build, log, media,
vcs, ide, other, archive, installer, vm_image, model_cache, backup.
--type <file|dir> Restrict by entry type.
--min-size <SIZE> Show only entries at least this size. 1024-based:
`100M`, `1.5G`, `50KiB`, `1024` (bare = bytes).
--name <GLOB> Restrict to basenames matching one or more globs. Repeatable;
multiple are OR-combined: `--name \"*.log\" --name \"*.tmp\"`.
--changed-within <DURATION>
Modified within the past `Nd` / `Nw` / `Nm` / `Ny` (m=30d, y=365d).
--changed-before <DURATION>
Modified more than <DURATION> ago. Combine with --changed-within
for a window.
Diagnostics
--explain-category <NAME>
Explain how a name would be classified, without scanning. Prints
both interpretations (as-dir / as-file) and the matched rule.
Combine with --json for structured output. Skips scanning
entirely; PATH is ignored.
-h, --help Show this help.
-V, --version Show version.
Examples
duvis ~/projects # tree (default)
duvis ~/projects --max-depth 2 --top 10 # depth-limited
duvis ~/projects --summary # category summary
duvis ~/projects --json | jq '.tree.children[]' # structured for agents
duvis ~/projects --ndjson | jq -c 'select(.size>1e8)' # streaming filter
duvis ~/projects --largest 10 # 10 largest globally
duvis ~/projects --category cache --min-size 100M # cache > 100MB only
duvis ~/projects --ui # browser UI
duvis --explain-category node_modules # which rule fires?
Exit codes
0 Success
1 Argument error, scan failure, or other error (message on stderr)";