Skip to content

The dynm CLI ​

dynm makes and changes your links from the terminal, and runs the MCP server your agent talks to. It uses the same REST API as the dashboard, with your API key.

Install ​

bash
npm install -g @dynm.link/cli

Or run it without installing, with npx @dynm.link/cli in place of dynm. The package is @dynm.link/cli on npm.

Sign in ​

bash
dynm login
text
Your code is KQ4-7MT. Approve only if your browser shows the same one.
Opening your browser to authorize:
  https://dash.dynm.link/cli-auth?code=KQ4-7MT&…
Waiting for you to approve… (Ctrl-C to cancel)
Signed in as you@example.com.

Your browser opens the dashboard, which shows a code too. Approve only when the two codes match; the dashboard then hands a new API key straight back to the terminal.

On a server or any machine without a browser, make a key on the dashboard's API keys page and give it to dynm yourself:

bash
dynm login --key "$DYNM_API_KEY"

You can pipe it in too, which keeps it out of your shell history:

bash
echo "$DYNM_API_KEY" | dynm login

Either way, dynm checks the key with the API before it stores it.

To see who you're signed in as:

bash
dynm whoami
text
you@example.com
  plan     free
  domains  example.dynm.link
  api      https://api.dynm.link

To sign out on this machine:

bash
dynm logout
text
Signed out. The key still works until you revoke it on the dashboard, in Settings → API keys.

Where the key lives ​

dynm stores the key in ~/.config/dynm.link/config.json (or $XDG_CONFIG_HOME/dynm.link/config.json when you set it), readable only by you. If that file isn't valid, every command stops and names it; dynm never writes over it. Fix it, or delete it and run dynm login again.

These environment variables win over the stored file:

VariableWhat it sets
DYNM_API_KEYThe API key.
DYNM_API_URLThe API's origin. Default https://api.dynm.link.
DYNM_SPA_URLThe dashboard dynm login opens. Default https://dash.dynm.link.
NO_COLORSet to anything to turn colour off.

Each kind of link has its own command. A redirect:

bash
dynm link create redirect shop --web https://example.com/shop
text
https://example.dynm.link/shop
Created a redirect that never expires.

The first line is the address, alone, on stdout. The second line goes to stderr, so a pipe gets only the address:

bash
dynm link create redirect --web https://example.com/shop | pbcopy

Leave the slug out, as there, and you get a random one. A file link stops working after 14 days; any other link never does. Say otherwise with --expires, such as --expires never to keep a file. On dynm.link itself, every link lasts 30 days.

A note, which is a page of text:

bash
dynm link create text opening-hours --body "Open Thursday to Sunday, 10 to 4."
text
https://example.dynm.link/opening-hours
Created a note that never expires.

With --body - the text comes from stdin, and --markdown renders it as Markdown:

bash
cat menu.md | dynm link create text menu --body - --markdown

A bio page:

bash
dynm link create bio hi \
  --name "Example Pottery" \
  --headline "Potter in Leeds" \
  --link "Shop=https://example.com/shop" \
  --link "Instagram=https://instagram.com/example" \
  --theme kraft --font serif
text
https://example.dynm.link/hi
Created a bio page that never expires.

A file, which dynm uploads for you before it makes the link:

bash
dynm link create file price-list --file ./price-list.pdf
text
https://example.dynm.link/price-list
Created a file that expires on 2026-10-17 00:00 UTC.

Flags for every kind ​

FlagWhat it does
[slug]The path after the domain: shop in example.dynm.link/shop. Random if you leave it out.
--expiresWhen the link stops working: 30d, 12h, 45m, a date like 2026-12-31, or never. Left out, a file lasts 14 days and any other link never expires.
--domainWhich of your domains the link goes on. See Domains.
--title, --descriptionThe card a share shows. On a redirect, these need --preview custom.
--jsonPrint the new link as JSON instead. See JSON.

Flags for each kind ​

CommandFlags
create redirect--web (required) where it goes. --ios, --android where phones go. --rule a routing rule, repeatable. --preview follow or custom.
create text--body (required) the text, or - for stdin. --markdown. --theme, --font.
create bio--name (required). --headline. --avatar the URL of your photo. --link "Label=https://…", repeatable. --theme, --font.
create file--file (required) the path of the file to upload.

--theme is the paper a note or bio page is printed on: kraft, sage, blush, newsprint, slate or night. Leave it out for plain paper, which is light or dark to match each visitor. --font is grotesk (the default), serif or mono.

Redirect rules ​

--ios and --android send phones somewhere else:

bash
dynm link create redirect app \
  --web https://example.com \
  --ios https://apps.apple.com/app/id000000000 \
  --android 'https://play.google.com/store/apps/details?id=com.example.pottery'

--rule takes any routing rule as JSON, and the platform rules go ahead of it. Visitors in the US and Canada:

bash
dynm link create redirect stockists \
  --web https://example.com/stockists \
  --rule '{"when":[{"op":"in","field":"country","values":["US","CA"]}],"to":"https://example.com/stockists/na"}'

The card a share shows ​

A redirect shared in a chat shows the card of the page it goes to. To show your own instead, add --preview custom with a title and description:

bash
dynm link create redirect sale \
  --web https://example.com/sale \
  --preview custom --title "Winter sale" --description "Seconds and samples, this weekend only."

To go back to the destination's card, which also clears yours:

bash
dynm link edit sale --preview follow
bash
dynm link list
text
https://example.dynm.link/shop        redirect  https://example.com/shop
https://example.dynm.link/hi          bio       Example Pottery
https://example.dynm.link/price-list  file      price-list.pdf

Newest first, every domain. --type redirect, text, bio or file shows one kind, --domain one domain, and --limit 20 the newest 20. dynm link ls is the same command. The address is the first column, so dynm link list | cut -d' ' -f1 gives you just the addresses.

One link:

bash
dynm link get shop
text
https://example.dynm.link/shop
  type     redirect
  goes to  https://example.com/shop
  expires  never
  id       01K6H2M9V7Q4XJ8C3N5R2T6W1Y

The address stays; what it opens changes.

bash
dynm link edit shop --web https://example.com/winter-sale
text
https://example.dynm.link/shop
  type     redirect
  goes to  https://example.com/winter-sale
  expires  never
  id       01K6H2M9V7Q4XJ8C3N5R2T6W1Y
Saved.

edit takes --title, --description, --expires, and for a redirect --web and --preview. To change anything else, --content replaces the link's content with new JSON of the same kind (the shapes are in Link types):

bash
dynm link edit opening-hours --content '{"body":"Closed for the holidays until 6 January."}'
bash
dynm link remove shop

dynm asks before it deletes. In a script there's no one to ask, so add --yes:

bash
dynm link remove shop --yes
text
Deleted https://example.dynm.link/shop.

dynm link rm is the same command.

Domains ​

Your links live on username.dynm.link, and on any custom domain you add on the dashboard. While you have only the one, dynm uses it. Once you have a custom domain too, create, get, edit and remove need --domain, so a link never lands somewhere you didn't mean:

bash
dynm link create redirect shop --web https://example.com/shop --domain links.example.com

On list, --domain only narrows the list.

JSON ​

link create, link get, link edit, link list and whoami print JSON with --json, and nothing else:

bash
dynm link create redirect --web https://example.com --json | jq -r .id
text
01K6H2M9V7Q4XJ8C3N5R2T6W1Y

A link's JSON is the API's own: the fields are in the quickstart.

Colour ​

At a terminal, dynm prints the / before a slug in green and the slug in bold, and colours the outcome of a success ("Created", "Saved", "Signed in") green. Each stream decides for itself: stdout or stderr piped or redirected to a file prints no colour, while the other, still at the terminal, keeps it. NO_COLOR turns colour off everywhere.

Errors ​

A failed command prints what happened to stderr, then what to do, and exits with status 1. An API error starts with its code:

text
SlugTakenError: example.dynm.link/shop is taken.
Choose another slug, or leave it out for a random one.

Every code is in the error table.

One address. Change what it opens.