PrintLayout is a powerful, customizable command-line tool for printing directory structures in a tree format. Built with Go for simplicity and performance, it offers extensive features for visualizing and exploring file systems.
Download the appropriate binary for your operating system from the Releases page.
# Download binary
chmod +x pr-linux-amd64
sudo mv pr-linux-amd64 /usr/local/bin/pr
# Run
pr -dir /path/to/your/folder
- Download
pr-windows-amd64.exe
- Move to a directory in your
PATH
Flag | Description | Default | Example |
---|---|---|---|
--dir |
Specify directory to print | Current directory | pr --dir /path/to/folder |
--ext |
Filter files by extension | All files | pr --ext .go |
--output |
Save output to file | Terminal output | pr --output output.txt |
--no-color |
Disable colored output | Colors enabled | pr --no-color |
--hidden |
Include hidden files | Not included | pr --hidden |
Flag | Description | Options | Default | Example |
---|---|---|---|---|
--sort-by |
Sort criteria | name , size , time |
name |
pr --sort-by size |
--order |
Sorting order | asc , desc |
asc |
pr --sort-by time --order desc |
Flag | Description | Default | Example |
---|---|---|---|
--exclude |
Exclude files/dirs matching pattern | No exclusions | pr --exclude "*.log" |
Flag | Description | Options | Default | Example |
---|---|---|---|---|
--format |
Output format | text , json , xml , yaml |
text |
pr --format json |
Flag | Description | Options | Default | Example |
---|---|---|---|---|
--dir-color |
Directory color | black , red , green , yellow , blue , magenta , cyan , white |
blue |
pr --dir-color green |
--file-color |
File color | Same as above | green |
pr --file-color yellow |
--exec-color |
Executable file color | Same as above | red |
pr --exec-color magenta |
printLayout supports the following colors for customization:
black
red
green
yellow
blue
magenta
cyan
white
pr
pr --dir ./path/to/project
pr --dir /path/to/project --ext .ts --sort-by size --order desc --exclude "node_modules" --exclude "*.test" --dir-color magenta --file-color cyan --output project_structure.txt
go run ./cmd/main.go
go test -v ./...
go build -o printlayout ./cmd/main.go
- Fork the repository
- Create a feature branch
- Commit changes
- Push and submit a pull request
I don't know about License stuff, but this project made by me
- Built with Go
- Inspired by GNU Tree
This project is licensed under the MIT License.