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.1.tar.gz (15.4 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.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dumpcat-0.1.1.tar.gz
  • Upload date:
  • Size: 15.4 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.1.tar.gz
Algorithm Hash digest
SHA256 513e8a7a60b74261ea4ead61d7ee1eee03a99d7c6b5854e15466d6c007017934
MD5 3604c7a93dfd0c934904ebaf1397eda8
BLAKE2b-256 f7b8a432a7f8b94c72722be69a92c252437fde2c74e1a84f887b6610d206b500

See more details on using hashes here.

Provenance

The following attestation bundles were made for dumpcat-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: dumpcat-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 606d3bc56020e8020168474f98e82621afce8e0bc8cb409a944ab965e5e95cfb
MD5 70d4150215b4749bb1a36af96d3e847a
BLAKE2b-256 b31b58741579f49912befbcb8c99dc63e07f83cad6766760223120748c98e9c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for dumpcat-0.1.1-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