Skip to main content

Dump a directory's file tree and contents into a single formatted output — built for LLM prompts.

Project description

dumpcat

PyPI License

Dump a directory's file tree and contents into a single formatted output — built for LLM prompts.

Highlights

  • One command to dump your entire codebase (or a filtered slice of it) into a single output
  • Smart defaults — respects .gitignore, skips binaries, limits file sizes
  • Three output formats — Markdown, plain text, or JSON
  • Filterable — by extension, glob pattern, depth, and file size
  • Clipboard ready — copy output directly with -c
  • Prompt-friendly — prepend/append text or template files for LLM context
  • Configurable — project-level .dumpcat.toml with named profiles
  • Zero bloat — one runtime dependency (pathspec), everything else is stdlib

Installation

Requires Python 3.11+.

uv tool install dumpcat
# Or with pip
pip install dumpcat
# Or with pipx
pipx install dumpcat

Quick start

# Dump current directory as Markdown
dumpcat

# Only Python files, 2 levels deep
dumpcat -d 2 -i .py

# Prepend a prompt and copy to clipboard
dumpcat -i .py -c -p "Review this code for security issues"

# Plain text with stats
dumpcat -f plain -s

# Just the tree structure
dumpcat --tree-only

# JSON output for tooling
dumpcat -f json --no-tree

Output

dumpcat renders file contents followed by a file tree:

# File Contents

## `src/main.py`

```python
import sys

def main():
    print("hello")
```

# File Tree

```
.
├── src/
│   ├── main.py
│   └── utils/
│       └── helpers.py
└── README.md
```

See the output formats documentation for Markdown, plain text, and JSON examples.

CLI reference

dumpcat [OPTIONS] [PATH]
Flag Short Description
--output PATH -o Write output to a file
--clipboard -c Copy output to clipboard
--depth INT -d Max directory depth
--include EXT -i Include only these extensions (repeatable)
--exclude PATTERN -e Exclude glob patterns (repeatable)
--gitignore / --no-gitignore Respect .gitignore rules (default: on)
--tree-only Show only the tree, no file contents
--no-tree Show only file contents, no tree
--prepend TEXT -p Text or @filepath to prepend
--append TEXT -a Text or @filepath to append
--max-size SIZE Skip files larger than this (default: 1mb)
--stats -s Show file count, lines, and estimated tokens
--format FORMAT -f markdown, plain, or json (default: markdown)
--config PATH Path to config file
--profile NAME Named profile from config
--follow-symlinks Follow symbolic links
--hidden Include dotfiles and dotdirs
--line-numbers -n Add line numbers to file contents

See the full CLI reference for details.

Configuration

Create a .dumpcat.toml in your project root:

[default]
exclude = ["__pycache__", "*.pyc", ".venv"]

[profiles.python]
include = [".py", ".pyi", ".toml", ".md"]
exclude = ["__pycache__", "*.pyc", ".venv", ".mypy_cache"]

[profiles.web]
include = [".js", ".ts", ".tsx", ".css", ".html"]
exclude = ["node_modules", "dist", ".next"]
dumpcat --profile python

See the configuration documentation for details.

Documentation

Full documentation is available at allenfp.github.io/dumpcat.

License

MIT

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

dumpcat-0.1.2.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dumpcat-0.1.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file dumpcat-0.1.2.tar.gz.

File metadata

  • Download URL: dumpcat-0.1.2.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dumpcat-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1aacce8bab5577ddcd21c175d9c2c3dab9bfb8e1627c46bc729f7473ae9c29a9
MD5 57d399fbd0533531774c1123a3a43521
BLAKE2b-256 4fa417f229d8249f7f88b11682089c3e15b67639a63a1b7e3da1a7ff633a7aac

See more details on using hashes here.

Provenance

The following attestation bundles were made for dumpcat-0.1.2.tar.gz:

Publisher: publish.yaml on Allenfp/dumpcat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dumpcat-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dumpcat-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dumpcat-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c517c8be22e3b94061d5334edaea364cfac2a877f225d48ea678a406ef0d0b6
MD5 1fe90d5a3fd3095fd04c17ce9d1afd49
BLAKE2b-256 6264a5b3c74ae0ece60eb55fd5dac38066ce3d3f3d9420c9dc30eb6ee3ec9585

See more details on using hashes here.

Provenance

The following attestation bundles were made for dumpcat-0.1.2-py3-none-any.whl:

Publisher: publish.yaml on Allenfp/dumpcat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page