fusefiles
A CLI tool that concatenates files into a single prompt for use with LLMs.
What does it do?
Both fuse and fusefiles work (use whichever you prefer!)
You run fuse src/ --toc and get:
Table of Contents
---
└── src/
├── cli.rs
├── main.rs
├── output/
│ ├── default.rs
│ ├── markdown.rs
│ └── xml.rs
├── tree.rs
└── utils.rs
---
src/cli.rs
---
use clap::Parser;
use std::fs::File;
... (contents of all files concatenated)
The tool generates a table of contents tree showing your project structure, followed by the concatenated contents of all files. Perfect for feeding to LLMs like Claude or ChatGPT!
How to Use
Installation
Install from crates.io
This installs both the fuse and fusefiles commands (they're aliases for the same tool).
Build and Install from Source
Clone the repository and install:
This installs both fuse and fusefiles to ~/.cargo/bin/, making them available system-wide.
Build Only (for development)
The executable will be in target/release/fuse.
How do I use it?
# Fuse all files in a directory
# Fuse multiple paths
# Only include Python and Rust files
# Output in markdown format with code blocks
# Output in Claude XML format
# Save output to a file
# Exclude test files
# Include hidden files (git ignored files are ignored by default)
# Add line numbers
# Add a table of contents tree
# Table of contents with directories only
# Table of contents with files and directories
# Ignore files only (not directories) with pattern
# Ignore .gitignore rules
# Pipe file paths from another command
|
# Use with null-separated paths
|
Development
Running Tests
# Run all tests
# Run specific test by name
# Run only unit tests
# Run only integration tests
Linting and Formatting
# Format code
# Lint with clippy
Shoutout
Inspired by Simon Willison's files-to-prompt but faster and with more features, like including a file tree at the top of the single file.