Code Monkey home page Code Monkey logo

codemerge's Introduction

codemerge

codemerge is a simple, yet powerful command-line tool for merging all your code files into a single JSON file. This tool is especially handy for developers who need to aggregate source code from various files for analysis, backup, or documentation purposes.

Screenshot 2023-12-31 at 9 51 12 PM

Features

  • Easy to Use: Run codemerge in any directory to merge your code files.
  • Customizable: Exclude specific files or directories.
  • Comprehensive: Supports various code file types.
  • Interactive Prompts: Guided experience using inquirer.js.

Why It's Useful?

  • GPT Builders: By merging code into a single JSON, codemerge simplifies the process of using code repositories for training AI models, such as GPT. This can be invaluable for understanding large codebases or for building AI-powered coding assistants.

Usage

Run the tool in the directory where your code files are located:

npx codemerge

Upon running, codemerge will:

  1. Prompt you to enter the path to the directory (or use the current directory by default).
  2. Ask for comma-separated file names or directories that you want to exclude (e.g., node_modules, .env).

The tool will then generate a merged_code_files.json file in your current directory containing the contents of all your code files, formatted as an array of objects with path and content keys.

Output Format

The output JSON file will have the following format:

[
  {
    "path": "/path/to/file1.js",
    "content": "code content here..."
  },
  {
    "path": "/path/to/file2.py",
    "content": "code content here..."
  }
  // ... more files
]

Supported File Types

codemerge supports various code file types, including but not limited to .js, .py, .html, .css. Feel free to extend this as per your requirements.

Contributing

Contributions are welcome! If you have a suggestion or fix, please open a pull request or issue in the repository.

License

codemerge is open-sourced software licensed under the MIT license.

codemerge's People

Contributors

sidmohanty11 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.