Skip to content

HardBoss07/project-structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Structure CLI

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.


Example

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.md

Usage

project-structure.exe [OPTIONS] [PATH]
  • [PATH]: Root path of the project. Defaults to the current directory (.) if not specified.

Options

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

Examples

Print the full project tree in the terminal:

project-structure.exe

Include hidden files:

project-structure.exe --include-hidden

Ignore .gitignore rules:

project-structure.exe --no-git

Exclude specific files and directories:

project-structure.exe --exclude "target *.log"

Limit depth to 2 levels:

project-structure.exe --depth 2

Sort directories first:

project-structure.exe --sort type

Show only directories:

project-structure.exe --filter dirs

Write tree to Markdown (default path):

project-structure.exe -o
# Output: Project Structure.md

Write tree to a custom Markdown file:

project-structure.exe -o=MyProjectTree.md

Write tree to a nested path:

project-structure.exe -o=./docs/ProjectTree.md

Notes

  • The tool respects .gitignore by default unless --no-git is passed.
  • Hidden files (.*) are ignored by default unless --include-hidden is passed.
  • The Markdown output wraps the tree in a code block with a # Project Structure header.

License

This project is licensed under the MIT License.

About

A fast, Git-aware directory tree generator in Rust. Visualize your project structure in ASCII, respect .gitignore rules, and export clean Markdown trees for your documentation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages