Skip to content

Wkasel/vercel-source-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Vercel Source Downloader

Download source code from any Vercel deployment in seconds

npm version npm downloads License: MIT GitHub issues PRs Welcome

โšก Quick Start

No installation needed! Just run:

npx vercel-source-downloader your-app.vercel.app

That'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

  1. Visit Vercel Tokens
  2. Click "Create Token"
  3. 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 deployments

Option B: Use environment variable

export VERCEL_TOKEN=your_token_here

Option C: Pass inline

VERCEL_TOKEN=your_token npx vercel-source-downloader app.vercel.app

3๏ธโƒฃ 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.app

Custom Destination

# Download to specific folder
npx vercel-source-downloader my-app.vercel.app ./backup-folder

Using Deployment ID

# From Vercel dashboard URL or API
npx vercel-source-downloader dpl_FhQJMKpXXXXXXXXXXXXXXXXX

Preview Deployments

# Download PR preview or branch deployment
npx vercel-source-downloader my-app-git-feature-xyz.vercel.app

Team 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

Error: "Missing VERCEL_TOKEN"

Make sure you've set your token:

echo "VERCEL_TOKEN=your_token_here" > .env
Error: "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.

๐Ÿ”’ Security Best Practices

  1. Never commit .env files - Add to .gitignore
  2. Use read-only tokens when possible
  3. Rotate tokens regularly
  4. Set token expiration in Vercel dashboard
  5. Use environment variables in CI/CD

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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!

GitHub stars


Made with โค๏ธ for the Vercel community

Powered by Vercel

About

Download source code from any Vercel deployment in seconds

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors