The neodesk command line
Copy as Markdownneodesk does from a terminal what the web console does: devices, users,
settings, backups and the rest. It signs in with an API token and talks to the
console's address, as your browser does, so it runs on the server or on your
own computer. This page gets you started; the
command reference lists every command.
Where to find it
The command line is part of the server binary. It runs when the program is
called neodesk, or as neodesk-server cli under any name. Every install
has it as neodesk:
- Linux: a copy of the server binary in
/usr/local/binthat every user on the server can run. It needs an API token to do anything. The installer's own manager issudo neodesk-setup. - Windows:
C:\NeoDesk\bin\neodesk.exe, on the machine's Path. Open a new terminal after the install or update so it finds it. - Docker: in the container.
On Linux and Windows:
neodesk --helpIn Docker, in the install's folder:
docker compose exec neodesk neodesk --helpOn your own computer, download the server binary for its system from the
releases on GitHub: Linux on
amd64, arm64 and armv7, or Windows on amd64. Save it as neodesk, or
neodesk.exe on Windows, and on Linux make it executable. There is no build
for macOS.
On a Linux server
Installs from before 3.6.0-rc.5 had the installer itself as neodesk. Its
options still work on the command line and go to neodesk-setup:
sudo neodesk --update runs sudo neodesk-setup --update, and a bare
sudo neodesk on a terminal opens the installer's menu. Without a terminal,
as in cron or a script over ssh, a bare neodesk prints the command line's
help.
On a computer that also has the NeoDesk desktop client, neodesk hands the
client's own options, such as --join, --service, --password and
--connect, to the client at /usr/bin/neodesk, and so does a join or
support link given on its own. --config and --version stay the command
line's, and --update, --uninstall and --relay the installer's.
The copy in /usr/local/bin changes only when the installer runs. After the
console updated itself, its update screen shows Update the command line
too, and the command line says on standard error that it is older than the
server. Update it with:
sudo neodesk-setup --updateSign in
Make an API token in the console first, see API tokens. Then sign in:
neodesk login --url https://<console-address>Put the address you open the console with in place of <console-address>.
neodesk login asks for the token and doesn't show it as you paste it. It
checks the token with the console, saves the address and the token for the
next commands, and prints the account and the token it signed in with. It
refuses a token given as an argument, since that would stay in your shell's
history; pipe one in from a file instead:
neodesk login --url https://<console-address> < token.txtThe settings go into neodesk/config.json in your user's config folder, such
as ~/.config on Linux and %AppData% on Windows. The file is yours alone:
the command line refuses a config file that others may read or that another
account owns. The saved token is used only with the address it was saved for.
neodesk configshows the file and where the address and the token come from. It never prints the token.neodesk logoutforgets the token; with--revokeit revokes it on the console first.
Certificates and plain HTTP
The command line checks the console's certificate and follows no redirects.
The Linux and Windows scripts give the console a self-signed certificate on
port 5443, which the command line refuses (exit code 9) until you trust it.
Give it the certificate file with --ca-cert, and login saves it with the
address. On the Linux server the file is /opt/neodesk/ssl/neodesk.crt, in a
folder only root and the service may open, so copy it into your home folder
first:
sudo cat /opt/neodesk/ssl/neodesk.crt > ~/neodesk.crtThen sign in, with your server's address in place of <server-address>:
neodesk login --url https://<server-address>:5443 --ca-cert ~/neodesk.crtOn Windows the file is C:\NeoDesk\ssl\neodesk.crt. On another computer, copy
the file there first. --insecure skips the check for one command and is never
saved. Behind a reverse proxy with a certificate browsers trust, sign in with
the proxy's address and leave --ca-cert out.
Plain http:// works only to the same machine, localhost or 127.0.0.1. To
another machine it needs --allow-http, and the token then crosses the network
unencrypted. In Docker, on the server itself:
docker compose exec neodesk neodesk login --url http://127.0.0.1:3375Inside the container the console is on 3375, whichever host port you publish it on.
That sign-in is saved inside the container, so it is gone when the container is made new, as at an update.
In scripts
A script can name the address and the token on each call instead of signing
in. With the token in a file and your console's address in place of
<console-address>:
neodesk devices list --json \
--url https://<console-address> --token-file token.txtNEODESK_URL and NEODESK_TOKEN do the same as --url and --token-file. A
token from a flag or the environment is sent only to an address from a flag or
the environment, never to the saved one. --token also works, but shows the
token in the process list.
First commands
Every command explains itself with --help: its arguments, flags, the
permission it needs and the console route it calls.
neodesk devices list --helpSee who the command line acts as, what the token may do and when it expires:
neodesk whoamiShow the server's versions, status and paths:
neodesk server infoList the devices that are online:
neodesk devices list --status onlineShow one device with all its details. Put a device ID from the list in place of
<device-id>:
neodesk devices get <device-id>Make an invite that adds a computer, with a link and a code, like Add a computer in the console. It needs Approve enrollment and a token with read and write access:
neodesk invites create --name "Reception PC"Read the last 20 entries of the audit log, which needs View audit logs:
neodesk audit list --limit 20On a new install, see which steps of the setup guide are done:
neodesk setup-guide statusOutput
- A list prints as a table and a single record as
key: valuelines. Tables cut long values with "…". --jsonprints the server's whole answer as JSON, for scripts andjq.--outputwith a file name (or-o) saves the answer to that file, for downloads. The command line doesn't print a file to the terminal.- Errors go to standard error, as
neodesk:, the server's message and the HTTP status. With--jsonthe server's error answer also goes to standard output. -vprints each request's method, address and status to standard error.
A command that deletes or ends something asks first. On a terminal it waits
for you to type yes; in a script it stops with exit code 2 unless you add
--yes.
Exit codes
The exit codes stay the same between releases, so scripts can test for them:
| Code | Meaning |
|---|---|
| 0 | Done |
| 1 | The server said no for another reason, or something unexpected went wrong |
| 2 | Wrong command, argument or flag, or a command that asks first got no yes |
| 3 | No token, or the token was refused (HTTP 401) |
| 4 | The account or the token may not do this (HTTP 403) |
| 5 | Nothing has that ID or address (HTTP 404) |
| 6 | The server refused the input, or it clashes with what is there (HTTP 400, 409, 413, 422) |
| 7 | Too many requests, try again later (HTTP 429) |
| 8 | The server failed (HTTP 5xx) |
| 9 | The console could not be reached, or its certificate was refused |
| 10 | The config file can't be used |
More commands of the command line itself
neodesk describeprints every command with its arguments, flags, permission and route as JSON;--format markdownprints the same as Markdown, and a group's name after it limits it to that group.neodesk apisends any request to the console's API, for what no command covers, such asneodesk api GET /api/stats.neodesk mcpserves the commands as tools for an AI agent, see AI agents over MCP.neodesk completionprints a completion script for bash, zsh, fish or PowerShell.neodesk localruns the server binary's own commands on this machine, such asbackup,checkandreset-password. They read the server's files and need no token, so they only make sense where the server runs.
The command reference has every command with its flags, and the flags every command takes.