π A powerful command-line tool to expand shortened URLs to their final destination, with built-in Cloudflare bypass support.
- π Fast & Efficient - Uses native Node.js HTTP modules for lightning-fast URL expansion
- π‘οΈ Cloudflare Bypass - Automatically handles Cloudflare-protected shorteners (shorturl.at, etc.)
- π Multiple URLs - Expand multiple shortened URLs in one command
- π Verbose Mode - View detailed information including status codes and redirect counts
- π¨ Beautiful Output - Color-coded, easy-to-read terminal output
- β‘ Zero Dependencies - Core functionality uses only native Node.js modules
- π§ Configurable - Customize timeout and redirect limits
Using pnpm:
pnpm add -g expandurl-cliUsing npm:
npm install -g expandurl-cliUsing yarn:
yarn global add expandurl-cliTo enable browser fallback for Cloudflare-protected shorteners:
pnpm add -g expandurl-cli
npx playwright install chromiumExpand a single shortened URL:
expandurl https://bit.ly/exampleExpand multiple URLs at once:
expandurl https://bit.ly/example https://tinyurl.com/example https://shorturl.at/abc123Get detailed information with status codes and redirect counts:
expandurl --verbose https://bit.ly/exampleOr use the shorthand:
expandurl -v https://bit.ly/exampleSet custom timeout (in milliseconds):
expandurl --timeout 5000 https://bit.ly/exampleSet maximum redirect limit:
expandurl --max-redirects 5 https://bit.ly/exampleCombine options:
expandurl -v -t 15000 -m 20 https://bit.ly/example| Option | Alias | Description | Default |
|---|---|---|---|
--timeout <ms> |
-t |
Request timeout in milliseconds | 10000 |
--max-redirects <count> |
-m |
Maximum redirects to follow | 10 |
--verbose |
-v |
Show status code and redirect count | false |
--sponsor |
-s |
Show sponsor information | - |
--version |
-V |
Show version number | - |
--help |
-h |
Show help information | - |
- Native HTTP/HTTPS - Primary method using Node.js built-in modules for fast URL expansion
- Redirect Following - Automatically follows HTTP redirects (301, 302, 307, 308)
- Cloudflare Detection - Detects 403 responses from Cloudflare-protected URLs
- Browser Fallback - Automatically switches to headless browser for Cloudflare bypass when needed
- Error Handling - Graceful error handling with helpful error messages
Works with most URL shorteners including:
- β bit.ly
- β tinyurl.com
- β shorturl.at (Cloudflare-protected)
- β t.co
- β ow.ly
- β is.gd
- β buff.ly
- β And many more!
Example 1: Basic URL expansion
$ expandurl https://bit.ly/3xample
https://bit.ly/3xample β https://github.com/warengonzaga/expandurl-cliExample 2: Verbose mode with details
$ expandurl -v https://bit.ly/3xample
https://bit.ly/3xample β https://github.com/warengonzaga/expandurl-cli (status: 200, redirects: 1)Example 3: Multiple URLs
$ expandurl https://bit.ly/example1 https://tinyurl.com/example2
https://bit.ly/example1 β https://github.com/user/repo1
https://tinyurl.com/example2 β https://example.com/pageExample 4: Cloudflare-protected URL
$ expandurl https://shorturl.at/abc123
https://shorturl.at/abc123 β https://destination-url.comContributions are welcome! Please read our Contributing Guidelines before submitting a pull request.
- Fork the repository
- Create a feature branch from
dev:git checkout -b feature/your-feature dev - Make your changes
- Test your changes:
node bin/expandurl.js <test-url> - Commit using Clean Commit convention
- Push to your fork and submit a pull request to the
devbranch
This project is licensed under the ISC License - see the LICENSE file for details.
Waren Gonzaga
- Website: warengonzaga.com
- GitHub: @warengonzaga
- Twitter: @warengonzaga
Love this project? Consider sponsoring me on GitHub to support continued development!
- Built with native Node.js modules for maximum performance
- Commander.js for CLI framework
- Chalk for beautiful terminal output
- Figlet for ASCII art
- Playwright for Cloudflare bypass capability
Made with β€οΈ by Waren Gonzaga