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.2.tar.gz (9.2 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.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: filemerger_cli-0.3.2.tar.gz
  • Upload date:
  • Size: 9.2 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.2.tar.gz
Algorithm Hash digest
SHA256 2fd18c15b59e93ccb0e120245446b36eadfc99c4896312d15941c91a012af4b1
MD5 682b9b269acd4c962b305a8c56a7f87b
BLAKE2b-256 2808da54e73bd2e4ec1f8ddb1aeb5e13f37279573d59ac7308c31ebb2c21559b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: filemerger_cli-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e4c2c34c88d276594431b7cc0deee80a39fdb3e0d3afa5b5d4819772dbf22410
MD5 68946cd3cd5b9894125919b185348bfb
BLAKE2b-256 803c9d1e63f57c4df454708c6f07c30b129d31d35d6337ca4292fa2fc122854f

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