Skip to main content

A tool for merging code files into a single markdown document.

Project description

code-merger

Code Merger version license

🚀 Overview

code-merger is a powerful and flexible command-line tool designed to merge files of specified extensions into a single Markdown document. Perfect for pasting your project as a reference to an LLM with a long context (like GPT-4o or Google Gemini) or for generating comprehensive project documentation or combining multiple code files into one easily navigable format.

📜 Features

  • Support for a wide range of file extensions.
  • Automatic generation of project folder structure.
  • File contents are seamlessly merged and formatted in Markdown.
  • Output can be saved to a file or copied directly to the clipboard.

🛠 Installation

Using pip

You can easily install code-merger from PyPI (Python Package Index):

pip install code-merger

From Source

Clone this repository, install via pip using the flag -e to customize it.

git clone https://github.com/your-username/code-merger.git
cd code-merger
pip install -e .

🚀 Usage

code-merger is simple to use right from your command line.

Command-Line Interface

merge [-e EXTENSIONS] [-f FILENAME]

Options

  • -e, --extensions: List of file extensions to merge. Defaults to a comprehensive list of common coding languages. If not specified, scans for all supported exstensions.
  • -f, --filename: Name of the output file. If omitted, the merged content will be copied to the clipboard.

📌 Examples

Merge Specific Extensions

merge -e py js html

Save Merged Content to File

merge -e py js html -f merged_documentation.md

Use Default Extensions and Copy to Clipboard

merge

Supported Extensions

code-merger supports an extensive list of file extensions including but not limited to:

  • Python (.py)
  • JavaScript (.js, .jsx, .tsx, .ts)
  • HTML (.html)
  • CSS (.css, .scss)
  • YAML (.yaml, .yml)
  • JSON (.json)
  • Markdown (.md)
  • C (.c)
  • C++ (.cpp)
  • Java (.java)
  • Ruby (.rb)
  • Go (.go)
  • Rust (.rs)
  • Shell scripts (.sh)
  • Perl (.pl)
  • PHP (.php)
  • Swift (.swift)
  • Kotlin (.kotlin)
  • R (.r)
  • Objective C (.m, .h)

🛡️ License

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

👏 Contributing

We welcome contributions! If you have any ideas, suggestions, or improvements, feel free to open an issue or submit a pull request.

📧 Contact

For any questions, feel free to reach out.



GitHub stars GitHub forks

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

code_merger-1.0.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

code_merger-1.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file code_merger-1.0.1.tar.gz.

File metadata

  • Download URL: code_merger-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for code_merger-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5fc343ce167b44476f36cc422d3ecff6c7bf2a5ebd2a07e77a19fc2fbb4684fc
MD5 1b0912b6a7166bcbfc15bc31b67db0df
BLAKE2b-256 c43c5b429081ba694778e87f0a30df08f29fea6ce29b25d1c1c9aeb740f714e4

See more details on using hashes here.

File details

Details for the file code_merger-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: code_merger-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for code_merger-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b6530604429aace89c56fb571507deec6fb9ebf21e719be3f87ce7d9c6f09b8
MD5 12f382a4974adde3c45baa36268b765c
BLAKE2b-256 fe3a24b69024bc9f56d88bf1e0c365988602ef52e9cc88afb1255ada21106efb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page