Command-line interface

A command-line interface, rdpcli, is included inside the RDPlenty application bundle, under:

RDPlenty.app/Contents/SharedSupport/rdpcli

You can invoke it directly from there, add that directory to your PATH, or create a symbolic link to rdpcli somewhere that is already in your PATH.

For example, if the application is installed in /Applications, you could create a symbolic link such as:

sudo ln -s \
  "/Applications/RDPlenty.app/Contents/SharedSupport/rdpcli" \
  /usr/local/bin/rdpcli

Do not copy the executable out of the application bundle. A copied executable will not be updated when RDPlenty itself is updated. A symbolic link continues to point to the version installed with the application.

Because RDPlenty is sandboxed, it cannot install the command-line tool into your PATH or create this link for you.

rdpcli lets you open RDP sessions from Terminal while still using RDPlenty for the actual connection.

There are two ways to start a session:

  • start opens one of your saved RDPlenty connections by name.

  • connect opens a one-off connection directly to a host name or IP address.

Use:

rdpcli --help

to see the available commands, or:

rdpcli start --help
rdpcli connect --help

for the options accepted by each command.

Starting a saved connection

Use start when you already have a connection configured in RDPlenty:

rdpcli start "Office PC"

The name must match the saved connection name.

You can override selected settings for this invocation without changing the saved connection itself. For example:

rdpcli start "Office PC" --resolution 1920x1080 --full-screen false

Connecting directly to a host

Use connect for a one-off connection that does not require a saved connection record:

rdpcli connect server.example.com

An IP address can be used instead of a host name:

rdpcli connect 192.168.1.25

RDP’s default port is used unless another port is specified:

rdpcli connect server.example.com --port 3390

Authentication

The account name can be supplied with --account or -a:

rdpcli connect server.example.com --account alice

Passwords can be supplied non-interactively in either of two ways.

From an environment variable

--password-env names an environment variable containing the password:

RDP_PASSWORD='secret' rdpcli connect server.example.com \
    --account alice \
    --password-env RDP_PASSWORD

The option takes the name of the variable, not the password itself.

From a file descriptor

--password-fd reads the password from an already-open file descriptor:

rdpcli connect server.example.com \
    --account alice \
    --password-fd 3 \
    3<password.txt

This is useful when another program or script is responsible for supplying the credential.

Display and session options

Both start and connect accept the same session-related options.

--resolution or -r sets the initial desktop size:

--resolution 1920x1080

--full-screen or -f controls whether the session opens full screen:

--full-screen true
--full-screen false

--clipboard or -c controls clipboard sharing:

--clipboard true
--clipboard false

--sound or -s controls playback of remote audio:

--sound true
--sound false

The Boolean options require an explicit value. true, yes, on, and 1 mean enabled; false, no, off, and 0 mean disabled. These values are case-insensitive.

Examples

Open a saved connection in full screen:

rdpcli start "Workstation" --full-screen true

Open a saved connection at a specific resolution with clipboard sharing disabled:

rdpcli start "Workstation" \
    --resolution 1600x1000 \
    --clipboard false

Connect directly to a host using a particular account and port:

rdpcli connect rdp.example.com \
    --port 3390 \
    --account alice

Connect using a password supplied through an environment variable:

RDP_PASSWORD='secret' \
rdpcli connect rdp.example.com \
    --account alice \
    --password-env RDP_PASSWORD

Version information

To print the installed application version:

rdpcli --version