Gitree: git-aware project tree printing and zipping for docs and LLMs
Reason this release was yanked:
Unstable, broken zipping
Project description
Gitree
A git-aware CLI tool to provide LLM context for coding projects by combining project files into a single file with a number of different formats to choose from.
โจ Features
| Feature | Description |
|---|---|
| ๐ Project Tree Visualization | Generate clean directory trees with customizable depth and formatting |
| ๐๏ธ Smart Zipping | Create project archives that automatically respect .gitignore rules |
| ๐ฏ Flexible Filtering | Control what's shown with custom ignore patterns, depth limits, and item caps |
| ๐ Gitignore Integration | Use .gitignore files at any depth level, or disable entirely when needed |
| ๐ Multiple Output Formats | Export to files, copy to clipboard, or display with emoji icons |
| ๐ Directory-Only View | Show just the folder structure without files for high-level overviews |
| ๐ Project Summary | Display file and folder counts at each directory level with summary mode |
๐ฅ The problems it solves:
- sharing project structure in issues or pull requests
- generating directory trees for documentation
- pasting project layouts into LLMs
- converting entire codebases to a single json file using
.gitignorefor prompting LLMs.
๐ฆ Installation
Run this command in your terminal:
# Install using pip
pip install gitree
๐ก Usage
To use this tool, refer to this format:
gitree [path] [other CLI args/flags]
Open a terminal in any project and run:
# path should default to .
gitree
Example output:
Gitree
โโ gitree/
โ โโ constants/
โ โ โโ __init__.py
โ โ โโ constant.py
โ โโ services/
โ โ โโ __init__.py
โ โ โโ draw_tree.py
โ โ โโ list_enteries.py
โ โ โโ parser.py
โ โ โโ zip_project.py
โ โโ utilities/
โ โ โโ __init__.py
โ โ โโ gitignore.py
โ โ โโ utils.py
โ โโ __init__.py
โ โโ main.py
โโ CODE_OF_CONDUCT.md
โโ CONTRIBUTING.md
โโ LICENSE
โโ pyproject.toml
โโ README.md
โโ requirements.txt
โโ SECURITY.md
Using emojis as file/directory icons:
gitree --emoji
Example output:
Gitree
โโ ๐ gitree/
โ โโ ๐ constants/
โ โ โโ ๐ __init__.py
โ โ โโ ๐ constant.py
โ โโ ๐ services/
โ โ โโ ๐ __init__.py
โ โ โโ ๐ draw_tree.py
โ โ โโ ๐ list_enteries.py
โ โ โโ ๐ parser.py
โ โ โโ ๐ zip_project.py
โ โโ ๐ utilities/
โ โ โโ ๐ __init__.py
โ โ โโ ๐ gitignore.py
โ โ โโ ๐ utils.py
โ โโ ๐ __init__.py
โ โโ ๐ main.py
โโ ๐ CODE_OF_CONDUCT.md
โโ ๐ CONTRIBUTING.md
โโ ๐ LICENSE
โโ ๐ pyproject.toml
โโ ๐ README.md
โโ ๐ requirements.txt
โโ ๐ SECURITY.md
For zipping a directory:
gitree --zip out
creates out.zip in the same directory.
Updating Gitree:
To update the tool, type:
pip install -U gitree
Pip will automatically replace the older version with the latest release.
โ๏ธ CLI Arguments
In addition to the directory path, the following options are available:
| Argument | Description |
|---|---|
--version, -v |
Displays the installed version. |
--depth |
Limits recursion depth. Example: --depth 1 shows only top-level files and folders. |
--all, -a |
Includes hidden files and directories. Does not override .gitignore. |
--ignore |
Adds extra files or directories to ignore. |
--ignore-depth |
Limits depth for --ignore patterns. Example: --ignore-depth 2 applies ignore rules only to first 2 levels. |
--gitignore-depth |
Controls how deeply .gitignore files are discovered. Example: --gitignore-depth 0 uses only the root .gitignore. |
--no-gitignore |
Ignores all .gitignore rules when set. |
--max-items |
Limits items shown per directory. Extra items are summarized as ... and x more items. Default: 20. |
--no-limit |
Removes the per-directory item limit. |
--no-files |
Hide files from the tree (only show directories). |
--emoji |
Show emojis in tree output. |
--summary |
Print a summary of the number of files and folders at each level. |
--zip [name], -z |
Zips the project while respecting .gitignore. Example: --zip a creates a.zip. If no name is provided, a random ID is used. |
--out [file], -o |
Save tree structure to file. Example: --out tree.txt or --out tree.md for markdown format. |
--copy, -c |
Copy tree output to clipboard. |
Installation (for Contributors)
Clone the repository:
git clone https://github.com/ShahzaibAhmad05/Gitree
Move into the project directory:
cd Gitree
Install dependencies:
pip install -r requirements.txt
The tool is now available as a Python CLI on your system.
For running directly from main without installing:
python -m gitree.main
Contributions
This is YOUR tool. Issues and pull requests are welcome.
Gitree is kept intentionally small and readable, so contributions that preserve simplicity are especially appreciated.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitree-0.2.0.tar.gz.
File metadata
- Download URL: gitree-0.2.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fb88ab536554ffffc94062243bca8534f194954dfbbb5acf5da4f1baff2cabd
|
|
| MD5 |
f3ae5a07420f88be84471118bcc412f6
|
|
| BLAKE2b-256 |
14490f116496e63ffcf0130d6565bca4c4f55429249a470e5b5a090cadf2e563
|
Provenance
The following attestation bundles were made for gitree-0.2.0.tar.gz:
Publisher:
workflow.yml on ShahzaibAhmad05/Gitree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitree-0.2.0.tar.gz -
Subject digest:
6fb88ab536554ffffc94062243bca8534f194954dfbbb5acf5da4f1baff2cabd - Sigstore transparency entry: 779040212
- Sigstore integration time:
-
Permalink:
ShahzaibAhmad05/Gitree@d98e6486be8c16cae9de2911c9cc4f3d9afde232 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ShahzaibAhmad05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@d98e6486be8c16cae9de2911c9cc4f3d9afde232 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gitree-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gitree-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a8a6e8e6cf71cd4265c71867dbae910af75fbb31516e27bc47d3366dd65982f
|
|
| MD5 |
ce13cbfda71425fe8c3b49db46c9d5e9
|
|
| BLAKE2b-256 |
b7d5f319bf74e6ea99bc3fdc8b18174dc3f69340d3f8a43b1cc4bc37f5e904d8
|
Provenance
The following attestation bundles were made for gitree-0.2.0-py3-none-any.whl:
Publisher:
workflow.yml on ShahzaibAhmad05/Gitree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gitree-0.2.0-py3-none-any.whl -
Subject digest:
7a8a6e8e6cf71cd4265c71867dbae910af75fbb31516e27bc47d3366dd65982f - Sigstore transparency entry: 779040215
- Sigstore integration time:
-
Permalink:
ShahzaibAhmad05/Gitree@d98e6486be8c16cae9de2911c9cc4f3d9afde232 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ShahzaibAhmad05
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@d98e6486be8c16cae9de2911c9cc4f3d9afde232 -
Trigger Event:
release
-
Statement type: