Skip to content

Command Line Interface

The mdm command line interface gives you everything the cloud portal can do, from a terminal. It is built for people running quick fleet checks, for scripts and CI pipelines, and for AI agents that operate your fleet on your behalf.

Use this page to go from nothing to a working mdm command in about two minutes.

  • Node.js 20 or newer on your machine (node --version to check; install from nodejs.org if needed).
  • macOS or Linux (on Windows, use WSL).
  • A Telisky cloud account with access to at least one organization.

Run the installer:

Terminal window
curl -fsSL https://mdm-api.telisky.com/cli/install | sh

The installer downloads a single file, verifies its checksum, and installs the mdm command under ~/.local/bin. No root access is needed. If your shell cannot find mdm afterwards, add ~/.local/bin to your PATH.

To upgrade later, run the same command again. To install somewhere else, set MDM_INSTALL_DIR first (for example MDM_INSTALL_DIR=/opt/tools).

The CLI signs in with an access key — a scoped credential you create in the cloud portal. A key can do only what its scopes allow, so give automation exactly the access it needs and nothing more.

  1. In the portal, open Access keys in the left sidebar (under Org).
  2. Pick the organization the key should belong to.
  3. Select Create access key.
The Access keys page in the cloud portal with an organization selector and a Create access key button.
Access keys live under the Org section of the sidebar. You need the View tokens permission to see them, and Manage tokens to create or revoke them.
  1. Name the key for where it will run (for example field-laptop or ci-pipeline) and choose its scopes. Read only is a safe starting point for monitoring; add write scopes only when the key must change things.
The Create access key dialog with grouped permission checkboxes and Read only, Full access, and Clear preset buttons.
Scopes are grouped by area, with presets for common setups. You can only grant permissions you hold yourself.
  1. Select Create access key, then copy the key immediately — it is shown only once. The dialog also shows a ready-to-paste sign-in command.
The one-time access key reveal with a copy button and a ready-to-paste mdm auth login command.
Treat an access key like a password. If you lose it, revoke it and create a new one.

Paste the command from the reveal dialog, or run:

Terminal window
mdm auth login --url https://mdm-api.telisky.com --token mdm_your_key_here

Confirm what the key can do:

Terminal window
mdm auth status

The output shows which organization the key belongs to and the exact scopes it holds.

For CI pipelines and agents, skip auth login entirely and set environment variables instead:

Terminal window
export MDM_BASE_URL=https://mdm-api.telisky.com
export MDM_TOKEN=mdm_your_key_here
Terminal window
mdm devices list # fleet at a glance
mdm devices get RC500-12345 # one device, by serial, name, or ID
mdm jobs create --device RC500-12345 --kind reboot
mdm jobs list # watch the job complete
mdm --help # every command group
mdm devices --help # every device action

On a terminal you get readable tables. When you pipe the output, you get plain JSON for the same command — ready for jq or any script:

Terminal window
mdm devices list --json | jq '.items[] | {name, status}'

The CLI is designed so automation can discover and use it without guesswork:

  • mdm commands --json lists every command with its arguments, flags, required scope, and the API route behind it.
  • mdm docs agents prints the full machine-friendly usage contract.
  • Exit codes are consistent: 0 success, 2 usage error, 3 sign-in problem, 4 missing scope, 5 not found, 6 rejected input, 7 plan limit.
  • Destructive commands (delete, revoke, cancel) require --yes when run non-interactively, so scripts must be explicit about danger.

Point your agent at mdm docs agents as its first command and it will learn the rest on its own.

  • Rotate a key from the Access keys page to replace its secret without changing its scopes — the old secret stops working immediately.
  • Revoke keys you no longer use. Revocation takes effect on the key’s next request.
  • The page shows when each key was last used, which makes stale keys easy to spot.
SymptomFix
mdm: command not found after installAdd ~/.local/bin to your PATH, then open a new shell.
error: mdm needs Node.js >= 20Update Node.js from nodejs.org, then re-run the installer.
Exit code 3 / “unauthorized”The key was revoked or rotated, or the token was mistyped. Create or copy a fresh key and run mdm auth login again.
Exit code 4 / “forbidden”The key is missing a scope for that command. Compare mdm auth status with the scope shown in mdm <command> --help, then create a key with the right scopes.
“Your plan allows N API tokens”You reached your plan’s access key limit. Revoke unused keys or upgrade your plan under Billing.