Skip to main content

Developer CLI tool to consolidate project files into a single output

Project description

FileMerger

FileMerger is a developer-focused CLI tool that consolidates project files into a single plain-text output.

It is designed to help developers:

  • Share complete code context with AI tools (ChatGPT, Gemini, Grok, Claude, etc.)
  • Review large codebases
  • Create audit or snapshot files
  • Prepare structured input for analysis

Installation

pip install filemerger

Basic Usage

Merge a directory:

filemerger src/

Specify output file:

filemerger src/ --output context.txt

Dry run (no file written):

filemerger . --dry-run

Output Modes

FileMerger supports multiple output modes depending on who (or what) will consume the output.

1. Default Mode (Human-Readable)

filemerger src/

Use this when:

  • You want to read the output yourself
  • You are reviewing or auditing code
  • You want clear visual separation

Characteristics:

  • File lists and headers
  • Visual separators
  • Structured, readable layout

2. LLM Mode (--llm)

filemerger src/ --llm

Use this when:

  • The output will be pasted into an AI system
  • You want deterministic file references
  • You want to reduce semantic noise

Characteristics:

  • Files are numbered ([1], [2], …)
  • No decorative separators
  • Simple, predictable structure

Example:

[1] path/to/file.py
<content>

[2] another/file.js
<content>

3. LLM Compact Mode (--llm-compact)

filemerger src/ --llm-compact

Use this when:

  • Token limits are tight
  • The project is very large
  • Maximum efficiency matters

Characteristics:

  • Same structure as --llm
  • Fewer blank lines
  • Minimal formatting overhead

Statistics

Use --stats to print merge statistics:

filemerger src/ --stats

Reported values:

  • Number of files
  • Total lines
  • Total bytes
  • Skipped files (binary / non-UTF8)

Configuration (Optional)

FileMerger supports an optional .filemerger.toml file in the project root.

Example:

[filters]
max_file_size_mb = 1
exclude_dirs = ["tests"]

[output]
separator_length = 60

If the file is not present, default behavior is used.


License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filemerger_cli-0.3.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file filemerger_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: filemerger_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for filemerger_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50e0f6c2be24cbee4bc8366c386199fa653d0d7c5ca3cf3ae02a812d6091687f
MD5 5e84c868766af6cd3f67fe05cb0ca340
BLAKE2b-256 b48d7591f9f6c0755ff2dae66032e9b76b748c7b1f7cfa7fceadc47088b1b331

See more details on using hashes here.

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