Download source code from any Vercel deployment in seconds
No installation needed! Just run:
npx vercel-source-downloader your-app.vercel.appThat's it! Your deployment source code will be downloaded to a local folder.
๐ฆ View on npm | ๐ View on GitHub
Ever needed to:
- ๐ฆ Backup a deployment before making changes?
- ๐ Recover source code when local files are lost?
- ๐ Debug production by getting the exact deployed code?
- ๐ Migrate projects between accounts?
- ๐ Audit what's actually deployed vs what's in git?
This tool makes it simple.
$ npx vercel-source-downloader my-app.vercel.app
โ Getting deployment id
โ Loading source files tree
โ Downloading ./my-app/components/ui/button.tsx
โ Downloading ./my-app/app/page.tsx
โ Downloading ./my-app/lib/utils.ts
...
โ Successfully downloaded source code to my-app
โ Total files: 116
โ Total directories: 23- Visit Vercel Tokens
- Click "Create Token"
- Give it a name and copy the token
Option A: Create a .env file (recommended)
VERCEL_TOKEN=your_token_here
VERCEL_TEAM=team_xxx # Optional, for team deploymentsOption B: Use environment variable
export VERCEL_TOKEN=your_token_hereOption C: Pass inline
VERCEL_TOKEN=your_token npx vercel-source-downloader app.vercel.appnpx vercel-source-downloader your-app.vercel.app# Download to folder named after the deployment
npx vercel-source-downloader my-app.vercel.app# Download to specific folder
npx vercel-source-downloader my-app.vercel.app ./backup-folder# From Vercel dashboard URL or API
npx vercel-source-downloader dpl_FhQJMKpXXXXXXXXXXXXXXXXX# Download PR preview or branch deployment
npx vercel-source-downloader my-app-git-feature-xyz.vercel.app# Set team ID in .env or inline
VERCEL_TEAM=team_xxx npx vercel-source-downloader team-app.vercel.app| Feature | Description |
|---|---|
| ๐ No Install | Run directly with npx |
| โก Fast Downloads | Parallel file downloads |
| ๐ Structure Preserved | Maintains exact folder structure |
| ๐ Skip Existing | Won't re-download existing files |
| ๐ Progress Indicators | See download progress for each file |
| ๐ฏ Smart Detection | Auto-detects deployment IDs vs URLs |
| ๐ฅ Team Support | Works with team deployments |
| ๐จ Beautiful Output | Color-coded, clear feedback |
Error: "Missing VERCEL_TOKEN"
Make sure you've set your token:
echo "VERCEL_TOKEN=your_token_here" > .envError: "Deployment not found"
- Check you have access to the deployment
- For team deployments, set
VERCEL_TEAM - Try using the deployment URL instead of ID
- Ensure you're using the correct Vercel account token
Error: "No 'src' directory found"
Some deployments might not have source files. This tool downloads the /src directory from the deployment.
Downloads are slow
The tool downloads files in parallel, but large projects may take time. Check your internet connection.
- Never commit
.envfiles - Add to.gitignore - Use read-only tokens when possible
- Rotate tokens regularly
- Set token expiration in Vercel dashboard
- Use environment variables in CI/CD
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT ยฉ William Kasel
This project was inspired by zehfernandes/get-vercel-source-code. While that repository provided the initial concept and approach, this is a complete rewrite with significant enhancements.
This modern implementation includes:
- โจ NPX support for instant usage without installation
- ๐จ Enhanced CLI with colored output and progress indicators
- ๐ Better error handling and user feedback
- ๐ Support for Vercel dashboard IDs
- ๐ Comprehensive documentation
- ๐ Parallel downloads for improved speed
- ๐ฅ Team deployment support
Special thanks to Zeh Fernandes for the original concept that inspired this project.
- ๐ Report Issues
- ๐ก Request Features
- ๐ง Contact
If this tool helped you, please consider giving it a star on GitHub!
Made with โค๏ธ for the Vercel community