Create tracked links, pull click analytics and check usage without opening a browser. Built to be piped, scripted and run in CI.
npm i -g @tracklink/cli
tl auth login
tl stats --from 7dColumns for you, tab-separated for your tools, JSON for jq. No sed gymnastics.
# a terminal gets aligned columns and colour
tl links ls
# a pipe gets TSV — no header, no escape codes
tl links ls | cut -f2
# or ask for JSON
tl links ls --json | jq -r '.data[].slug'
# create prints ONLY the short URL, so this works
URL=$(tl links create https://example.com/promo --slug promo)0 success, 2 usage, 4 auth, 5 rate limited. Branch on $? instead of grepping English.
A 403 tells you whether you need a write key or a plan upgrade, not just the status.
--from 7d, 24h, 2w. Typing an ISO timestamp to ask about last week is friction.
Ticks, hints and pagination notes go to stderr.
links rm refuses to run without --yes when it is not attached to a terminal.
NO_COLOR and FORCE_COLOR both honoured; escape sequences in your data are stripped.
No. Reading — listing links, pulling clicks, stats and usage — works on every plan including free. Creating, editing and deleting links from the CLI needs a write-scoped key on Agency or Business.
Yes, that is a design target. Authenticate with the TRACKLINK_API_KEY environment variable rather than a config file, and branch on the exit code: 4 means not authenticated, 5 means rate limited. Set FORCE_COLOR=1 if your CI renders ANSI.
Piped output is tab-separated with no header, so cut and awk work directly. Use --json for the full envelope and pipe it to jq. Creating a link prints only the short URL on stdout, so URL=$(tl links create https://example.com) does what you would expect.
In ~/.config/tracklink/config.json, written 0600 inside a 0700 directory. The key is verified against the API before it is saved, so a bad paste fails at login instead of turning every later command into a confusing 401. Environment variables take precedence over the file.
Yes — tl completion bash, zsh or fish prints a script you can source from your shell profile.