Skip to content

CLI Overview ​

The lnkify CLI is a branded command-line tool for managing your shortlinks, domains, API keys, and analytics without leaving the terminal. It wraps the GraphQL API and can also run as a local MCP server so AI agents can manage links on your behalf.

It works against any lnkify instance — your local dev server by default, or any remote deployment via flags, environment variables, or saved profiles.

Install ​

bash
npm install -g lnkify
# or run without installing
npx lnkify --help

See Installation for pnpm/yarn and upgrade notes.

Quick example ​

bash
# 1. Point at your server (defaults to http://localhost:4000)
lnkify config set url http://localhost:4000

# 2. Authenticate — interactive login...
lnkify login
# ...or use a scoped API key
lnkify config set api-key lf_live_YOUR_KEY

# 3. Create and manage links
lnkify links create https://example.com --slug launch --track
lnkify links list
lnkify resolve launch
lnkify analytics

What you can do ​

AreaCommands
Authlogin, logout, whoami
Configconfig set, config get, config list
Linkslinks create, links list, links get, links update, links delete, links bulk
Resolveresolve <slug>
Analyticsanalytics
Domainsdomains add, domains list, domains verify, domains rm
API keysapikeys create, apikeys list, apikeys revoke
MCPmcp serve, mcp install

See the full Commands reference for every flag.

JSON output ​

Add --json to any command for clean, pipe-safe machine output — data goes to stdout, while logs, spinners, and the banner go to stderr:

bash
lnkify links list --json | jq '.items[].lnkify'

AI agents (MCP) ​

lnkify mcp serve runs the CLI as a stdio Model Context Protocol server, exposing your links as agent tools using your configured credentials. This is distinct from the hosted MCP Server at mcp.lnkify.io — it runs locally and is handy for desktop agents like Claude Desktop. See CLI + MCP.

Next: Installation

Released under the MIT License.