Back to Remote

CLI Usage

developer-tools-cli-usage.md

latest8.7 KB
Original Source

For the complete documentation index, see llms.txt. This page is also available as Markdown.

The remote.it CLI has slightly different behavior if you are running as a root user versus a non-root user. In general, you will want to run as a root user, though there are a couple cases where you don't. These will be made clear.

On Windows , you will need to open a "Command Prompt" as an Administrator

On Mac and Linux , you must run any commands related to creating/managing a Device or Services as a root user (e.g.sudo)

Help

List the available commands.

Linux/Mac

Windows

Copy

sudo remoteit help

Copy

remoteit help

Version

Get the version of CLI installed

Linux/Mac

Windows

Copy

sudo remoteit version

Copy

remoteit version

Example output

Copy

4.1.0

Account

With 2FA enabled, you'll need to provide an authentication code when accessing remote.it through your browser, desktop and mobile apps. If you access remote.it using other methods, such as the API or the CLI, you'll need to sign in with credentials using an access key and secret.

Sign In

Without the user and pass options it will prompt for the username and password.

Linux/Mac

Windows

Sign in with Credentials

For accounts that have 2FA enabled OR do not have a username and password (i.e. Google sign in), you can still use the CLI. In this situation, the CLI will use a credentials file which contains an access key and access key secret to execute all CLI commands.

Instructions for creating an access key and secret can be found here.

Linux/Mac

Windows

If you switch to using credentials with the CLI sudo privileges are no longer required when running many of these commands on the device. All subsequent calls will need to be made by the same user.

Create a credentials file in the .remoteit directory of the user home directory, if it doesn't already exist.

You will be prompted to enter your key, secret and user defined profile name

Example output

Finally, activate and enable the credentials file with the following command.

You have successfully signed in with credentials over username and password

If you switch to using credentials with the CLI all commands can be run from a non-adminstrative command prompt. All subsequent calls will need to be made by the same user.

Create a credentials file in the .remoteit directory of the user account which will be using the CLI, if it doesn't already exist.

You will be prompted to enter your key, secret and user defined profile name

Example output

You have successfully signed in with credentials over username and password

Sign Out

Linux/Mac

Windows

Device and Service

Register

Registers this device to your account to allow access. This is not needed if you only need to initate a connection to another device. Once registered you can no longer register this device.

If you need to re-register, unregister first, then register. If you just need to move the device to another account, use transfer.

After registration, you can then add services to this device to allow other devices to connect to this device.

Linux/Mac

Windows

List supported application types

This is referenced in adding a new service or modifying a service

Linux/Mac

Windows

New application types are added all of the time, but common ones are listed below.

List services and status on this device

You can add an option of --j or --json to output the results in JSON

Linux/Mac

Windows

Example output

Device and services are this device information. Connections are connections from this device to other services.

Add a new service on this device

Adds a new service to this device. This will define a remote.it Service which is running on this machine. NOTE: This does not detect if the actual service is running on this machine. The type option will accept either the ID or Name of an application type and is not case sensitive. Available service types can be found here.

Linux/Mac

Windows

Example adding an SSH service

Example adding an SSH service

You can also add a service which connects to an application on another device on the same LAN. This is also referred to as a jumpbox. The host name can be either an IPv4 IP address or mDNS address (i.e. raspberrypi.local) of the device which is running the application.

Linux/Mac

Windows

Example of adding service to "jump" to RDP on a windows desktop on the LAN

Example of adding service to "jump" to RDP on windows desktop on the LAN

Remove a service from this device

Removes a service from this device. This will cause a disconnect for all other users who had an active connection to this service. If you are concerned about the disconnect, you can use the graphQL API to fetch active connection to this service and then notify users accordingly. Use the status command to get the service ID.

Linux/Mac

Windows

Modify a service on this device

Modifies a service on this device. This will cause a disconnect for all other users who had an active connection to this service. If you are concerned about the disconnect, you can use the graphQL API to fetch active connection to this service and then notify users accordingly.

The enabled option disables the service without deleting it. The hostname option will modify a service which connects to an application on another device on the same LAN. The host name can be either an IPv4 IP address or mDNS address (i.e. raspberrypi.local) of the device which is running the application. The type option will accept either the ID or Name of an application type and is not case sensitive. Available service types can be found here.

Linux/Mac

Windows

Creating Connections

Once you have created a service on a target device you can generate a a persistent address on demand connection from the CLI on your initiator device. This requires the service id and local port. Verify there are not other connections on the local port before generating. Learn more about peer to peer vs proxy. The connection will be attempted as peer to peer (p2p) first with a proxy failover if allowed. In some cases such as https and http it will be a reverse proxy connection.

Below is a general connection add command for a peer to peer connection.

Linux/Mac

Windows

The connection will be generated in the background. Run the status command to retrieve the generated url in the Address column

The connection will be generated in the background. Run the status command to retrieve the generated url in the Address column.

Unregister This Device

Unregister this device from your account and removes the services. This will also remove access to this device for any users to which you have shared this device. This will cause a disconnect for all other users who had an active connection to this service as well. If you are concerned about the disconnect, you can use the graphQL API to fetch active connection to this service and then notify users accordingly. Once unregistered, this device can be registered again.

Linux/Mac

Windows

Transfer

Transfer this device and defined services to another account. This will remove your access to this device along with any users to which you had previously shared this device. This will cause a disconnect for all other users who had an active connection to this service. If you are concerned about the disconnect, you can use the graphQL API to fetch active connection to this service and then notify users accordingly. If the account doesn't exist, the transfer will fail. If this is the case, you can sign-in to the web portal and create the contact and then transfer the device from the devices list.

Verify the email address used for the transfer is correct. This device will transfer to the email address provided and cannot be undone. The new owner would need to transfer the device back to you.

Linux/Mac

Windows

More

CLI has many more functions, examples provided here are the most common. You can use help to explore other functions supported by your version such as graphQL query helper, upgrades, and more.

PreviousScriptingNextWebhooks

Last updated 14 days ago

Was this helpful?