New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

shortenit-cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shortenit-cli

CLI tool for Shortenit URL shortener

latest
Source
npmnpm
Version
1.1.5
Version published
Maintainers
1
Created
Source

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

Display the most 10 recent shortened links:

shortenit list

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

Keywords

url-shortener

FAQs

Package last updated on 18 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts