A tool for merging code files into a single markdown document.
Project description
code-merger
🚀 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file code_merger-1.0.2.tar.gz
.
File metadata
- Download URL: code_merger-1.0.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e89f19d4627dc4f8b34e2ceaa79ee80d936a48619840ef8f275a50829643390 |
|
MD5 | a67d1a5325f891e094919f4a4a30e4b8 |
|
BLAKE2b-256 | 1637a478bc7be03a9ec77ffa29fc96e5cb2f028cff4d179a13d9e6c4c2a3e94e |
File details
Details for the file code_merger-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: code_merger-1.0.2-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f794c8e0f60c9b4cac6c16d59d02bb8cd6769fe8c8cd896b17065224d15cb954 |
|
MD5 | ea12e51fa2f9fefc6946b6a30a4e668b |
|
BLAKE2b-256 | 04e5e904f1ff406fbc0ededea20a5304b7348cc9b86a7e4437a44fe0ccf1c331 |