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 logindl2 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
| Command | What it does |
|---|---|
dl2 login | Store a secret key, or set DL2_API_KEY instead. |
dl2 logout | Forget the stored key. |
dl2 projects list | List the projects the key can use. |
dl2 links list | List links. Filter with --q, --tag and --status; --limit or --all for how many. |
dl2 links get | Show one link by slug or id. |
dl2 links create | Create a link: --slug, --title, --path, --tag, --utm k=v, --set field=value. |
dl2 links update | Change a link's fields. |
dl2 links archive | Archive a link. Asks first; --yes to skip. |
dl2 links import | Create links from a CSV file. |
dl2 links export | Write every link as CSV, or --format json. |
dl2 stats | Clicks, opens and installs for the project, or for one link. |
dl2 health | The latest host health results. |
dl2 qr | Save a link's QR code as SVG: -o file.svg. |
dl2 open | Open a link in the browser; --print only shows the URL. |
dl2 mcp config | Print MCP client configuration: --client. |
dl2 completion | Print 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-codeOptions
--jsonprints 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,--projecttakes a project id, subdomain or name. It is needed when the key can use more than one project;DL2_PROJECTsets it once.-o,--outputwrites to a file instead of the terminal.-y,--yesskips the question before archiving.--base-url, orDL2_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.