CLI Tree
Terminal-style directory tree output with box guides, human file sizes, colours by file type, collapsible folders, a tree -L header and a summary line.
Preview
~/ledger $ tree -L 2 -h
ledger
5 directories, 15 files · 323K total
dir/codeconfigmediadocsexec*link
~/ledger $
Install
Pro source requires Pebble Pro. Try the full preview above.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| tree | CliTreeNode[] | — | { name, size?, children?, link?, executable? }; folders have children. |
| root | string | "." | Root shown on the first line. |
| cwd | string | "~/project" | Prompt path before the command. |
| level | number | 2 | Folders deeper than this start collapsed, like tree -L. |
| sizes | boolean | true | Show [ 4.2K] size columns, like tree -h. |
| command | string | "tree -L <level> -h" | Override the echoed command. |
| legend | boolean | true | Show a key of file colours under the summary. |
| onSelect | (path: string) => void | — | Called when a file is opened (click or Enter). |
| label | string | "Directory tree" | Accessible name of the tree. |
Pro component
Try the full preview above. Editable source and build guides require Pebble Pro.
