Skip to content
Documentation menu

Build on it

Command-line tool

Manage DL2App links from a terminal or a script with the dl2 command: create, import, export, stats, health and QR codes.

dl2 is a command-line client for the REST API. It needs Node.js 20 or newer and nothing else, and is on npm as @dl2app/cli.

npm install -g @dl2app/cli
dl2 login

dl2 login stores a secret key (sk_live_…) in your user config folder, readable only by you. In scripts and CI, set DL2_API_KEY instead.

Commands

CommandWhat it does
dl2 loginStore a secret key, or set DL2_API_KEY instead.
dl2 logoutForget the stored key.
dl2 projects listList the projects the key can use.
dl2 links listList links. Filter with --q, --tag and --status; --limit or --all for how many.
dl2 links getShow one link by slug or id.
dl2 links createCreate a link: --slug, --title, --path, --tag, --utm k=v, --set field=value.
dl2 links updateChange a link's fields.
dl2 links archiveArchive a link. Asks first; --yes to skip.
dl2 links importCreate links from a CSV file.
dl2 links exportWrite every link as CSV, or --format json.
dl2 statsClicks, opens and installs for the project, or for one link.
dl2 healthThe latest host health results.
dl2 qrSave a link's QR code as SVG: -o file.svg.
dl2 openOpen a link in the browser; --print only shows the URL.
dl2 mcp configPrint MCP client configuration: --client.
dl2 completionPrint a shell completion script for bash, zsh or fish.

Examples

dl2 projects list
dl2 links list --tag summer --json
dl2 links create --slug summer-sale --path /sale/summer --tag push --utm source=push
dl2 links update summer-sale --title "Summer sale, extended" --dry-run
dl2 links archive summer-sale          # asks first; --yes to skip
dl2 links import links.csv --dry-run   # checks every row on the server, writes nothing
dl2 links export -o links.csv
dl2 stats summer-sale --from 2026-10-01 --to 2026-10-31
dl2 qr summer-sale -o summer.svg
dl2 mcp config --client claude-code

Options

  • --json prints the API’s JSON instead of a table, for scripts.
  • --dry-run, on writes, asks the server to check the change and report what it would do, without doing it.
  • -p, --project takes a project id, subdomain or name. It is needed when the key can use more than one project; DL2_PROJECT sets it once.
  • -o, --output writes to a file instead of the terminal.
  • -y, --yes skips the question before archiving.
  • --base-url, or DL2_BASE_URL, points the tool at another address.

Errors print the API’s message and exit non-zero: 1 for a refused request, 2 for bad usage.

Command-line tool · Docs · DL2App