Dump all text files in a directory tree into a single file
Project description
treedump v0.2.0
treedump walks a directory tree and produces a single text dump containing:
- The directory tree structure (first)
- The contents of all text files in that tree (second)
Binary files are never dumped.
The output file itself is never re-ingested.
By default, hidden files and directories are excluded.
This tool is designed for:
- code review and audits
- LLM context ingestion
- archiving project snapshots
- inspecting unfamiliar repositories
Installation
Install from PyPI:
pip install treedump
For development or local testing:
pip install -e .
Basic usage
Run in any directory:
treedump
This creates dump.txt in the current directory.
Output format
The output is structured and deterministic.
Tree structure is always written first, followed by file contents.
Example:
===== TREE STRUCTURE =====
.
./src
./src/main.py
./README.md
===== END TREE STRUCTURE =====
===== FILE: src/main.py =====
<file contents>
===== END FILE: src/main.py =====
===== FILE: README.md =====
<file contents>
===== END FILE: README.md =====
Ignore behavior (important)
Default behavior
Ignore rules are determined as follows:
-
If a
.gitignorefile exists in the current directory:- Only
.gitignorerules are used - Built-in defaults are NOT applied
- Only
-
If no
.gitignoreexists:- A safe built-in ignore list is used
The built-in ignore list includes:
-
version control and tooling directories
.git/,__pycache__/,venv/,.venv/,node_modules/,
.mypy_cache/,.pytest_cache/,.idea/,.vscode/ -
compiled and noisy artifacts
*.pyc,*.log -
secret-bearing files
.env,.env.*,*.env
.secrets,.secrets.*
*.key,*.pem,*.crt,*.p12,*.keystore
id_rsa,id_ed25519,*.pub
credentials,credentials.*
.aws/,.ssh/
Hidden files are excluded by default at the directory traversal level.
Ignore options
Disable all ignore rules
treedump --ignore-off
When this flag is used:
- all ignore rules are disabled
- binary files are still skipped
- the output file is still excluded
Use with care.
Add ignore files
treedump --ignore .gitignore custom.ignore
Ignore files use simple glob-style patterns.
Empty lines and comments (#) are ignored.
Add ignore patterns inline
treedump --ignore-pattern "*.sql" "*.db"
Ignore files and inline patterns are additive unless --ignore-off is specified.
Other options
Change output file name
treedump --output project_dump.txt
Omit tree structure
treedump --no-tree
Only file contents will be written.
Include hidden files and directories
treedump --include-hidden
Includes dotfiles and dot-directories (such as .env, .git/, .github/),
subject to ignore rules.
Show version
treedump --version
Requirements
- Python 3.9 or newer
- External commands available in PATH:
treefile
These are standard on most Unix-like systems.
Philosophy
treedump follows classic Unix principles:
- structure before content
- text-only by default
- hidden files excluded unless explicitly requested
- explicit behavior over clever inference
- safe defaults with deliberate escape hatches
- boring, predictable output
It intentionally does less than a full indexing or archival system.
License
MIT
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 treedump-0.2.0.tar.gz.
File metadata
- Download URL: treedump-0.2.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee22dfbb4b0951212351ac073df56a42e9415471f6085068d34bf788e5e1857f
|
|
| MD5 |
5334552e80f5a3e1b7bc447694424a05
|
|
| BLAKE2b-256 |
c2aaa4c7b3adc304248f83640a31f1efe3553c90b8901d9bd842c10e8ff9ce47
|
Provenance
The following attestation bundles were made for treedump-0.2.0.tar.gz:
Publisher:
python-publish.yml on appfeat/treedump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
treedump-0.2.0.tar.gz -
Subject digest:
ee22dfbb4b0951212351ac073df56a42e9415471f6085068d34bf788e5e1857f - Sigstore transparency entry: 771553338
- Sigstore integration time:
-
Permalink:
appfeat/treedump@7129fc22d7922e98933c1181b78a37fce8141a6f -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/appfeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7129fc22d7922e98933c1181b78a37fce8141a6f -
Trigger Event:
release
-
Statement type:
File details
Details for the file treedump-0.2.0-py3-none-any.whl.
File metadata
- Download URL: treedump-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.3 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 |
27ee9a0d89fc6b7ba8f01d627274b76e0ba2b655ab980b5986ca1e7955ac13c4
|
|
| MD5 |
cde82e1a34eba078e67a5739279e92bf
|
|
| BLAKE2b-256 |
ccada7fc44e89bb9159fffad93b963298588eb9d6e27e0813ca774b70e85ef00
|
Provenance
The following attestation bundles were made for treedump-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on appfeat/treedump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
treedump-0.2.0-py3-none-any.whl -
Subject digest:
27ee9a0d89fc6b7ba8f01d627274b76e0ba2b655ab980b5986ca1e7955ac13c4 - Sigstore transparency entry: 771553392
- Sigstore integration time:
-
Permalink:
appfeat/treedump@7129fc22d7922e98933c1181b78a37fce8141a6f -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/appfeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7129fc22d7922e98933c1181b78a37fce8141a6f -
Trigger Event:
release
-
Statement type: