@remote.it/cli
Version:
remote.it cross-platform command line
190 lines (136 loc) • 5.38 kB
Markdown
# @remote.it/cli
## Installation
_Coming soon..._
## Usage
```shell
# Show CLI help
sudo remoteit -h/--help
sudo remoteit help
# Get CLI version
sudo remoteit -V/--version
# Trigger verbose debugging mode for troubleshooting issues
sudo remoteit -v/--verbose
sudo remoteit -s/--silent # don't output anything to stdout
```
_NOTE: On Windows, use `remoteit.exe` instead for running commands_
### Authentication
You will first need to authenticate with remote.it before using the below commands.
```shell
sudo remoteit signin # interactive signin prompt
sudo remoteit signin <USERNAME> # shows secure password signin prompt
sudo remoteit signin <USERNAME> <PASSWORD> # no prompt, useful for scripting behavior
```
### Command Shortcuts
```shell
sudo remoteit start # looks in ~/.remoteit/config.json on Mac/Linux or C:\remoteit\config.json on Windows
sudo remoteit start ./path/to/config.json # use a custom config file location
sudo remoteit stop # stop all target/services/initiators
# TODO: COMING SOON!
sudo remoteit logs
sudo remoteit logs -t/--tail
sudo remoteit connect <UID> # make an initator connection to a service (shortcut of "remoteit initiator connect <UID>")
```
### Configuration
```shell
# TODO: COMING SOON!
sudo remoteit config set SCHANNEL_PORT=6000
```
### Target commands
```shell
# Setup the current machine as a target device
sudo remoteit target create
sudo remoteit target create "Optional Device Name"
# remoteit target create --no-multiport
# Show information about the target connection like uptime,
# status, active connections (tunnels), etc.
# TODO: COMING SOON!
sudo remoteit target info
# TODO: COMING SOON!
sudo remoteit target logs
sudo remoteit target logs <UID>
sudo remoteit target logs -t/--tail
# TODO: COMING SOON!
sudo remoteit target reinstall
# TODO: COMING SOON!
sudo remoteit target start
# TODO: COMING SOON!
sudo remoteit target restart
# TODO: COMING SOON!
sudo remoteit target stop
sudo remoteit target remove
```
### Service commands
```shell
sudo remoteit service create http 33000
sudo remoteit service list
# TODO: COMING SOON!
sudo remoteit service info <UID>
# TODO: COMING SOON!
sudo remoteit service logs
sudo remoteit service logs <UID>
sudo remoteit service logs -t/--tail
# TODO: COMING SOON!
sudo remoteit service start all
sudo remoteit service start <UID>
# TODO: COMING SOON!
sudo remoteit service restart all
sudo remoteit service restart <UID>
# TODO: COMING SOON!
sudo remoteit service stop all
sudo remoteit service stop <UID>
# TODO: COMING SOON!
sudo remoteit service remove all --confirm # must pass "--confirm" to be sure you want to do this destructive action
sudo remoteit service remove <UID>
```
#### Service Types
Below is a list of support service types you can configure your services to be. These types are used in the default application launching behavior in the web portal, desktop and mobile applications.
| Full Name | Key | ID | Default Port |
| ----------------------------- | --------------- | ---- | ------------ |
| TCP | `tcp` | `1` | `445` |
| VNC | `vnc` | `4` | `5900` |
| Remote Desktop Protocol (RDP) | `rdp` | `5` | `3389` |
| HTTP (reverse proxy) | `reverse-http` | `7` | `80` |
| HTTPS (reverse proxy) | `reverse-https` | `8` | `443` |
| SSH | `ssh` | `28` | `22` |
| HTTP | `http` | `30` | `80` |
| HTTPS | `https` | `33` | `443` |
| Samba | `samba` | `34` | `445` |
| NX Witness | `nx-witness` | `37` | `7001` |
| NextCloud | `next-cloud` | `38` | `443` |
| Open VPN | `open-vpn` | `39` | `1194` |
| remote.it Multiport | `multiport` | `40` | `65535` |
### Initiator commands
```shell
# Convenience shortcut for "remoteit initator connect":
sudo remoteit connect <UID>
sudo remoteit initiator connect <UID> # connect to the initiator using an automatically chosen port and the hostname 127.0.0.1
sudo remoteit initiator connect <UID> -p/--port 5000 # configure a port to bind to
sudo remoteit initiator connect <UID> -h/--hostname 127.0.0.2 # configure a hostname to bind to
sudo remoteit initiator connect <UID> --ondemand # make the conenction on-demand, which means it shuts down when not in use to save bandwidth
sudo remoteit initiator list
# TODO: COMING SOON!
sudo remoteit initiator info <UID>
# TODO: COMING SOON!
sudo remoteit initiator logs
sudo remoteit initiator logs <UID>
sudo remoteit initiator logs -t/--tail
# TODO: COMING SOON!
sudo remoteit initiator start all
sudo remoteit initiator start <UID>
# TODO: COMING SOON!
sudo remoteit initiator restart all
sudo remoteit initiator restart <UID>
# TODO: COMING SOON!
sudo remoteit initiator stop all
sudo remoteit initiator stop <UID>
# TODO: COMING SOON!
sudo remoteit initiator remove all
sudo remoteit initiator remove <UID>
```
## Development
## Building
On an ARM system:
```shell
sudo apt install --yes python gcc-multilib g++-multilib make libc6-dev-amd64
nexe bin/remoteit --verbose --build -t linux
```