🌳 TreeExporter
Automatically generate beautiful repository structure diagrams from your project.
No more manually maintaining folder trees in your README.
Why?
Keeping a repository structure up to date is surprisingly annoying.
Every time files or folders change, developers have to manually edit the tree inside the documentation:
src
├── api
├── models
├── utils
└── ...
Which quickly becomes outdated.
TreeExporter scans your project and generates a clean, automatically updated visualization instead.
It can be:
- updated automatically with GitHub Actions
- used as a Python library
- used as a CLI tool
- exported to SVG or plain text
🖼 Demo
SVG

Text
Look at ./docs/structure.txt.
🚀 Features
- Repository scanning
- SVG export
- Plain text export
- Built-in SVG themes
- Configurable excluded directories
- GitHub Actions support
- Python library API
- Fast recursive traversal
More formats are planned.
Installation
Using uv (recommended):
uv tool install TreeExporter
or install into the current environment:
uv add TreeExporter
Using pip:
pip install TreeExporter
💻 CLI
Generate a repository structure:
tree-exporter
By default, this generates:
structure.svg
Output format
Generate SVG:
tree-exporter \
--format svg \
--output docs/tree
Generate plain text:
tree-exporter \
--format txt \
--output docs/tree
The output extension is added automatically.
Themes
SVG output supports built-in themes:
tree-exporter \
--format svg \
--output docs/tree \
--theme dark
Available themes:
light
dark
github-light
github-dark
dracula
monokai
nord
solarized-light
solarized-dark
one-dark
See Themes for previews.
Excluding directories
Add directories to the default exclusion list:
tree-exporter \
--exclude ".venv,dist,build"
You can also repeat the option:
tree-exporter \
--exclude ".venv,dist" \
--exclude "coverage,node_modules"
Replacing default exclusions
Use --exclude-overwrite to replace the default exclusion list completely:
tree-exporter \
--exclude-overwrite \
--exclude ".git,.venv"
🎨 Themes
TreeExporter includes built-in themes for SVG output.
Choose a theme with the --theme CLI option or the theme GitHub Action input.
Light
tree-exporter --theme light
Dark
tree-exporter --theme dark
GitHub Light
tree-exporter --theme github-light
GitHub Dark
tree-exporter --theme github-dark
Dracula
tree-exporter --theme dracula
Monokai
tree-exporter --theme monokai
Nord
tree-exporter --theme nord
Solarized Light
tree-exporter --theme solarized-light
Solarized Dark
tree-exporter --theme solarized-dark
One Dark
tree-exporter --theme one-dark
The default theme is light.
GitHub Actions
TreeExporter can automatically generate and update your repository structure using GitHub Actions.
Basic usage
The simplest setup is:
name: Generate repository structure
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Generate repository structure
uses: mrf0rtuna4/TreeExporter@v0.2.0
with:
format: svg
output: docs/structure
- name: Commit and push
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "Repository structure is up-to-date."
exit 0
fi
git commit -m "Update repository structure"
git push
This will generate docs/structure.svg and commit it when the repository structure changes.
Action inputs
| Input | Default | Description |
|---|---|---|
path |
. |
Repository path to scan |
output |
structure |
Output path without extension |
format |
svg |
Export format: svg or txt |
theme |
light |
SVG theme |
exclude |
"" |
Additional excluded directories, separated by commas |
exclude-overwrite |
false |
Replace default exclusions instead of extending them |
commit |
false |
Commit generated files |
commit-message |
Update repository structure |
Commit message |
branch |
"" |
Target branch |
Using a theme
For example, generate a dark-themed structure:
- name: Generate repository structure
uses: mrf0rtuna4/TreeExporter@v0.2.0
with:
format: svg
output: docs/structure
theme: dark
Or use Dracula:
- name: Generate repository structure
uses: mrf0rtuna4/TreeExporter@v0.2.0
with:
format: svg
output: docs/structure
theme: dracula
Excluding directories
Additional exclusions can be configured directly in the Action:
- name: Generate repository structure
uses: mrf0rtuna4/TreeExporter@v0.2.0
with:
format: svg
output: docs/structure
exclude: ".venv,dist,build,node_modules"
To completely replace the default exclusions:
- name: Generate repository structure
uses: mrf0rtuna4/TreeExporter@v0.2.0
with:
format: svg
output: docs/structure
exclude-overwrite: "true"
exclude: ".git,.venv"
Complete example
A more complete workflow can look like this:
name: Generate repository map
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Generate repository structure
uses: mrf0rtuna4/TreeExporter@v0.2.0
with:
format: svg
output: docs/structure
theme: dark
exclude: ".venv,dist,build"
- name: Commit and push
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "Repository structure is up-to-date."
exit 0
fi
git commit -m "Update repository structure"
git push
Library
TreeExporter can also be used directly from Python.
from tree_exporter.config import ScanConfig
from tree_exporter.scanner import scan_repository
tree = scan_repository(
".",
ScanConfig(),
)
Roadmap
- ✅ Repository scanning
- ✅ Text export
- ✅ SVG export
- ✅ GitHub Action
- ✅ Built-in themes
- 🚧 Mermaid export
- 🚧 JSON export
- 🚧 PNG export
- 🚧 Custom icons
- 🚧 Ignore file support
License
See the LICENSE file for 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
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 treeexporter-0.2.0.tar.gz.
File metadata
- Download URL: treeexporter-0.2.0.tar.gz
- Upload date:
- Size: 38.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
befbfc4a9e5bbed1828f9c09309b29131f57285e9a7bb5ba4dd1c93096d07af7
|
|
| MD5 |
6028dc3b3bb3fa5edf0c64dca9a18e10
|
|
| BLAKE2b-256 |
84987e836c4419a47561d338c28ab78154279bedc35bb0636574fa3b242510ea
|
Provenance
The following attestation bundles were made for treeexporter-0.2.0.tar.gz:
Publisher:
publish.yml on mrf0rtuna4/TreeExporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
treeexporter-0.2.0.tar.gz -
Subject digest:
befbfc4a9e5bbed1828f9c09309b29131f57285e9a7bb5ba4dd1c93096d07af7 - Sigstore transparency entry: 2406588701
- Sigstore integration time:
-
Permalink:
mrf0rtuna4/TreeExporter@d85327bd7730ac7aab4c420964f54179014372a7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mrf0rtuna4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d85327bd7730ac7aab4c420964f54179014372a7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file treeexporter-0.2.0-py3-none-any.whl.
File metadata
- Download URL: treeexporter-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f95e4a5496a2cd02e24bc21fa5fec0c996cd4251e60d89046f5af3f2e536449c
|
|
| MD5 |
4beadcef5080ef5bf6b05f82f0725841
|
|
| BLAKE2b-256 |
595873fdf92c9295faf615868ed896a8d626f0f82d63c37239cf86ecc408c02d
|
Provenance
The following attestation bundles were made for treeexporter-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on mrf0rtuna4/TreeExporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
treeexporter-0.2.0-py3-none-any.whl -
Subject digest:
f95e4a5496a2cd02e24bc21fa5fec0c996cd4251e60d89046f5af3f2e536449c - Sigstore transparency entry: 2406588736
- Sigstore integration time:
-
Permalink:
mrf0rtuna4/TreeExporter@d85327bd7730ac7aab4c420964f54179014372a7 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mrf0rtuna4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d85327bd7730ac7aab4c420964f54179014372a7 -
Trigger Event:
release
-
Statement type: