DirScanner is a CLI tool written in Go that scans a directory and generates a Markdown file with the directory's structure. It supports custom connector styles, exclusion of certain file types, and limiting directory traversal depth.
- Generate Directory Structure: Easily generate a Markdown file representing the structure of a directory.
- Custom Connector Styles: Customize the symbols used to represent the directory tree.
- Exclude File Types: Exclude specific file types or directories based on patterns.
- Limit Directory Depth: Restrict how deep the tool scans the directory tree.
You can install DirScanner directly using:
go install github.com/aymaneallaoui/dirscanner@latest
To scan a directory and generate a Markdown file:
dirscanner <directory to scan> <output markdown file>
You can exclude specific file types or directories using the --exclude flag or using the .dirignore
file.
dirscanner ./dir structure.md --exclude ".txt" --exclude "node_modules"
To limit how deep the tool scans the directory, use the --depth
flag:
dirscanner ./dir structure.md --depth 2
You can customize the symbols used to draw the directory tree:
dirscanner ./dir structure.md --intermediate "+-- " --last "`-- " --prefix " " --branch "| "
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes or improvements.
This project is licensed under the MIT License - see the LICENSE file for details.