Integrations

CLI

Shorten links from your terminal with the official U2L CLI. Install with npm, log in once with your API key, and create, list, and delete links.

The official U2L command line tool. Create short links, list them with click counts, and read stats without leaving your terminal. Zero dependencies, works on macOS, Linux, and Windows with Node.js 18 or newer.

Install

npm install -g @u2l/cli

The installed command is u2l. Verify with:

u2l --version

Log in

Create an API key at Settings → API (available on every plan, including Free), then:

u2l login

Paste the key when prompted. It is validated against your account and stored at ~/.config/u2l/config.json with file permissions 600.

For CI or scripts, skip the stored config entirely by setting an environment variable:

U2L_API_KEY=u2l_live_your_key u2l shorten https://example.com
u2l shorten https://example.com/some/very/long/page
# https://u2l.ai/abc1234

Options:

FlagShortDescription
--slug <slug>-sCustom slug (5-50 characters, letters/numbers/-/_)
--domain <domain>-dShort domain to use (default: auto, the best available)
--title <title>-tTitle shown in your dashboard
--qrCreate as a QR code instead of a short link
u2l shorten https://mysite.com/launch --slug launch24 --title "Launch day"
u2l list
u2l list --search launch --limit 20

Prints your most recent links with click counts and destinations.

Stats

u2l stats              # account totals: links, clicks, this week, limits
u2l stats launch24     # one link: destination, clicks, created date

A bare slug is resolved automatically; the full domain/slug form works too.

u2l delete launch24        # asks for confirmation
u2l delete launch24 --yes  # no prompt (for scripts)

Deletion is permanent.

Log out

u2l logout

Removes the stored key from your machine. You can also revoke the key itself under Settings → API.

Rate limits and errors

The CLI uses your account’s API rate limits. When a limit is hit it prints the wait time from the API’s Retry-After response. Errors are printed as one readable line and exit with code 1, so failures propagate correctly in scripts.

Source and issues

The package lives on npm as @u2l/cli. Questions or problems: u2l.ai/contact.