Socket
Book a DemoInstallSign in
Socket

tree-scribe

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-scribe

Generate and export directory tree structures with optional color output.

0.0.7
pipPyPI
Maintainers
1

Directory Tree Script

This script generates a visual representation of the directory structure of a specified root directory. It supports exporting the structure to a Markdown file and offers various options to customize the output.

Usage: tree-script [SWITCHES] directory

Generate a directory tree structure for a given path, with options for depth
limitation, colorful output, file sizes, and exporting to Markdown.

positional arguments:
  directory             Path to the root directory to analyze

optional arguments:
  -h, --help            Show this help message and exit
  -md, --export-md      Export the directory structure to a Markdown file
  -d DEPTH, --depth DEPTH
                        Limit the depth of directory traversal (e.g., -d 2)
  -v, --verbose         Enable verbose logging for debugging purposes
  -c, --color           Enable colorful output for better readability
  -s, --size            Show file sizes and line counts in the output

Examples:
  tree-script /path/to/directory
  tree-script /path/to/directory -d 2 -s
  tree-script /path/to/directory -md -c

Example Output

-d

Installation

 pip install tree-scribe

Or

 pipx install tree-scribe

Command-Line Switches

Switch/OptionDescriptionExample Usage
<directory-path>Path to the root directory whose structure you want to display.tree-scribe /home/project
-md, --export-mdExport the directory structure to a Markdown file.tree-scribe /home/project -md
-d, --depth <number>Limit the depth of directory traversal.tree-scribe /home/project -d 2
-v, --verboseEnable verbose logging for detailed output.tree-scribe /home/project -v
-c, --colorEnable colorful output in the terminal.tree-scribe /home/project -c
-s, --sizeShow line and size.tree-scribe /home/project -s
--excludeExclude file and folder.tree_scribe /path/to/directory --exclude dist build .git

Examples

  • Display the Directory Structure

    tree-scribe /home/project
    
  • Export to Markdown

    tree-scribe /home/project --export-md
    
  • Limit Depth to 2 Levels

    tree-scribe /home/project --depth 2
    
  • Enable Verbose Logging

    tree-scribe /home/project --verbose
    
  • Enable Colorful Output

    tree-scribe /home/project -c
    
  • Show line and size

    tree-scribe /home/project -s
    
  • Combine Options

    tree-scribe /home/project --export-md --depth 3 -c -s
    
  • Exclude files or folder

    tree_scribe /path/to/directory --exclude dist build .git
    

Troubleshooting

  • Permission Errors: If you encounter permission errors, make sure you have the necessary permissions to access the directories and files.
  • Invalid Directory Path: Ensure the specified directory path is correct and exists.

License

This script is provided under the MIT License. See the LICENSE file for more information.

Contributing

Feel free to submit issues, suggestions, or pull requests. Contributions are welcome!

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.