Install the CLI
The CLI is distributed as an npm package and requires Node.js ≥ 18.
Install
npm install -g @thinremote/thinr-cliThis puts thinr on your PATH. See update and uninstall for moving to a new version, switching to pre-release builds, or removing it.
Permission denied (EACCES) on the global install?
This means your npm global prefix is root-owned, which happens when Node was installed with the official macOS/Linux installer. The clean fixes are using a Node version manager (nvm, fnm, volta) or moving the npm prefix to a user directory; sudo npm install -g also works, but npm itself recommends the former. Homebrew and version-manager installs of Node don't have this problem.
To install from source instead:
git clone https://github.com/Thin-Remote/thinr-cli
cd thinr-cli && npm install && npm linkAuthenticate
Run the CLI without arguments to start the first-time setup:
thinrYou'll be asked for the ThinRemote server and can authenticate using one of:
- OAuth 2.0 device flow (browser), the recommended option.
- Username and password.
- Pre-issued bearer token.
The profile is saved at ~/.config/thinr-cli/config.json and marked as the default. While you keep using the CLI, expired access tokens are refreshed transparently in the background, so you stay signed in without doing anything.
Verify everything works:
thinr device listRe-authenticating an expired session
If a profile goes unused for a long time (weeks or months), its refresh token eventually expires and the CLI can no longer renew the session on its own. You'll see:
Token refresh failed; re-authenticate.This is expected: like any credential, an idle login eventually has to be renewed by signing in again. Running thinr alone won't do it, because with an existing profile it opens the dashboard instead of prompting for login. To renew, recreate the profile.
First find its name (the one shown in the top bar of the dashboard):
thinr profile listThen delete that profile and add it again, which triggers a fresh login:
thinr profile delete <name>
thinr profile add <name>
thinr device list # confirm you're back inprofile add runs the same interactive login as first-time setup (browser, credentials, or token), and points at the same server. If it's your only profile, thinr logout followed by thinr does the same thing.
Multiple accounts and environments
The config file holds any number of named profiles, one per server or account. Add more with thinr profile add <name> and switch with thinr profile use <name>, or override per invocation with --profile <name> / the THINR_PROFILE environment variable. See the thinr profile reference.
Troubleshooting certificates
When talking to a development server with a self-signed certificate, set:
THINR_INSECURE=1 thinr device listlocalhost and 127.0.0.1 are always accepted without this flag; THINR_INSECURE=1 extends the exception to any host. Don't use it against production servers.
Next steps
- Quick Start: the full agent, CLI and MCP walkthrough
- CLI workflows: consoles, exec, files, tunnels
- MCP overview: let AI assistants drive your fleet through
thinr mcp