Skip to content

joedef/shrtn-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shrtn-cli

Command-line interface for shrtn.dev URL shortener.

Installation

npm install -g shrtn-cli

Requirements

Usage

Authentication

# First, create an API key at https://shrtn.dev/dev/keys

# Log in (requires username, password, AND API key)
shrtn login

# Check current user
shrtn whoami

# Log out
shrtn logout

URL Management

# Create a short link
shrtn shorten https://example.com/long-url

# Create with custom code
shrtn shorten https://example.com -c mycode

# List your links
shrtn list
shrtn list --page 2 --limit 20

# View analytics
shrtn analytics mycode

# Delete a link
shrtn delete mycode
shrtn delete mycode --force  # Skip confirmation

Output Formats

# Human-readable tables (default)
shrtn list

# JSON output (for scripting)
shrtn list --json
shrtn analytics mycode --json

Commands

Command Alias Description
login - Log in and save API key
logout - Clear local credentials
whoami - Show current user info
shorten <url> - Create short link
list ls List your links
analytics <code> stats View link analytics
delete <code> rm Delete a link

Configuration

Credentials are stored in:

  • Windows: %APPDATA%\shrtn-nodejs\Config\config.json
  • macOS: ~/Library/Preferences/shrtn-nodejs/config.json
  • Linux: ~/.config/shrtn-nodejs/config.json

API Key Scopes

When you log in, save an API key with full scope (read + write).

You can create read-only keys at https://shrtn.dev/dev/keys

License

MIT

About

CLI for shrtn.dev URL shortener

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •