Repo Copy CLI is a powerful command-line tool designed to streamline the process of extracting code from Git repositories for developers working with large language models (LLMs) like ChatGPT. This tool ensures that all relevant code is collected into a single file, adhering to .gitignore
settings, and provides extensive statistics to aid in data understanding and model training.
- Efficient Code Extraction 🚀: Extracts code while ignoring files specified in
.gitignore
. - Single File Output 📄: Outputs all extracted code into a
codebase.txt
, facilitating easier context management for LLMs. - Codebase Statistics 📊: Provides detailed insights, including:
- Total number of files 🗂️
- Total number of lines 📃
- Total number of words 📝
- Total number of characters 🔠
- Distribution of programming languages by file extensions 💻
- Total number of tokens 🔤
- Estimated number of requests needed to process the codebase with LLMs (assuming 4,096 tokens per request) 🤖
- Clipboard Integration 📋: Automatically copies the
codebase.txt
contents to the clipboard.
- Download the
repo-copy
binary for macOS from the GitHub Releases page. - Open a terminal and navigate to the directory where you downloaded the binary.
- Move the binary to a directory in your system's
PATH
, for example,/usr/local/bin
: sudo mv repo-copy /usr/local/bin/ - Make the binary executable: sudo chmod +x /usr/local/bin/repo-copy
- You can now run the CLI from any directory by typing
repo-copy
in the terminal.
- Download the
repo-copy.exe
binary for Windows from the GitHub Releases page. - Move the
repo-copy.exe
file to a directory in your system'sPATH
, e.g.,C:\Windows\System32
. - Open a command prompt and navigate to the directory where you moved the binary.
- You can now run the CLI from any directory by typing
repo-copy
in the command prompt.
- Download the
repo-copy
binary for Linux from the GitHub Releases page. - Open a terminal and navigate to the directory where you downloaded the binary.
- Move the binary to a directory in your system's
PATH
, for example,/usr/local/bin
: sudo mv repo-copy /usr/local/bin/ - Make the binary executable: sudo chmod +x /usr/local/bin/repo-copy
- You can now run the CLI from any directory by typing
repo-copy
in the terminal.
- Open a terminal (or command prompt on Windows) and navigate to the root directory of your Git repository.
- Run the following command: repo-copy
- The CLI will process the files, ignoring those specified in the
.gitignore
. It then generates acodebase.txt
file in the current directory and copies its contents to the clipboard. - After processing, the CLI displays the detailed statistics about the codebase.
This project is licensed under the MIT License. See the LICENSE
file for more details.