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.
- Package:
lnkifyon npm - Source: github.com/lnkify/lnkify-cli
- Requires: Node.js >= 22
Install
npm install -g lnkify
# or run without installing
npx lnkify --helpSee Installation for pnpm/yarn and upgrade notes.
Quick example
# 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 analyticsWhat you can do
| Area | Commands |
|---|---|
| Auth | login, logout, whoami |
| Config | config set, config get, config list |
| Links | links create, links list, links get, links update, links delete, links bulk |
| Resolve | resolve <slug> |
| Analytics | analytics |
| Domains | domains add, domains list, domains verify, domains rm |
| API keys | apikeys create, apikeys list, apikeys revoke |
| MCP | mcp 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:
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.
Quick links
- Installation — install, upgrade, requirements
- Authentication — API keys, login, profiles
- Commands — full command and flag reference
- CLI + MCP — run the CLI as an MCP server
- Examples — scripting, bulk import, multi-server
Next: Installation