A Rust-based command-line tool to generate an ASCII tree of a project directory.
Supports filtering, sorting, .gitignore rules, and output to Markdown files.
project-structure/
├── src/
│ ├── cli.rs
│ ├── config.rs
│ ├── main.rs
│ ├── node.rs
│ ├── render.rs
│ ├── tree.rs
│ └── walker.rs
├── Cargo.lock
├── Cargo.toml
├── Example.md
├── LICENSE
└── README.mdproject-structure.exe [OPTIONS] [PATH][PATH]: Root path of the project. Defaults to the current directory (.) if not specified.
| Option | Description | Default / Base Value | Notes |
|---|---|---|---|
--include-hidden |
Include hidden files and directories | false |
By default, hidden files are skipped |
--no-git |
Do not use .gitignore rules |
false |
By default, .gitignore is respected |
--exclude <EXCLUDE> |
Space-separated exclude patterns (gitignore-style) | None |
Patterns like target *.log |
--depth <DEPTH> |
Filter depth (number of nested levels) | None |
Unlimited depth by default |
--sort <SORT> |
Sort results | name |
Possible values: name, type (type sorts directories first) |
--filter <FILTER> |
Filter for files or directories | all |
Possible values: all, files, dirs |
-o, --output[=<OUTPUT>] |
Write output to a file instead of terminal | None |
If flag is provided without a value, defaults to Project Structure.md |
-h, --help |
Show help message | - | - |
Print the full project tree in the terminal:
project-structure.exeInclude hidden files:
project-structure.exe --include-hiddenIgnore .gitignore rules:
project-structure.exe --no-gitExclude specific files and directories:
project-structure.exe --exclude "target *.log"Limit depth to 2 levels:
project-structure.exe --depth 2Sort directories first:
project-structure.exe --sort typeShow only directories:
project-structure.exe --filter dirsWrite tree to Markdown (default path):
project-structure.exe -o
# Output: Project Structure.mdWrite tree to a custom Markdown file:
project-structure.exe -o=MyProjectTree.mdWrite tree to a nested path:
project-structure.exe -o=./docs/ProjectTree.md- The tool respects
.gitignoreby default unless--no-gitis passed. - Hidden files (
.*) are ignored by default unless--include-hiddenis passed. - The Markdown output wraps the tree in a code block with a
# Project Structureheader.
This project is licensed under the MIT License.