Learn more
Links
How-toIntermediateAdmin, Member

Links CLI

Reach your devices and spaces from a terminal: sign in with your browser, list them, watch live streams and send commands.

6 min read0 viewsUpdated 2026-11-12
NovaGuide Assistant

This guide begins with What the CLI does, continues through Install, Sign in with your browser, Sign in without a browser, and finishes with A first session.

What the CLI does

The Links CLI (links) is the Device Terminal of the dashboard on your computer. From a terminal you can:

  • list every device and every space your account reaches, online or offline
  • connect to a device and watch its live event stream
  • enter a space and watch all of its devices at once
  • send device commands and space commands your role allows, such as /identify, /lights 60 or /power on

Your password never goes into the terminal. You sign in on the Links web page, the same way you sign in to the dashboard, and the CLI receives a token that works for 90 days and that you can revoke at any time.

Install

The CLI needs Node.js 20 or newer. Check with node --version.

npm install -g @linkseverything/cli
links --version

To run it once without installing:

npx @linkseverything/cli login

To update to the latest version, run the install command again.

Sign in with your browser

links login
  1. Your browser opens the Links sign-in page. Sign in as you do on the dashboard: password, two-factor code, SSO or passkey.
  2. The page asks Allow Links CLI to sign in? and shows the computer's name and what the CLI will reach: every workspace you belong to, or every workspace if you are a platform admin. Select Allow.
  3. The browser shows Signed in and the terminal confirms the account.

If the browser does not open, the terminal prints the address: paste it into any browser on the same computer.

The token is saved in ~/.links/credentials, readable only by your user (file 0600, folder 0700).

The CLI waits on a private address of your own computer (127.0.0.1) for the browser to come back, and proves with a one-time secret (PKCE) that it started the sign-in. The one-time code is valid for 60 seconds and works once. A sign-in link copied to another machine does not work.

Sign in without a browser

On a server or any machine without a browser, create a token in the dashboard and paste it:

  1. Open Settings > Security & Apps > CLI access and select Create token.
  2. Give it a name, for example build server, and copy the token. It starts with lkat_ and is shown once.
  3. On the machine run:
links login --token

and paste the token when asked; nothing is echoed while you paste. You can also pipe it: links login --token < token.txt.

For CI jobs, do not save a login: put the token in the LINKS_TOKEN environment variable. It is used instead of the saved file.

A first session

Start the terminal with links, then type commands that start with /. /help always lists what you can use right now.

$ links
Signed in as Ada Lovelace (workspace admin, 2 workspaces). Type /help.
links> /list
ID Device Type Status Workspace Space
3f9a1c2e Meeting Room Display smartDisplay online Acme Meeting Room 2
links> /connect 3f9a1c2e
Connected to Meeting Room Display 3f9a1c2e (smartDisplay, online). Streaming; Ctrl+C or /disconnect to stop.
links:meeting-room-display> /identify
sent smartDisplay.identify
links:meeting-room-display> /disconnect
links> /spaces --with-devices
ID Space Type Location Workspace Devices
4f2a9c1e Focus POD 1 POD Floor 2 Acme 2
links> /space 4f2a9c1e
Entered Focus POD 1 4f2a9c1e (POD, Acme). 2/2 devices online; space control online.
links:space:focus-pod-1> /lights 60
sent lights.setBrightness {"value":60}
links:space:focus-pod-1> /leave
links> /exit

Every device and space has a short ID: the first 8 characters of its uuid, like a short git commit hash. It never changes when lists change, so you can note it, share it or put it in a script and it keeps pointing at the same device. A name works too; when a name matches more than one, the CLI lists them with their IDs instead of guessing. Tab completes IDs and names after /connect and /space.

The full list of commands is in Links CLI command reference. Who may run which command is in Links CLI access, roles and security.

One command without the terminal

links run sends one command to a device or a space by its ID and exits. Use it in scripts, schedules or a note you keep for later:

$ links run 3f9a1c2e /identify
sent smartDisplay.identify to Meeting Room Display 3f9a1c2e
device answered: executed
$ links run 4f2a9c1e /lights 60
sent lights.setBrightness to Focus POD 1 4f2a9c1e
$ links run 3f9a1c2e /reboot
/reboot asks for confirmation; add --yes to send it to Meeting Room Display.
$ links run 3f9a1c2e /reboot --yes
sent smartDisplay.reboot to Meeting Room Display 3f9a1c2e

Space commands (/lights, /fan, /power and the others) take a space's ID; every other command takes a device's ID. For a device that is online, the CLI waits up to 8 seconds for the device's answer.

Exit codeMeaning
0Sent
1Error: unknown ID, a name that matches more than one, or a command the device cannot do
3Your level does not allow the command
4The command asks for confirmation; add --yes

Scripts and AI agents

Everything the terminal does also works without it, so a script or an AI agent can use the CLI: find a device, listen to it, act on it. Add --json to get one JSON value per line.

$ links list --json
[{"id":"3f9a1c2e","name":"Meeting Room Display","type":"smartDisplay","online":true,"workspace":"Acme","space":"Meeting Room 2"}]
$ links watch 3f9a1c2e --json
{"kind":"watching","target":"device","id":"3f9a1c2e","name":"Meeting Room Display","online":true}
{"kind":"event","live":true,"device":{"id":"3f9a1c2e","name":"Meeting Room Display"},"event":"commandAck","payload":{"request":{"status":"executed"}}}
$ links run 3f9a1c2e /identify --json
{"ok":true,"exitCode":0,"command":"smartDisplay.identify","commandId":"804aace5-...","ack":"executed"}
CommandWhat it does
links list [--all] [--json]Devices with their IDs
links spaces [--with-devices] [--json]Spaces with their IDs
links watch <id> [--json]Streams one device's events (or every device of a space) until Ctrl+C
links watch <id> --for 60Stops after 60 seconds
links watch <id> --until commandAckStops at the first event of that type
links run <id> /command [--json] [--yes]Sends one command and reports the device's answer

An agent usually runs links watch <id> --json in the background, reads the lines as they come, and acts with links run <id> /command --json. Events from before the watch started arrive with "live":false. The agent works with the signed-in account's token and can do only what that account's role allows; give an agent its own token (created in CLI access) so you can revoke it on its own.

Commands outside the terminal

CommandWhat it does
links loginSign in with your browser
links login --tokenSign in with a token created in the dashboard
linksStart the interactive terminal
links list, links spacesDevices or spaces with their IDs (--json for scripts)
links watch <id>Stream one device's or space's events (--json)
links run <id> /commandOne command to a device or space, then exit
links whoamiThe signed-in account, its access level and the token's expiry
links logoutRevoke this token on the server and delete the saved file
links --versionThe installed version
links --helpUsage
cliterminaldevicesspacesoauthdeveloper

Transform your workspace
infrastructure today

Enterprise-grade workspace management with intelligent automation, real-time analytics, and seamless hardware integration.

Enterprise-grade security99.9% uptime SLADedicated support