A command line utility to display and create directory structures
Project description
Tree3
Tree3
is a command-line utility designed to simplify the process of working with directory structures (works on all operating systems: Linux
, macOS
, Windows
and etc.). Its core functionalities are:
- Displaying Directory Structures: Generate a visual, tree-like representation of a specified directory, similar to the classic
tree
command but more useful.Example output:
/
├── src/
│ ├── main.py
│ └── utils.py
├── config.py
├── README.md
└── setup.py
- Creating Directory Structures: Parse a text file containing a predefined tree structure and create the corresponding directories and empty files on the filesystem.
The tool aims to assist developers, particularly when interacting with AI code generation tools or when sharing project structures. It provides options for filtering based on .gitignore rules, saving the output to a file, and copying the structure to the clipboard.
Installation
Install tree3 using pip:
pip install tree3
Usage
tree3 is invoked from the command line.
Synopsis
tree3 [OPTIONS] [path]
Arguments and Options
• path
(Optional): The directory path whose structure you want to display. Defaults to the current directory (.
).
This argument is ignored if -i
is used.
• -o FILE
, --output FILE
: Save the generated tree structure to the specified FILE
.
• -i FILE
, --input FILE
: Read a tree structure definition from the specified FILE
and create the corresponding directories and files.
• -g
, --ignore
: Respect rules found in the .gitignore
file within the target directory when generating the tree. This ignores files and directories specified in .gitignore
.
• -c
, --copy
: Copy the generated tree structure to the system clipboard.
• -v
, --version
: Display the version of tree3
and exit.
• -h
, --help
: Display the help message and exit.
Examples
1. Display the structure of the current directory:
tree3 [path]
output:
/
├── tree3/
│ ├── core/
│ │ ├── __init__.py
│ │ ├── builder.py
│ │ ├── parser.py
│ │ └── tree.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── clipboard.py
│ │ ├── file_utils.py
│ │ └── gitignore.py
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ ├── config.py
│ └── constants.py
├── LICENSE
├── pyproject.toml
├── README.md
└── setup.py
2. Display the structure of a specific project directory:
tree3 /path/to/my/project
3. Display structure, ignoring files/dirs from .gitignore:
tree3 -g /path/to/my/project
4. Save the structure to a file and copy it to the clipboard:
tree3 my_project -c -o structure.txt
5. Create directories and files from a structure definition file:
tree3 -i structure.txt
Contributing
Feel free to open issues and pull requests on the GitHub repository.
License
This project is licensed under the MIT License.
Built with ♥ by Amir Mazinani!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tree3-0.2.0.tar.gz
.
File metadata
- Download URL: tree3-0.2.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b00a65f65276a9ca1e8055db50df96d50e75f2b8fa1f794cb0f38ccd467702f7 |
|
MD5 | d4f5923cdb67ebd4e34d30d90f1c9ed8 |
|
BLAKE2b-256 | 282a11a1493b32eba73b1c807f8e81e25f901de4a3fbf15faf5d184c6023ff3e |
Provenance
The following attestation bundles were made for tree3-0.2.0.tar.gz
:
Publisher:
python-publish.yml
on amirmazinani/tree3
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tree3-0.2.0.tar.gz
- Subject digest:
b00a65f65276a9ca1e8055db50df96d50e75f2b8fa1f794cb0f38ccd467702f7
- Sigstore transparency entry: 193377036
- Sigstore integration time:
- Permalink:
amirmazinani/tree3@1c1b59ec383e1a4641f2c206f4995ec204f49922
- Branch / Tag:
refs/tags/v0.2.0
- Owner: https://github.com/amirmazinani
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
python-publish.yml@1c1b59ec383e1a4641f2c206f4995ec204f49922
- Trigger Event:
release
- Statement type:
File details
Details for the file tree3-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: tree3-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26361ebbb053e094fd8d42c910f17460726bf618af0f440c7ddf587d5dc4f3fa |
|
MD5 | 9aee06ad8464d1028b2645e160ae9ace |
|
BLAKE2b-256 | d29572c13798bcb4c291a0b6d812c847735f58f702ed8ca572dfa8a188c0c7c8 |
Provenance
The following attestation bundles were made for tree3-0.2.0-py3-none-any.whl
:
Publisher:
python-publish.yml
on amirmazinani/tree3
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tree3-0.2.0-py3-none-any.whl
- Subject digest:
26361ebbb053e094fd8d42c910f17460726bf618af0f440c7ddf587d5dc4f3fa
- Sigstore transparency entry: 193377040
- Sigstore integration time:
- Permalink:
amirmazinani/tree3@1c1b59ec383e1a4641f2c206f4995ec204f49922
- Branch / Tag:
refs/tags/v0.2.0
- Owner: https://github.com/amirmazinani
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
python-publish.yml@1c1b59ec383e1a4641f2c206f4995ec204f49922
- Trigger Event:
release
- Statement type: