vercel-source-downloader
v3.0.1
Published
Download source code from Vercel deployments
Downloads
60
Maintainers
Readme
🚀 Vercel Source Downloader
Download source code from any Vercel deployment in seconds
⚡ Quick Start
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
🎯 Why Use This?
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.
📸 Demo
$ 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🛠️ Setup
1️⃣ Get Your Vercel Token
- Visit Vercel Tokens
- Click "Create Token"
- Give it a name and copy the token
2️⃣ Set Your 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.app3️⃣ Download Your Deployment
npx vercel-source-downloader your-app.vercel.app📚 Usage Examples
Basic Download
# Download to folder named after the deployment
npx vercel-source-downloader my-app.vercel.appCustom Destination
# Download to specific folder
npx vercel-source-downloader my-app.vercel.app ./backup-folderUsing Deployment ID
# From Vercel dashboard URL or API
npx vercel-source-downloader dpl_FhQJMKpXXXXXXXXXXXXXXXXXPreview Deployments
# Download PR preview or branch deployment
npx vercel-source-downloader my-app-git-feature-xyz.vercel.appTeam Deployments
# Set team ID in .env or inline
VERCEL_TEAM=team_xxx npx vercel-source-downloader team-app.vercel.app🎨 Features
| 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 |
🚨 Troubleshooting
Make sure you've set your token:
echo "VERCEL_TOKEN=your_token_here" > .env- 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
Some deployments might not have source files. This tool downloads the /src directory from the deployment.
The tool downloads files in parallel, but large projects may take time. Check your internet connection.
🔒 Security Best Practices
- 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
🤝 Contributing
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
📝 License
MIT © William Kasel
🙏 Credits & Acknowledgments
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.
🆕 Key Improvements Over Original
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.
📮 Support
⭐ Show Your Support
If this tool helped you, please consider giving it a star on GitHub!
