@tinyurl-ca/cli
v1.0.1
Published
Command-line tool for TinyURL.ca - create and manage short links from your terminal
Downloads
130
Maintainers
Readme
TinyURL.ca CLI
Command-line tool for creating and managing short links from your terminal.
Installation
npm install -g @tinyurl-ca/cliQuick Start
1. Configure your API key
tinyurl config --key YOUR_API_KEYGet your API key from https://tinyurl.ca/dashboard/settings
2. Shorten a URL
tinyurl shorten https://example.comCommands
config
Configure your API key
tinyurl config --key YOUR_API_KEYshorten
Create a new short link
# Basic usage
tinyurl shorten https://example.com
# Custom short code
tinyurl shorten https://example.com --custom my-link
# Add title
tinyurl shorten https://example.com --title "My Website"
# Set expiration (30 days)
tinyurl shorten https://example.com --expires 2592000
# Show QR code
tinyurl shorten https://example.com --qrlist
List your short links
# List 20 most recent links
tinyurl list
# List 50 links
tinyurl list --limit 50get
Get details of a specific link
tinyurl get LINK_ID
# Show with QR code
tinyurl get LINK_ID --qrdelete
Delete a short link
tinyurl delete LINK_ID
# Alias
tinyurl rm LINK_IDstats
Get analytics for a link
tinyurl stats LINK_IDOptions
| Option | Description |
|--------|-------------|
| -k, --key <apiKey> | Your API key |
| -c, --custom <code> | Custom short code |
| -t, --title <title> | Link title |
| -e, --expires <seconds> | Expiration time in seconds |
| -q, --qr | Show QR code |
| -l, --limit <number> | Number of items to display |
Examples
Create a link with custom code
tinyurl shorten https://mywebsite.com --custom promo2024
# → https://tinyurl.ca/promo2024Create temporary link (expires in 1 hour)
tinyurl shorten https://example.com --expires 3600List last 100 links
tinyurl list --limit 100Environment Variables
You can also set your API key via environment variable:
export TINYURL_API_KEY=your_api_key_hereLicense
MIT
Support
- Documentation: https://tinyurl.ca/docs
- Issues: https://github.com/raj-iwt/tinyurl-cli/issues
- Email: [email protected]
