Linkly CLI

The Linkly CLI is a command-line tool for managing your Linkly account from the terminal. Create short links, pull click analytics, manage custom domains, handle webhooks, and export data — without leaving your shell or writing any API code.

It is built on the Linkly API and runs on macOS, Linux, and Windows.

Installation

The CLI requires Node.js 20 or newer. Install it globally with npm:


npm install -g @linkly-link-shortener/cli

This adds a linkly command to your system. Confirm it is working:


linkly --help

Signing in

The CLI supports two ways to sign in. You only need to do this once — your credentials are saved securely on your machine and reused on every run.

To sign in with an API key, run:


linkly auth login --api-key

You will be prompted to paste your API key, which you can find in your Linkly account settings.

To sign in with OAuth instead, run:


linkly auth login

This opens your browser so you can approve access — there is no API key to copy.

Check your status or sign out at any time:


linkly auth status

linkly auth logout

Create, search, inspect, update, and delete short links:


linkly links create --url https://example.com --name "Spring promo"

linkly links list --search promo

linkly links get 12345

linkly links update 12345 --url https://example.com/new

linkly links delete 12345

Click analytics

View click totals grouped by country, browser, platform, and more — or as a time series over a date range:


linkly analytics by country

linkly analytics timeseries --start 2026-01-01 --end 2026-01-31

Custom domains

List your custom domains or add a new one:


linkly domains list

linkly domains create links.example.com

QR codes and data exports

Download a link's QR code, or export your links and click data as CSV or JSON:


linkly links qr 12345 --output qr.png

linkly links export --format csv --output links.csv

linkly analytics export --format csv --output clicks.csv

Webhooks

Subscribe a URL to receive real-time click events for a single link or a whole workspace:


linkly webhooks add https://example.com/hook --link 12345

Working with multiple workspaces

If your account has more than one workspace, set a default:


linkly workspaces list

linkly workspaces use 42

You can also target a specific workspace for a single command with the --workspace option.

JSON output for scripts

Add --json to any command to get the raw API response instead of a formatted table — handy for piping into tools such as jq:


linkly links list --json

Getting help

Every command has built-in help. Run linkly --help for an overview, or add --help to any command to see its options and examples:


linkly links create --help

Using the CLI with AI agents

Coding assistants that can run shell commands — such as Claude Code or Cursor — can drive the Linkly CLI directly.

  • Add --json to any command to get the raw API response instead of a formatted table.
  • Run linkly schema to print the full command tree — every command, argument, and option — as JSON, so an assistant can discover what the CLI can do.
  • Add --help to any command to see its options and examples.

If your AI assistant cannot run shell commands, use the Linkly MCP Server instead — it connects assistants such as Claude and ChatGPT to your Linkly account directly.

Obtenez 100 liens courts et suivez 500 clics mensuels gratuitement.