CLI tool that lets you download specific folders from GitHub repositories without cloning the entire repo.
npm install git-ripperbash
npm install -g git-ripper
`
This installs Git-ripper as a global command-line tool accessible from anywhere in your terminal.
$3
`bash
npx git-ripper
`
Run Git-ripper directly without installation using npx.
Usage
$3
`bash
git-ripper https://github.com/username/repository/tree/branch/folder
`
$3
`bash
git-ripper https://github.com/username/repository/tree/branch/folder -o ./my-output-folder
`
$3
`bash
git-ripper https://github.com/username/repository/tree/branch/folder --zip
`
$3
`bash
git-ripper https://github.com/username/repository/tree/branch/folder --zip="my-archive.zip"
`
$3
| Option | Description | Default |
| -------------------------- | ---------------------------------------- | ----------------- | --- | -------------------------- | ------------------------- | --- |
| -o, --output | Specify output directory | Current directory |
| --gh-token | GitHub Personal Access Token | - |
| --zip [filename] | Create ZIP archive of downloaded content | - |
| --no-resume | Disable resume functionality | - |
| --force-restart | Ignore existing checkpoints and restart | - |
| --list-checkpoints | List all saved download checkpoints | - | | config set-token | Save GitHub token locally | - |
| config get-token | Show saved token (masked) | - |
| config remove-token | Remove saved token | - |
| config show | Show current configuration | - | | -V, --version | Show version number | - |
| -h, --help | Show help | - |
Authentication (Private Repositories & Rate Limits)
To download from private repositories or to increase your API rate limit, you need to provide a GitHub Personal Access Token (PAT).
$3
You can use either a Fine-grained token (Recommended) or a Classic token.
#### Option A: Fine-grained Token (Recommended)
1. Go to Settings > Developer settings > Personal access tokens > Fine-grained tokens.
2. Click Generate new token.
3. Name it (e.g., "Git-ripper").
4. Resource owner: Select your user.
5. Repository access: Select Only select repositories and choose the private repository you want to download from.
6. Permissions:
- Click on Repository permissions.
- Find Contents and change Access to Read-only.
- _Note: Metadata permission is selected automatically._
7. Click Generate token.
#### Option B: Classic Token
1. Go to Settings > Developer settings > Personal access tokens > Tokens (classic).
2. Click Generate new token > Generate new token (classic).
3. Give your token a descriptive name.
4. Select Scopes:
- For Private Repositories: Select the repo scope (Full control of private repositories).
5. Click Generate token.
$3
#### Option 1: Save Token Locally (Recommended)
Save your token once and use it automatically for all future downloads:
`bash
Save the token
git-ripper config set-token ghp_YourTokenHere
Now just download - token is used automatically
git-ripper https://github.com/username/private-repo/tree/main/src
`
#### Option 2: Environment Variable
Set the GIT_RIPPER_TOKEN environment variable:
`bash
Windows (PowerShell)
$env:GIT_RIPPER_TOKEN = "ghp_YourTokenHere"
Linux/Mac
export GIT_RIPPER_TOKEN="ghp_YourTokenHere"
Then download
git-ripper https://github.com/username/private-repo/tree/main/src
`
#### Option 3: Command Line Flag
Pass the token using the --gh-token flag:
`bash
git-ripper https://github.com/username/private-repo/tree/main/src --gh-token ghp_YourTokenHere
`
#### Token Priority
When multiple tokens are available, git-ripper uses this priority:
1. --gh-token command line flag (highest)
2. GIT_RIPPER_TOKEN environment variable
3. Saved token from config set-token
#### Managing Saved Tokens
`bash
View current configuration
git-ripper config show
View saved token (masked)
git-ripper config get-token
Remove saved token
git-ripper config remove-token
`
> Security Note: Be careful not to share your token or commit it to public repositories.
Examples
$3
`bash
Download React DOM package
git-ripper https://github.com/facebook/react/tree/main/packages/react-dom
`
$3
`bash
Extract VS Code build configuration
git-ripper https://github.com/microsoft/vscode/tree/main/build -o ./vscode-build-config
`
$3
`bash
Get Node.js documentation
git-ripper https://github.com/nodejs/node/tree/main/doc -o ./node-docs
`
$3
`bash
Extract Tailwind components
git-ripper https://github.com/tailwindlabs/tailwindcss/tree/master/src/components -o ./tailwind-components
`
$3
`bash
Download from a private repository using a token
git-ripper https://github.com/my-org/private-project/tree/main/src --gh-token ghp_abc123...
`
$3
`bash
Download React DOM package and create a ZIP archive
git-ripper https://github.com/facebook/react/tree/main/packages/react-dom --zip
Extract VS Code build configuration with custom archive name
git-ripper https://github.com/microsoft/vscode/tree/main/build --zip="vscode-build.zip"
`
Resume Downloads
Git-ripper now supports resuming interrupted downloads, making it perfect for large folders or unstable network connections.
$3
`bash
Start a download
git-ripper https://github.com/microsoft/vscode/tree/main/src/vs/workbench
If interrupted (Ctrl+C, network issues, etc.), simply run the same command again
git-ripper https://github.com/microsoft/vscode/tree/main/src/vs/workbench
It will automatically resume from where it left off
`
$3
`bash
Ignore any existing progress and start fresh
git-ripper https://github.com/microsoft/vscode/tree/main/src/vs/workbench --force-restart
`
$3
`bash
Use traditional behavior without resume functionality
git-ripper https://github.com/microsoft/vscode/tree/main/src/vs/workbench --no-resume
`
$3
`bash
List all saved download progress
git-ripper --list-checkpoints
Output shows:
1. ID: a1b2c3d4
URL: https://github.com/microsoft/vscode/tree/main/src/vs/workbench
Progress: 45/120 files
Last Updated: 2025-06-04T10:30:00Z
`
$3
- Automatic Progress Saving: Downloads are checkpointed every few files
- File Integrity Verification: Ensures existing files are complete and valid
- Smart Recovery: Detects corrupted or incomplete files and re-downloads them
- Multi-Download Support: Manage multiple concurrent download projects
- Progress Indicators: Visual feedback showing completed vs remaining files
How It Works
Git-ripper operates in five stages:
1. URL Parsing: Extracts repository owner, name, branch, and target folder path
2. Resume Check: Looks for existing download progress and validates already downloaded files
3. API Request: Uses GitHub's API to fetch the folder structure
4. Content Download: Retrieves each file individually while maintaining directory structure and saving progress
5. Local Storage or Archiving: Saves files to your specified output directory or creates an archive
The resume functionality uses checkpoint files stored in .git_ripper_checkpoints/ to track download progress, file integrity hashes, and metadata for each download session.
Configuration
Git-ripper works out of the box without configuration. For rate-limited GitHub API usage or private repositories, use the --gh-token option as described in the Authentication section.
Troubleshooting
$3
#### Rate Limit Exceeded
`
Error: Request failed with status code 403
`
Solution: GitHub limits unauthenticated API requests. You can either:
1. Wait a few minutes and try again
2. Use the --gh-token option with a Personal Access Token to significantly increase your rate limit
#### Invalid URL Format
`
Error: Invalid GitHub URL format
`
Solution: Ensure your URL follows the pattern: https://github.com/owner/repo/tree/branch/folder
#### Folder Not Found
`
Error: Path not found in repository
`
Solution: Verify the folder path exists in the specified branch and repository.
#### Resume Issues
If you encounter problems with resume functionality:
`bash
Clear all checkpoints and start fresh
git-ripper https://github.com/owner/repo/tree/branch/folder --force-restart
Or disable resume entirely
git-ripper https://github.com/owner/repo/tree/branch/folder --no-resume
`
#### Corrupted Download
If files appear corrupted after resume:
`bash
Force restart will re-download everything
git-ripper https://github.com/owner/repo/tree/branch/folder --force-restart
`
The resume feature automatically detects and re-downloads corrupted files, but --force-restart ensures a completely clean download.
Contributing
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions to Git-ripper are greatly appreciated.
1. Fork the repository
2. Create your feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)