Skip to main content

Clishortener

A lightweight, feature-rich CLI tool to shorten links using 12+ services—with zero configuration required.

PyPI version


Key Features

  • 🚀 Lightweight & Fast: Works right out of the terminal.
  • 🔌 12+ Services Pre-configured: TinyURL, Bitly, Short.io, CleanURI, and more.
  • 🛠️ Custom & Self-Hosted: Full support for custom domains and YOURLS instances.
  • 🎨 Rich Output: Optional colorful terminal UI using rich.
  • Pipeline Friendly: Pass raw output directly to stdout or other scripts using bare/silent flags.
  • 🕹 Plug & Play Start shortening immediately after installation, no setup required.

Installation

Install using pip

pip install clishortener[rich]

Or Install from source using git

git clone https://github.com/Ruizennis/Clishortener
cd Clishortener
pip install .

Optional Packages

  • rich

Things Enhanced With rich Installed:

  • Available Services menu
  • Change default service menu
  • Link Output
  • Error messages

Quick Start 🚀

Shorten your first url ✂️

cshorten https://example.com

Set your preferred service as the default 🔧

# See All Services list for Identifiers!
cshorten -d dagd

All Services 🌐

Service Identifier Requires key
tinyurl tinyurl-auth / tinyurl-noauth Optional
is.gd isgd No
v.gd vgd No
da.gd dagd No
cleanuri cleanuri No
ulvis ulvis No
short.io shortio Yes
clck.ru clckru No
bit.ly bitly Yes
cutt.ly cuttly Yes
0x0.st 0x0 No
YOURLS yourls Optional
Custom custom Optional

Note: As Of 2026-08-01 The Public 0x0.st Instance Is Temporarily Paused With No ETA For Its Return, Self Hosting is recomended. Self-host The Null Pointer (0x0) From https://git.0x0.st/mia/0x0

Flags 🚩

Flag Long Flag Purpose Usage
-a --available Shows available services cshorten -a
-s --service Allows specifying service for a command cshorten -s cleanuri https://example.com
-d --change-default-service Allows changing the default service cshorten -d dagd
-b --bare Remove rich formatting and write to stdout without formatting cshorten -b https://example.com >> links.txt
-k --key Allows setting an api key for services that require it cshorten https://example.com/ -s yourls -k KEY -D https://yourls.org
-h --help Shows help menu cshorten -h
-S --silent Silences all logging messages cshorten https://example.com -b -S >> links.txt
-D --domain Allows setting a custom domain to connect to (yourls / custom only) cshorten -s custom -D https://example.com
-A --auth-parameter Allows setting auth_param for use with non standard services (YOURLS / custom only) cshorten -s custom -D https://example.com -A key
-U --url-parameter Allows setting url_param for use with non-standard services (YOURLS / custom only) cshorten -s custom -D https://example.com -A key -U url
-H --header Allows setting custom header information for use with header based authentication services (bit.ly, short.io) cshorten "https://example.com" -s bitly -k "Key" -H "X-Custom-Header: CustomValue"

Additional Information 📜

  • Default URL shortening service is tinyurl (no key / anonymous)
  • Identifier is used when specifying a specific link shortening service with -s or -d
  • YOURLS is self-hosted only
  • Custom & YOURLS allows any URL to be used
  • When using Custom or YOURLS use the full URL
  • Commands considered "advanced" are uppercase (-A -U -D -S -H)
  • auth_param is used when determining if a service requires an api key
  • url_param is what variable is used when sending a request (Default: "url")
  • Custom headers should be sent in a key, value format
  • --domain allows any URL to be used

Adding Additional Services 🔨

Additional Services Can Be Added By Editing Services.json And Adding New Entries.

Anonymous Service Example (da.gd)

"dagd": {
        "serviceurl": "https://da.gd/s",
        "method": "GET",
        "params": {
            "url": ""
        }
    }

Authenticated API Example (short.io)

"shortio": {
        "serviceurl": "https://api.short.io/links/public",
        "auth_header": "authorization",
        "url_param": "originalURL",
        "method": "POST",
        "json_key": "shortURL",
        "json_body": true,
        "params": {}
}

Additional Links & Credits

Pypi - clishortener Github - Clishorteners Issues - Clishorteners

Credits To Pyshorteners Made By ellisonleao For Inspiring This Tool Pyshorteners


License

This project is licensed under the MIT license, see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clishortener-0.0.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clishortener-0.0.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file clishortener-0.0.2.tar.gz.

File metadata

  • Download URL: clishortener-0.0.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for clishortener-0.0.2.tar.gz
Algorithm Hash digest
SHA256 84efbc78a2ce872d70cc2da7f68e512e18169fa6b87e3eaece375a57a9865613
MD5 793cd16ed5bd956a53537852e80b678f
BLAKE2b-256 755401b9056a699e09f5e66dcd4a7615ab026f69904f140f1927d2b87a5810bc

See more details on using hashes here.

File details

Details for the file clishortener-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: clishortener-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for clishortener-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abe8fb3d2c00d625a430671813f1d35af5e716f30979b7f953fdca6763b600dd
MD5 862846efb653ec576a8f2ce09c540d35
BLAKE2b-256 cbd42688f4c518d8b616f8cc5c51d1b992f6766763f6b03e366672f5c6cf8315

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page