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-cli

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

4. Statistics

Use --stats to print merge statistics:

filemerger src/ --stats

Reported values:

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

5. AI Marker Mode (--ai-markers)

filemerger src/ --ai-markers

Use this when:

  • You need strong, explicit file boundaries for AI systems
  • You want deterministic multi-file reasoning
  • You are feeding large structured context into LLMs
  • You need machine-parsable output

Characteristics:

  • Explicit file boundary markers
  • Clear begin/end delimiters
  • Unambiguous separation between files
  • Designed for reliable AI ingestion

Example:

<<<FILE 1: path/to/file.py>>>
<content>
<<<END FILE>>>

<<<FILE 2: another/file.js>>>
<content>
<<<END FILE>>>

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 Distribution

filemerger_cli-0.3.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

filemerger_cli-0.3.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file filemerger_cli-0.3.1.tar.gz.

File metadata

  • Download URL: filemerger_cli-0.3.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for filemerger_cli-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f1d544882abf73f379a57e7124eac90fa5cfe7233af2365fd105491018a95686
MD5 af23c0a737ab57bbfc4c279a988caf23
BLAKE2b-256 72ba927c23349c12dd1b348ee672c36550e19d4d08435cc6c96af10e98108b5b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: filemerger_cli-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b90d69e868b4b2d3f10d4a35a7d421f72d01083f0ef19cc1d8cb8affa155d453
MD5 71351d0daf30182b45a9031f63b8abc0
BLAKE2b-256 e984ca432526b11bd7f067f130621240835cdc96e315e61eb6d5113ebe0ff866

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