A CLI tool to download specific folders from a git repository.

eget dagimg-dot/gitsnip
Download the appropriate binary for your platform from the Releases page.
Extract the binary:
tar -xzf gitsnip_<os>_<arch>.tar.gz
# Option 1: Move to user's local bin (recommended)
mv gitsnip $HOME/.local/bin/
# Option 2: Move to system-wide bin (requires sudo)
sudo mv gitsnip /usr/local/bin/
gitsnip version
Note: For Option 1, make sure
$HOME/.local/binis in your PATH. Addexport PATH="$HOME/.local/bin:$PATH"to your shell's config file (.bashrc, .zshrc, etc.) if needed.
Download the Windows binary (gitsnip_windows_amd64.zip) from the Releases page.
Extract the ZIP file using File Explorer or PowerShell:
Expand-Archive -Path gitsnip_windows_amd64.zip -DestinationPath C:\Program Files\gitsnip
Using System Properties:
sysdm.cpl)C:\Program Files\gitsnipUsing PowerShell (requires admin):
$oldPath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
$newPath = $oldPath + ';C:\Program Files\gitsnip'
[Environment]::SetEnvironmentVariable('Path', $newPath, 'Machine')
gitsnip version
Basic usage:
gitsnip <repo-url> <subdir> <output-dir>
Usage:
gitsnip <repository_url> <folder_path> [output_dir] [flags]
gitsnip [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
version Print the version information
Flags:
-b, --branch string Repository branch to download from (default "main")
-h, --help help for gitsnip
-m, --method string Download method ('api' or 'sparse') (default "sparse")
-p, --provider string Repository provider ('github', more to come)
-q, --quiet Suppress progress output during download
-t, --token string GitHub API token for private repositories or increased rate limits
gitsnip https://github.com/user/repo src/components ./my-components
gitsnip https://github.com/user/repo src/components ./my-components -m api
gitsnip https://github.com/user/repo docs ./docs -b develop
gitsnip https://github.com/user/private-repo config ./config -t YOUR_GITHUB_TOKEN
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
$ claude mcp add gitsnip \
-- python -m otcore.mcp_server <graph>