Coder Social home page Coder Social logo

repo-analyzer's Introduction

RepoConcat

This tool combines the contents of a GitHub repository into a single text file, making it easier to use with Large Language Models (LLMs). It generates a summary of the project, including a directory tree and concatenated contents of specified files, with the option to prioritize a main file.

Features

  • Repository Summarization: Combines the contents of a GitHub repository into a single text file for easy use with LLMs.
  • Directory Tree Generation: Provides a detailed directory tree structure of the repository.
  • File Concatenation: Concatenates specified files into an output file in the order listed in the configuration file.
  • Main File Prioritization: Prioritizes a specified main file in the output.
  • Hidden Files Inclusion: Optionally includes hidden files and directories.
  • Pattern Matching: Supports wildcard and regex entries for specifying file patterns.
  • Ignore Patterns: Supports excluding files or folders based on specified patterns.
  • Customization: Allows customization of maximum characters, tree depth, and items per directory.

Installation

To install the necessary dependencies, run:

pip install -r requirements.txt

Usage

python main.py [directory] [-m MAIN_FILE] [-c MAX_CHARS] [-t TREE_DEPTH] [-i] [-x MAX_ITEMS] [-n INCLUDE] [-g IGNORE]

Arguments

  • directory (str): The path to the local repository.
  • -m, --main_file (str): The main file to prioritize in the output.
  • -c, --max_chars (int): Maximum number of characters to include in the output file.
  • -t, --tree_depth (int): Maximum depth of the directory tree to include in the output file.
  • -i, --include_hidden: Include hidden files and directories.
  • -x, --max_items (int): Maximum number of items to include in each directory to avoid clutter.
  • -n, --include (str): Path to the configuration file with filename patterns to include in the output.
  • -g, --ignore (str): Path to the configuration file with filename patterns to exclude from the output.

Example

python main.py /path/to/repository -m main.py -c 10000 -t 5 -i -x 100 -n include.txt -g ignore.txt

Configuration Files

Include File

The include file should contain filename patterns to include in the output, one pattern per line. Wildcards and regex entries are supported.

Example include.txt:

*.py
*.md
*.json

Ignore File

The ignore file should contain filename patterns to exclude from the output, one pattern per line. Wildcards and regex entries are supported.

Example ignore.txt:

*.test.py
tests/
docs/

repo-analyzer's People

Contributors

jonm3d avatar github-actions[bot] 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.