npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tri-cli

v0.0.55

Published

Interactive CLI directory tree visualizer with treemap view

Downloads

12

Readme

tri-cli

A terminal-based interactive directory visualizer, like tree but with keyboard navigation, shortcuts, colors, and treemap visuals:

tri demo in gif

Installation

Global Installation (Recommended)

It's recommended to install globally:

npm install -g tri-cli

After 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-cli

For 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 collapsed

Interactive 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 d on any item to calculate disk usage recursively
  • Date display: Press l to show last modified dates in ls -l format

Treemap View

  • Press m to 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 install

Build and link for local development:

npm run build
npm link

Now you can run tri from anywhere and it will use your local development version.

License

MIT

Author

Jared Wilber