tri-cli
v0.0.55
Published
Interactive CLI directory tree visualizer with treemap view
Downloads
12
Maintainers
Readme
tri-cli
A terminal-based interactive directory visualizer, like tree but with keyboard navigation, shortcuts, colors, and treemap visuals:

Installation
Global Installation (Recommended)
It's recommended to install globally:
npm install -g tri-cliAfter global installation, you can run tri directly from anywhere:
tri .Local Installation
If you don't want to install globally, you can install locally and then run anywhere with npx:
npm install tri-cliFor local installations, use npx to run the command:
npx tri .Or add it to your package.json scripts:
{
"scripts": {
"tree": "tri"
}
}Then run with npm run tree.
Usage
tri [directory] [options]Examples
tri . # visualize current directory
tri ../bionemo -L 2 # show 2 levels deep
tri --dir src # specify directory with flag
tri src -s # preload all sizes (enables immediate treemap)
tri --dir src -c # start with all directories collapsedInteractive Controls
| Key | Action | | ------------- | ----------------------------------------- | | ↑ / ↓ | Navigate files and folders | | Enter | Expand or collapse a directory | | [a-z]/[0-9] | Type shortcut to jump to item | | d | Calculate and display sizes recursively | | l | Show last modified dates (ls -l style) | | m | Toggle treemap view | | Esc | Clear typed shortcut | | q | Quit |
Command Line Options
| Option | Description |
| ---------------- | ------------------------------------------------ |
| [directory] | Directory to visualize (default: current dir) |
| -L <level> | Maximum depth to load initially (default: 1) |
| -s, --size | Preload all file/directory sizes |
| -c, --collapse | Start with all directories collapsed |
| -h, --help | Show help message |
Features
Tree View
- Keyboard shortcuts: Each item gets a shortcut label - just type it to jump there instantly
- Tree-style lines: Visual hierarchy with Unicode box-drawing characters (├─, ╰─, │)
- Color coding: Different colors for different file types
- Lazy loading: Only loads directory contents when you expand them (fast for large directories)
- Size calculation: Press
don any item to calculate disk usage recursively - Date display: Press
lto show last modified dates inls -lformat
Treemap View
- Press
mto visualize the selected directory as a treemap - Visual representation of file/directory sizes
- Hierarchical rectangles sized proportionally to disk usage
- Color-coded by file type or directory group
Development
Clone the repository and install dependencies:
git clone https://github.com/jwilber/tri-cli.git
cd tri-cli
npm installBuild and link for local development:
npm run build
npm linkNow you can run tri from anywhere and it will use your local development version.
License
MIT
Author
Jared Wilber
