npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

shortenit-cli

v1.1.5

Published

CLI tool for Shortenit URL shortener

Readme

Shortenit CLI

A command-line interface tool for the Shortenit URL shortener service. Create shortened URLs, expand them back to original URLs, and generate QR codes - all from your terminal.

Features

  • Shorten URLs - Create shortened links with optional custom aliases
  • Expand URLs - Retrieve original URLs from shortened links
  • Edit URLs - Update title, alias, expiration, or status of shortened links
  • Delete URLs - Delete shortened links
  • List URLs - List shortened links
  • Expiration Control - Set custom expiration periods for your links
  • QR Code Generation - Generate QR codes in terminal or save as PNG files
  • Configuration Management - Easy setup and configuration management
  • Beautiful CLI - Colored output and loading indicators for better UX

Installation

From NPM

npm install -g shortenit-cli

From Source

# Clone the repository
git clone https://github.com/shortenit/shortenit-cli
cd shortenit-cli

# Install dependencies
npm install

# Build the project
npm run build

# Link globally (optional)
npm link

Configuration

On first run, the CLI will prompt you to configure your backend URL and API Key:

shortenit

Or manually configure:

shortenit config

Configuration Commands

  • shortenit config - Setup or update configuration
  • shortenit config --show - Display current configuration
  • shortenit config --reset - Reset configuration

The configuration is stored locally using conf and persists between sessions.

Usage

Shorten a URL

Basic usage:

shortenit short https://example.com/very/long/url

With custom alias:

shortenit short https://example.com --custom-alias my-link

With expiration (in days):

shortenit short https://example.com --expiration-days 7

Generate QR code in terminal:

shortenit short https://example.com --print-qr

Save QR code to Downloads folder:

shortenit short https://example.com --save-qr

Combine multiple options:

shortenit short https://example.com \
  --custom-alias my-link \
  --expiration-days 30 \
  --print-qr \
  --save-qr

Expand a URL

Retrieve the original URL from a shortened link:

shortenit expand abc123

Or with full URL:

shortenit expand https://short.link/abc123

Delete a URL

Basic usage:

shortenit delete abc123

Or with full URL:

shortenit delete https://short.link/abc123

Delete without confirmation:

shortenit delete https://short.link/abc123 --force

Edit a URL

Update the title:

shortenit edit abc123 --title "New Title"

Change the custom alias:

shortenit edit abc123 --custom-alias newcode

Update expiration:

shortenit edit abc123 --expiration-days 30

Remove expiration:

shortenit edit abc123 --clear-expiration

Deactivate a link:

shortenit edit abc123 --inactive

Reactivate a link:

shortenit edit abc123 --active

Combine multiple updates:

shortenit edit abc123 --title "Updated Title" --expiration-days 60 --active

List recent links

Display the most 10 recent shortened links:

shortenit list

List all links

Display all the shortened links:

shortenit list-all

Help

View all available commands:

shortenit --help

View help for a specific command:

shortenit short --help
shortenit expand --help

Commands Reference

short <url>

Create a shortened link.

Options:

  • -c, --custom-alias <string> - Custom alias for the short URL
  • -e, --expiration-days <number> - Number of days until expiration
  • -p, --print-qr - Print QR code to terminal
  • -s, --save-qr - Save QR code to Downloads folder

expand <url>

Get the original URL from a shortened link.

delete <url>

Delete a shortened link.

Options:

  • -f, --force - Force deletion without confirmation

edit <url>

Edit a shortened link.

Options:

  • -t, --title <string> - Update the title
  • -c, --custom-alias <string> - Update the custom alias
  • -e, --expiration-days <number> - Update expiration days
  • --clear-expiration - Remove expiration date
  • --active - Set link as active
  • --inactive - Set link as inactive

list

List 10 recent shortened links.

list-all

List all shortened links.

config

Manage configuration settings.

Options:

  • --reset - Reset configuration
  • --show - Show current configuration

Development

Project Structure

shortenit-cli/
├── src/
│   ├── index.ts                 # Main entry point
│   ├── commands/
│   │   ├── ShortCommand.ts      # URL shortening command
│   │   ├── ExpandCommand.ts     # URL expansion command
│   │   ├── EditCommand.ts       # URL editing command
│   │   ├── DeleteCommand.ts     # URL deletion command
│   │   └── ListCommand.ts       # URL listing command
│   ├── config/
│   │   └── ConfigManager.ts     # Configuration management
│   └── services/
│       ├── ApiService.ts        # API communication
│       └── QRCodeService.ts     # QR code generation
├── package.json
├── tsconfig.json
└── README.md

Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run dev - Run in development mode with ts-node
  • npm start - Run the compiled JavaScript

Dependencies

Runtime:

  • commander - CLI framework
  • axios - HTTP client for API calls
  • chalk - Terminal string styling
  • inquirer - Interactive command-line prompts
  • ora - Terminal spinners
  • qrcode - QR code generation
  • qrcode-terminal - QR code display in terminal
  • conf - Configuration management
  • table - Table formatting for displaying URL lists

Development:

  • typescript - TypeScript compiler
  • @types/node - Node.js type definitions
  • @types/qrcode - QRCode type definitions
  • @types/qrcode-terminal - QRCode Terminal type definitions

License

MIT

Contributors


Made with ❤️ for the Shortenit project