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.

dumpcat

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
  • 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
dumpcat -i .py -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
--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.2.0.tar.gz (24.7 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.2.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dumpcat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 77da8ee6e02cef5865b3e71170227b8f9043e2bb76679e8749826d52cbb13088
MD5 e01e137c0c91bd606b3c6b0c5f8f958f
BLAKE2b-256 1348db976de5c48e9bc0e468a6dd1c5cc304b896a08ba7c799a0b4304947bc3f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dumpcat-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd1fa77450f4b689a5eccc553804e9c5fb3144320903ff73149f7d9014639495
MD5 a5e8a52c0eda3e305261e03df8d9aefd
BLAKE2b-256 19b4923f02f679b072d80510d3f413625b2d5bf164a2d0ba52b6d83a009c37c2

See more details on using hashes here.

Provenance

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