Skip to content

raphael2692/code-merger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.
  • Ability to skip specified folders.
  • 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] [-s SKIP_FOLDERS]

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 extensions.
  • -f, --filename: Name of the output file. If omitted, the merged content will be copied to the clipboard.
  • -s, --skip-folders: List of folder names to skip during the merge process.

📌 Examples

Merge Specific Extensions

merge -e py js html

Save Merged Content to File

merge -e py js html -f merged_documentation.md

Skip Specific Folders

merge -e py js html -s node_modules .git

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages