whatisgithub

What is tree-node-cli?

yangshun/tree-node-cli — explained in plain English

Analysis updated 2026-05-18

285TypeScriptAudience · developerComplexity · 1/5Setup · easy

In one sentence

A command-line and library tool that prints a folder's contents as a visual tree, similar to the Linux tree command but works anywhere Node.js runs.

Mindmap

mindmap
  root((Tree Node CLI))
    What it does
      Visual folder tree
      Mimics Linux tree
      Works via Node.js
    Modes
      CLI command
      Programmable module
    Options
      Depth limit
      Hidden files
      File sizes
      Gitignore aware
    API
      Text string output
      Object output
    Audience
      Developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Visualize a project's folder structure directly in the terminal

USE CASE 2

Generate a formatted directory tree for documentation or logging

USE CASE 3

Programmatically get a folder structure as a JavaScript object in a script

What is it built with?

JavaScriptTypeScriptNode.js

How does it compare?

yangshun/tree-node-clieli-labz/third-eyeeduwass/tmux-palette
Stars285285284
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasy
Complexity1/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

On Windows and Linux the command is 'treee' with three e's to avoid a naming conflict.

So what is it?

Tree Node CLI is a tool that displays the contents of a folder in a visual tree format, where files and subfolders are shown with connecting lines to indicate their nesting. It mimics the behavior of a built-in Linux command called tree, but works on any system with Node.js installed. You can run it directly in your terminal without installing anything, or install it globally to use it as a regular command. It works in both modes: as a command-line tool you type into a terminal, and as a programmable module you can call from your own JavaScript or TypeScript code. The command-line version has a wide range of options for controlling what gets shown. You can limit how many levels deep it goes, show hidden files, display file sizes, show when files were last modified, sort by different criteria, and exclude specific files or folders by name pattern. By default, it respects your project's gitignore file, so files like node_modules are automatically hidden. The programmable API offers two functions. The first returns the tree as a formatted text string, useful for display or logging. The second returns the same structure as a JavaScript object, which makes it easier to process the folder contents in code, for example counting files or finding specific entries. On Windows and Linux, you need to type treee with three e's instead of two to avoid a naming conflict with the operating system's own tree command. The project has no significant dependencies and the README is thorough, covering every available option with descriptions and examples.

Copy-paste prompts

Prompt 1
Help me install tree-node-cli and print my project folder as a tree, ignoring node_modules
Prompt 2
Show me how to use the tree-node-cli API to get a folder structure as a JavaScript object
Prompt 3
Explain the treee command name conflict on Windows and Linux and how to work around it
Prompt 4
Walk me through the sorting and depth-limit options in tree-node-cli

Frequently asked questions

What is tree-node-cli?

A command-line and library tool that prints a folder's contents as a visual tree, similar to the Linux tree command but works anywhere Node.js runs.

What language is tree-node-cli written in?

Mainly TypeScript. The stack also includes JavaScript, TypeScript, Node.js.

How hard is tree-node-cli to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is tree-node-cli for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.