#directory-tree #tree #ascii #file-tree #directory #command-line #file

app project-tree

A command-line utility to display a ascii tree of files and directories

5 releases

0.2.2 May 13, 2023
0.2.1 May 13, 2023
0.2.0 May 13, 2023
0.1.1 May 12, 2023
0.1.0 May 12, 2023

#1078 in Filesystem

MIT/Apache

10KB
106 lines

project-tree

A simple ascii file tree generator. Designed to be used in project root. By default it will print to stdout, and copy to clipboard. By default it will not recurse into node_modules, .git, or .vscode folders.

//! TODO:
//! Make ignore / stop check more elegant, is HashMap<PathBuf> really the best way to do this?

Usage

project-tree [flags] [options]

Flags

Flag Description
--node_modules Include node_modules
--git Include .git
--vscode Include .vscode
-r, --root Include parent directory in tree, and indent all other files
-d, --dirs Prioritize directories over files (default alphabetical)

Options

Option Arg Description
-o, --output path Output file
-i, --ignore path A file/folder to ignore, can be repeated
-s, --stop path A file/folder to not recurse into, can be repeated

Examples

project-tree -i Cargo.lock -s target -r -dirs
project-tree
├── src/
   └── main.rs
├── target/
├── .gitignore
├── Cargo.toml
└── README.md

On another one of my projects: pt-gpt

project-tree -i .github -i frontend/.expo -i frontend/node_modules -i frontend/web-build/ -s frontend/assets -dirs
config/
   ├── logger.js
   ├── mongo_connection.js
   └── openai_connection.js
controllers/
   ├── auth.js
   ├── chat.js
   └── user.js
frontend/
   ├── assets/
   ├── components/
   │   ├── AlertModal.js
   │   ├── BackButton.js
   │   ├── Back_Icon.svg
   │   ├── icons8-settings.svg
   │   └── SettingsButton.js
   ├── contexts/
   │   └── Main.js
   ├── dist/
   │   ├── assets/
   │   └── bundles/
   ├── screens/
   │   ├── unit-testing/
   │   │   └── chat.test.js
   │   ├── Chat.js
   │   ├── Loading.js
   │   ├── Login.js
   │   └── Profile.js
   ├── App.js
   ├── app.json
   ├── babel.config.js
   ├── eas.json
   ├── package-lock.json
   └── package.json
helpers/
   └── emailSender.js
logs/
middlewares/
   └── jwt_auth.js
models/
   └── User.js
node_modules/
routes/
   └── api/
       ├── protected/
       │   ├── chat.js
       │   └── user.js
       └── auth.js
.babelrc.json
.env
.gitignore
app.js
package-lock.json
package.json
README.md

Dependencies

~1.2–2MB
~36K SLoC