CLI Usage

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.

sudo remoteit help

Version

Get the version of CLI installed

sudo remoteit version

Example output

3.0.14

Account

Sign In

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

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.

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

You must then enable the active profile

You have successfully signed in with credentials over username and password

Sign Out

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.

List supported application types

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

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

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.

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.

Example of adding service to "jump" to RDP on a 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.

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.

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.

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.

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.

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.

Last updated

Was this helpful?