Links CLI access, roles and security
What a CLI token can reach, what each role may run, how to see and revoke CLI access, and what to do when something fails.
This guide begins with What the CLI reaches, continues through Who can run what, See and revoke CLI access, Token lifetime, and finishes with How sign-in is protected.
What the CLI reaches
The CLI never gives you more than your account has:
- Platform admins reach every workspace's devices and spaces.
- Everyone else reaches the devices and spaces of every workspace they are an active member of.
The workspace chosen at sign-in is only the token's default; it does not narrow what you reach. Removing someone from a workspace removes that workspace from their CLI the next time it starts or reconnects; lists (/list, /spaces) drop it at once.
A CLI token works only for the device terminal. It cannot read or change bookings, members, billing or settings, and it cannot create other tokens.
Who can run what
Every command is checked on the server, not only in the CLI: a modified CLI cannot do more.
| Level | Who | What |
|---|---|---|
| Member | Any member of the device's workspace | Lights, fan and power; identify; template refresh; info sync; the matching space commands |
| Workspace admin | Members with workspace management in the device's workspace (Owner, Admin and roles with that permission) | Also restart and reboot, emergency alerts, activating devices |
| Platform admin | Links platform administrators | Everything, including factory reset, updates, revoking device tokens and raw commands |
A command your level does not allow answers ERR_FORBIDDEN_ROLE with the level it needs. Your level can differ per workspace: you may be an admin in one and a member in another.
See and revoke CLI access
Settings > Security & Apps > CLI access lists CLI tokens with their name, workspace, last use (time and IP address), expiry and status.
- Mine: everyone sees and revokes their own tokens.
- Workspace: workspace admins also see and revoke the tokens of their workspace's members.
- All workspaces: platform admins see every token.
Select Revoke and confirm. The token stops at once: the API refuses it on the next request, and any terminal session using it is closed within a second, even in the middle of a stream. The terminal shows This CLI token was revoked from the dashboard and deletes its saved login.
links logout (or /logout) revokes the token from the terminal itself.
Token lifetime
- A token works for 90 days from sign-in. After that the terminal says it has expired; run
links loginagain. - Tokens are stored on the server only as a fingerprint (SHA-256); Links cannot show a token again after it is created.
- Each computer gets its own token, named after the computer (
links-cli on <computer>), so you can revoke one machine without touching the others.
How sign-in is protected
- The password, two-factor code, SSO and passkey stay in the browser; the CLI never sees them.
- Sign-in uses OAuth 2 authorization code with PKCE (S256). The browser returns only to
127.0.0.1on your own computer, the code is valid for 60 seconds and works once, and it is useless without the secret the CLI kept. - The token file is readable only by your user. Keep
LINKS_TOKENin your CI's secret store, never in a repository. - Every request carries a
links-cliuser agent, and the dashboard shows each token's last IP address.
When something fails
| What you see | What to do |
|---|---|
| The browser does not open | Copy the address the terminal printed into a browser on the same computer |
| Timed out waiting for the browser | The sign-in waits 5 minutes; run links login again |
| This CLI token was revoked from the dashboard | Someone revoked it in CLI access; run links login |
| Your CLI token was revoked or has expired | Run links login |
ERR_FORBIDDEN_ROLE | Your level in that workspace does not allow the command; ask a workspace admin |
unsupported_capability | The device or the space cannot do that command, or its gateway is offline |
| matches 3 devices; use the id | The name fits more than one; use one of the IDs listed under it |
| No online devices | Use /list --all to see offline ones too |
| Connection lost. Reconnecting... | The CLI reconnects by itself (1, 2, 5, 10 seconds) and reopens the stream |
links: command not found | Install again with npm install -g @linkseverything/cli, or use npx @linkseverything/cli |
