dumpfiles

Crates.iodumpfiles
lib.rsdumpfiles
version0.3.0
created_at2024-08-27 14:22:25.297223+00
updated_at2025-09-22 21:09:47.618154+00
descriptionA CLI and library for generating structured YAML representations of directory contents, optimized for efficiently sharing codebases with LLMs.
homepagehttps://github.com/arbfay/dumpfiles
repositoryhttps://github.com/arbfay/dumpfiles
max_upload_size
id1353445
size62,363
Arbai Fayçal (arbfay)

documentation

README

dumpfiles

dumpfiles is a Rust command-line tool to generate a structured YAML representation of a directory's contents, including metadata and the contents of text files. It's designed to make it easy to share an entire code repository or any set of text files to an LLM (GPT-4o, Claude, etc.) for analysis or documentation.

Features

  • YAML Output: Generates a structured YAML file with file paths, sizes, token counts and contents.
  • Integrates with .gitignore files, ie. it will ignore files specified in .gitignore
  • Supports custom additional ignore patterns using the same syntax as .gitignore files, in a .dumpignore file

Installation

To install dumpfiles, you need to have Rust and Cargo installed on your system. Then, you can build the project from source:

cargo install dumpfiles

Usage

dumpfiles [OPTIONS] <DIRECTORY>

This will scan <directory> and output a output.yaml file.

Arguments

  • <DIRECTORY>: Path to the directory to process

Options

  • -o, --output <FILE>: Path to the output file (default: "output.yaml")
  • -g, --gitignore <FILE>: Path to the .gitignore file (default: ".gitignore")
  • --no-gitignore: Ignore the .gitignore file
  • -d, --dumpignore <FILE>: Path to the .dumpignore file (default: ".dumpignore")
  • -i, --ignore <PATTERN>: Additional ignore pattern (can be used multiple times)

Example

dumpfiles src/ -o project_dump.yaml -d ../.dumpignore -i uv.lock

This command will process the src directory, ignore all files specified in the ../.dumpignore file, and save the output to project_dump.yaml.

Output Format

A generated output.yaml might look like this:

Example:

project: my_project
files:
  - path: Cargo.toml
    size: "1.5 KB"
    lines: 20
    tokens: 50
    content: |
      [package]
      name = "my_project"
      version = "0.1.0"
  
  - path: src/main.rs
    size: "3.2 KB"
    lines: 120
    tokens: 500
    content: |
      fn main() {
          println!("Hello, world!");
      }

Contributing

Contributions are welcome! Please feel free to submit a PR or open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 14

cargo fmt