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.0.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.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dumpcat-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 fb7667f9fe347f3d7055f02f5044950273aaaa03162d1299f3821c45e7f45649
MD5 84ec44cd6ad5833522828504893349ad
BLAKE2b-256 f78ad24b3c3625261e98078f9df25afd29f6ad1387246454ea4f8a3fc364619c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dumpcat-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 801f3d55748d7c6d0c00a346617183d5bb78b0ed374f7e5d9f30eaa39770e3e2
MD5 73b6424be0392e69ab99c1cf6ac300dd
BLAKE2b-256 7f854d966146e8b27a252ca53235881f0a716baf959643d324a6fc8c3c0a4d1a

See more details on using hashes here.

Provenance

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