Download any file, folder, or entire repo from GitHub—without git.
You do not need git or GitHub CLI—just Node.js 18+ and npx.
npx gitsnip@latest owner/repo
npx gitsnip@latest https://github.com/owner/repo
npx gitsnip@latest owner/repo/tree/main/path/to/folder
npx gitsnip@latest https://github.com/owner/repo/tree/main/path/to/folder
npx gitsnip@latest owner/repo/blob/main/path/to/file
npx gitsnip@latest https://github.com/owner/repo/blob/main/path/to/file
npx gitsnip@latest owner/repo -b dev
npx gitsnip@latest owner/repo -b 1234abcd
npx gitsnip@latest owner/repo --token <your_github_token>
# Download a public repo as a folder (no .git)
npx gitsnip@latest vercel/next.js
# Download a folder only
npx gitsnip@latest vercel/next.js/tree/canary/packages/next
# Download a single file
npx gitsnip@latest vercel/next.js/blob/canary/packages/next/package.json
# Use a GitHub token for a private repo
npx gitsnip@latest owner/private-repo --token ghp_xxxxxxx
# Specify output directory
npx gitsnip@latest vercel/next.js -o my-folder
Option | Shorthand | Description |
---|---|---|
-o, --out |
Output directory (default: .) | |
-b, --branch |
Branch or commit SHA (default: main) | |
-t, --token |
GitHub token for private repos | |
--force |
Overwrite existing files without prompting |
- Download any public or private file, folder, or repo from GitHub
- Supports branches and commit SHAs
- No git history—just files and folders
- Works without git or GitHub CLI
- Handles most GitHub URLs and short forms
- Overwrite prompt for existing files (
--force
skips prompt)
- Support downloading symlinks
- Support cloning submodules (optionally)
- Add archive (zip/tar) output option
MIT
Enjoy using gitsnip
? Star this repo! ⭐