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.
- 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.
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.0.tar.gz
.
File metadata
- Download URL: code_merger-1.0.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e4e586d2f8846f4b356c85df1a5f294aff8e4d3febdda9a63fab3c2c7ebcddb |
|
MD5 | 57d479c1b85f11b2c5c0df2b2ba1b507 |
|
BLAKE2b-256 | 8a1b4600f18dc1bb318de6c461bfe40e165a149953551f44e4bbf0dd6b857ebf |
File details
Details for the file code_merger-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: code_merger-1.0.0-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 | a2dc853876dc036f5d62210ea308a332ace81c804482e2328f0dc505a1270926 |
|
MD5 | 76c23803ccafa6980e0ced7620f02949 |
|
BLAKE2b-256 | 4a0afdadfeaaaca9d24419b6a65b974f95e21a1d01efa2f117c837d5bbb52057 |