Clishortener
A lightweight, feature-rich CLI tool to shorten links using 12+ services—with zero configuration required.
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_paramis used when determining if a service requires an api keyurl_paramis 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.jsonAnd 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clishortener-0.0.1.tar.gz.
File metadata
- Download URL: clishortener-0.0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45f024c709cdce02da29ee3f7c01a1ce602fb57da5702ab2971a7ba041bf3e5e
|
|
| MD5 |
52303eb52e3812ed5689f58e45f17b22
|
|
| BLAKE2b-256 |
15595e595d62d36f7d8440f76a43155ab1b46015b82a4938bf8bc0383c8c8d1e
|
File details
Details for the file clishortener-0.0.1-py3-none-any.whl.
File metadata
- Download URL: clishortener-0.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
098b0d93b4e25a6a1511af9517670b889972dae5957689d19f0ebf9bb779984d
|
|
| MD5 |
bc5ecd94c931103e84cd2e73282c703d
|
|
| BLAKE2b-256 |
29448fab70053f1d810b74ee136ef37f57e55c11c6403f51c27da4f68a272cf9
|