Crates.io | copyrepo |
lib.rs | copyrepo |
version | 0.1.0 |
source | src |
created_at | 2024-09-14 11:34:26.743537 |
updated_at | 2024-09-14 11:34:26.743537 |
description | A tool to fetch and save the contents of a GitHub folder for ingestion into LLMs |
homepage | https://github.com/vacekj/copyrepo |
repository | https://github.com/vacekj/copyrepo |
max_upload_size | |
id | 1374692 |
size | 18,228 |
A Rust command-line tool to fetch and save the contents of a GitHub folder, specifically designed for ingestion into Large Language Models (LLMs).
This tool allows you to easily download the contents of a specific folder from a GitHub repository. It clones the repository, extracts the contents of the specified folder, and saves them to a local file in a designated output directory. The output is formatted to include file names and paths, making it ideal for ingestion into LLMs.
You can install copyrepo
using Cargo, the Rust package manager. If you don't have Rust installed, you can get it from https://www.rust-lang.org/.
To install copyrepo
, run the following command:
cargo install copyrepo
This will download and install the latest version of copyrepo
from crates.io.
Basic usage:
copyrepo <GITHUB_FOLDER_URL>
Example:
copyrepo https://github.com/penumbra-zone/web/tree/main/packages/ui
This will create a file in the output directory (default: "output") containing the contents of all files in the specified folder, with each file's content prefixed by its name and path.
Options:
-t, --timeout <SECONDS>
: Set the timeout for the git clone operation (default: 5 seconds)-o, --output-dir <DIR>
: Specify the output directory (default: "output")For more information, use the --help
flag:
copyrepo --help
The tool generates a single text file with the following format for each file in the specified GitHub folder:
File: path/to/file1.ext
[Contents of file1]
File: path/to/file2.ext
[Contents of file2]
...
This format ensures that LLMs can easily distinguish between different files and their contents, preserving the structure of the original GitHub folder.
This project is licensed under the MIT License. See the LICENSE file for details.
Josef Vacek
Contributions are welcome! Please feel free to submit a Pull Request on the GitHub repository: https://github.com/vacekj/copyrepo
If you encounter any problems or have suggestions, please file an issue on the GitHub issue tracker: https://github.com/vacekj/copyrepo/issues