TreeMark
Generate clean project trees for Markdown, READMEs, docs, and terminals.
Why TreeMark
You're writing a README and need a project tree. You could manually type it out, or use a tool that prints noisy output you don't want. TreeMark does one thing well: it scans a directory and prints a clean, readable tree you can paste straight into a Markdown file.
- Zero runtime dependencies
- Works on Windows, macOS, and Linux
- Outputs plain text, Markdown, or ASCII
- Ignores common junk by default (
.git,node_modules,__pycache__) - Respects
.treeignorefiles
Installation
pip install treemark
Or install from source:
git clone https://github.com/kritagyadubey/treemark.git
cd treemark
pip install -e .
Quick Start
cd my-project
treemark
Output:
my-project/
├── src/
│ ├── main.py
│ └── utils.py
├── tests/
│ └── test_main.py
├── README.md
└── pyproject.toml
Examples
Scan a specific directory:
treemark path/to/project
Limit depth to 2 levels:
treemark --depth 2
Include hidden files:
treemark --all
Show only files:
treemark --files-only
Show only directories:
treemark --dirs-only
Ignore specific patterns:
treemark --ignore "node_modules,dist,*.log"
Disable built-in ignores:
treemark --no-default-ignore
Use ASCII tree characters:
treemark --ascii
Show file type emojis:
treemark --emoji
Write output to a file:
treemark --output tree.md
Options
| Option | Description |
|---|---|
path |
Directory to scan (default: current directory) |
--depth N |
Maximum depth to scan (default: unlimited) |
--all, -a |
Include hidden files and directories |
--files-only |
Show only files |
--dirs-only |
Show only directories |
--no-files |
Alias for --dirs-only |
--ignore PATTERNS |
Comma-separated patterns to ignore (may be repeated) |
--ignore-file FILE |
Path to ignore file (default: auto-load .treeignore if present) |
--no-default-ignore |
Disable built-in default ignore patterns |
--markdown, -m |
Output as a Markdown fenced code block |
--plain |
Output plain tree (default) |
--emoji |
Show emojis for common file types |
--ascii |
Use ASCII tree characters instead of Unicode |
--output FILE, -o |
Write output to a file instead of stdout |
--version, -v |
Show version |
--help, -h |
Show help |
.treeignore
TreeMark supports .treeignore files. If a .treeignore file exists in the directory you're scanning, it will be loaded automatically.
Example .treeignore:
node_modules
dist
*.log
data/*.csv
Rules:
- Blank lines are ignored
- Lines starting with
#are comments - Exact names are supported
- Glob patterns (
*.log,test_*) work viafnmatch - Patterns are checked against the entry name and its relative path
- Negation patterns (
!foo) are not supported
You can use --ignore-file to specify a custom ignore file, or --no-default-ignore to disable the built-in ignore list entirely.
Markdown Output
treemark --markdown
This wraps the tree in a fenced code block:
```text
my-project/
├── src/
│ └── main.py
└── README.md
```
Copy the output directly into your README. The fence automatically uses a longer delimiter if the tree itself contains triple backticks.
Emoji Mode
treemark --emoji
Adds small emojis for common file types:
.pyfiles.js/.ts/.html/.cssfiles.json/.md/.yml/.yaml/.tomlfilesDockerfile
Emoji mode only affects display. It does not change sorting, ignore behavior, or path handling.
Output to File
treemark --output tree.md
If the output file is inside the scanned directory, it will be automatically excluded from the tree. Parent directories for the output file are created if they don't exist.
Running as a Module
python -m treemark
Development
Clone and install in development mode:
git clone https://github.com/kritagyadubey/treemark.git
cd treemark
pip install -e .
Testing
pytest
Contributing
Contributions are welcome. Keep things simple. If you're adding a feature, add a test for it.
Privacy
TreeMark runs entirely on your local machine. It:
- Does not upload files
- Does not upload directory listings
- Does not make network requests
- Does not send telemetry
- Does not collect analytics
- Does not require an internet connection
License
MIT License. See LICENSE for details.
Author
Kritagya Dubey
GitHub: @kritagyadubey
Metadata
Release files for treemark 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| treemark-0.1.0.tar.gz | 16.0 kB | Without provenance | Details for treemark-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| treemark-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for treemark-0.1.0-py3-none-any.whl |
Total release size: 26.7 kB
Release files / treemark-0.1.0.tar.gz
| Download URL | treemark-0.1.0.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
305aee8f2d097de42b22a7d4b8373fd28a8541eee74f2b52f75087d48ef10336
|
|
BLAKE2b-256 checksum How to use checksums |
3467c0956b979b9e8e53f41f7b2ba088cb7593aaf816ee68c594bcf04e95323f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / treemark-0.1.0-py3-none-any.whl
| Download URL | treemark-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59a5ac33a9e3c5e41a640fc3331eb637326e6274de33a2dbc86680bdc9540efa
|
|
BLAKE2b-256 checksum How to use checksums |
a088b0e22ea20a06dfbaf40f43dd805090696c2d4a39d980e54a153a80b5585c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for treemark 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.