https://github.com/flaviodelgrosso/gitsnap
A tool to take snapshots of GitHub repositories in a single text file for LLMs
https://github.com/flaviodelgrosso/gitsnap
convert git github llm repository text
Last synced: 10 months ago
JSON representation
A tool to take snapshots of GitHub repositories in a single text file for LLMs
- Host: GitHub
- URL: https://github.com/flaviodelgrosso/gitsnap
- Owner: flaviodelgrosso
- License: mit
- Created: 2025-01-28T22:31:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-25T14:15:45.000Z (about 1 year ago)
- Last Synced: 2025-08-04T12:35:55.264Z (11 months ago)
- Topics: convert, git, github, llm, repository, text
- Language: Rust
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# GitSnap
[![Latest Version]][crates.io]  
[Latest Version]: https://img.shields.io/crates/v/gitsnap.svg
[crates.io]: https://crates.io/crates/gitsnap
GitSnap is a CLI tool to take snapshots of GitHub repositories and convert them into readable text files.
## Description
gitsnap allows you to download a GitHub repository and convert its contents into a single text file. You can specify a file size threshold to skip large files or include all files regardless of size. The tool also supports debug mode for verbose logging.
## Download
You can download the binaries of the latest release from [here](https://github.com/flaviodelgrosso/gitsnap/releases).
## Install from Cargo registry
To install gitsnap, you need to have Rust and Cargo installed. You can install Rust and Cargo from [rustup.rs](https://rustup.rs/).
You can install gitsnap from [crates.io](https://crates.io/crates/gitsnap) using Cargo.
```sh
cargo install gitsnap
```
## Build from source
Alternatively, you can build the project from source.
```sh
git clone
cd gitsnap
cargo build --release
```
## Usage
Run the `gitsnap` command with the required arguments:
```sh
gitsnap [OPTIONS]
```
### Arguments
- `repository`: The GitHub repository URL or user/repo format (e.g., 'user/repo' or ''). This argument is required.
### Options
- `-o, --output `: Specify the output file path (defaults to `repo_name.txt`).
- `-t, --threshold `: Set file size threshold in MB for text conversion (default: 0.1 MB). Files larger than this are skipped unless `--include-all` is used.
- `--include-all`: Include all files, regardless of size or type. Overrides the threshold.
- `--debug`: Enable debug mode with verbose logging.
### Example
```sh
gitsnap user/repo -o output.txt -t 1.0 --debug
```
This command will download the `user/repo` repository, process files up to 1.0 MB, and save the output to `output.txt` with debug mode enabled.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.