| name | kliq-cli |
| description | Manage Kliq via CLI - account, domains, links, analytics, customers, events, tracking, imports. Use when user mentions 'Kliq', 'short link', 'sublink', 'link analytics', 'attribution', 'track lead', 'track sale', 'conversion revenue', 'Dub import', or wants to interact with the Kliq API. |
| category | analytics |
kliq-cli
Use kliq-cli to manage the organization-scoped Kliq Admin API. Always add
--json for agent-driven calls.
Safety
- Run
kliq-cli auth test --json before the first operation in a session.
- Do not pre-check slug availability by listing links or fetching pages. The API
validates it:
links create / links create-sublink fail with
The slug "<slug>" is already used on this domain. Just create, and pick a new
slug only if that error comes back.
- Read before writing only when the command needs an existing id (
--domain-id,
a parent link id, a customer id) or when updating/archiving an existing record.
- Treat every
create, update, archive, lead, and sale command as a
production mutation.
- Reuse a stable business
--idempotency-key when retrying the same operation.
Never reuse it for different data.
links archive stops redirects but preserves history; Kliq does not
physically delete published links.
- Keep imported historical snapshots separate from live daily analytics.
- Revenue values are integer minor units with three-letter currency codes.
- Never print, log, commit, or use
auth show --raw with an Admin API token.
Authentication
kliq-cli auth set "$KLIQ_API_KEY"
kliq-cli auth test --json
kliq-cli auth show
The token is stored at ~/.config/tokens/kliq-cli.txt with mode 0600.
auth remove deletes the stored token. Do not pass the Admin API token to
browser code; browser attribution uses a publishable tracking-site key.
Resources
account
| Command | Description |
|---|
kliq-cli account get --json | Get the organization attached to the token |
domains
| Command | Description |
|---|
kliq-cli domains list --limit 50 --json | List domains |
kliq-cli domains list --cursor <cursor> --json | Continue pagination with an opaque cursor |
kliq-cli domains get <domain-id> --json | Get a domain |
kliq-cli domains create --hostname go.example.com --primary --json | Register a primary short-link domain |
kliq-cli domains create --hostname go.example.com --fallback-url https://example.com --json | Register a domain with a fallback URL |
kliq-cli domains update <domain-id> --primary true --json | Change primary status |
kliq-cli domains update <domain-id> --fallback-url https://example.com --json | Change fallback URL |
links
| Command | Description |
|---|
kliq-cli links list --limit 50 --json | List canonical parent links |
kliq-cli links list --cursor <cursor> --json | Continue parent-link pagination |
kliq-cli links get <link-id> --json | Get a parent link or sublink |
kliq-cli links create --domain-id <id> --slug launch --name Launch --destination-url https://example.com --idempotency-key parent-launch-v1 --json | Create a parent link |
kliq-cli links create --domain-id <id> --slug launch --name Launch --destination-url https://example.com --title Launch --image-url https://example.com/og.png --idempotency-key parent-launch-v1 --json | Create a parent with social metadata |
kliq-cli links update <link-id> --name "Updated name" --json | Update link metadata |
kliq-cli links update <link-id> --utm-source youtube --utm-medium video --utm-campaign launch --json | Update sublink UTM values |
kliq-cli links archive <link-id> --json | Archive a link while preserving analytics |
kliq-cli links sublinks <parent-id> --limit 50 --json | List a parent's sublinks |
kliq-cli links create-sublink <parent-id> --slug launch-youtube --name YouTube --utm-source youtube --utm-medium video --idempotency-key launch-youtube-v1 --json | Create a placement sublink |
analytics
Analytics dates are inclusive UTC days and ranges cannot exceed 367 days.
| Command | Description |
|---|
kliq-cli analytics organization --from 2026-08-01 --to 2026-08-08 --json | Get organization totals, daily data, and top links |
kliq-cli analytics link <link-id> --from 2026-08-01 --to 2026-08-08 --json | Get parent and sublink analytics plus imported history |
customers
| Command | Description |
|---|
kliq-cli customers list --limit 50 --json | List attributed customers |
kliq-cli customers list --link-id <link-id> --json | Filter customers by their current attributed link |
kliq-cli customers list --cursor <cursor> --json | Continue customer pagination |
kliq-cli customers get <external-id> --limit 50 --json | Get a customer and event journey |
events
| Command | Description |
|---|
kliq-cli events list --limit 50 --json | List recently received events |
kliq-cli events list --cursor <cursor> --json | Continue event pagination |
kliq-cli events create --external-customer-id user_123 --event-name onboarding.completed --kind event --idempotency-key onboarding-user_123 --json | Ingest a trusted server event |
kliq-cli events create --external-customer-id user_123 --event-name subscription.created --kind conversion --revenue-minor 9900 --currency EUR --idempotency-key subscription-sub_123-created --json | Ingest a conversion with revenue |
kliq-cli events create --external-customer-id user_123 --event-name trial.started --kind event --metadata '{"plan":"pro"}' --idempotency-key trial-user_123 --json | Ingest an event with scalar metadata |
tracking
The funnel is click, lead, then sale. A lead binds the click to one customer
key; later sales inherit that attribution.
| Command | Description |
|---|
kliq-cli tracking lead --external-customer-id user_123 --customer-email user@example.com --click-id <click-id> --idempotency-key signup-user_123 --json | Bind a click to a known customer |
kliq-cli tracking lead --customer-email user@example.com --event-name Waitlist --idempotency-key waitlist-user-example --json | Record an email-only lead |
kliq-cli tracking sale --external-customer-id user_123 --amount 9900 --currency EUR --invoice-id in_123 --json | Record an invoice-backed sale |
kliq-cli tracking sale --external-customer-id user_123 --amount 9900 --currency EUR --idempotency-key sale-order_123 --json | Record a sale without an invoice ID |
imports
| Command | Description |
|---|
kliq-cli imports list --limit 50 --json | List import batches |
kliq-cli imports list --cursor <cursor> --json | Continue import pagination |
kliq-cli imports get <import-id> --json | Get an import batch |
kliq-cli imports items <import-id> --limit 50 --json | List row results and errors |
kliq-cli imports create --source dub --domain-id <id> --conflict-strategy skip --file dub-export.csv --json | Start a Dub CSV import and skip conflicts |
kliq-cli imports create --source csv --domain-id <id> --conflict-strategy update --file links.csv --json | Start a normalized CSV import and update conflicts |
Pagination
List commands accept --limit 1..100 and --cursor. Pass returned cursors
unchanged until pagination.isDone is true.
Output Format
--json returns a standardized envelope:
{
"ok": true,
"data": {
"data": [],
"pagination": { "cursor": null, "isDone": true }
}
}
Single-resource responses use the same outer envelope. On error:
{ "ok": false, "error": { "code": 401, "message": "..." } }
Quick Reference
kliq-cli --help
kliq-cli <resource> --help
kliq-cli <resource> <action> --help
Global flags are --json, --format <text|json|csv|yaml>, --verbose,
--no-color, and --no-header. Exit codes are 0 for success, 1 for API
failure, and 2 for usage errors.