rdp-cli · 0.1.0

rdp-cli command reference

All 48 commands in rdp-cli 0.1.0: connection, screenshots, input, files, human control and browser access.

This reference follows the verified 0.1.0 command catalog. Platform support and negotiated capabilities still apply; check your installed build before using an option.

Observe, act, verify

The values USER, SESSION, OBSERVATION, X and Y are placeholders. Supply a password to stdin and close the stream; --password-stdin is not an interactive prompt. Save data.session, read before.png, choose coordinates from that image, then read after.png to verify the effect. Input dispatch alone is not task completion.

rdp-cli connect --host desktop.example.net --user USER --password-stdin
rdp-cli screenshot --session SESSION --out before.png
rdp-cli click --session SESSION --desktop --x X --y Y --observation OBSERVATION
rdp-cli screenshot --session SESSION --out after.png

Run --version to identify your build capabilities. --help-json returns the machine-readable catalog; COMMAND --help shows its full option descriptions without starting a session.

rdp-cli --version
rdp-cli --help-json
rdp-cli connect --help

JSON and shared options

Ordinary commands return one UTF-8 JSON object on stdout: ok: true with data, or ok: false with error. stderr contains diagnostics. Exit codes are 0 for success, 1 for an operational failure and 2 for invalid arguments.

Help is plain text. events --follow streams NDJSON; ordinary events returns one JSON result containing data.events and data.ndjson. In Windows PowerShell 5.1, set both [Console]::OutputEncoding and $OutputEncoding to UTF-8 when sending or reading non-ASCII text.

data.session
Keep the session ID returned by connect for later commands.
data.observation
Use the screenshot token for input; capture again after reconnection, control changes or layout changes.
data.capabilities
Inspect negotiated support before choosing files, audio, clipboard or display operations.
data.state / data.remote_outcome
queued, sent, partial, unknown, cancelled and failed describe input progress. remote_outcome: not_confirmed still requires visual verification.
data.transfer_id
Use the transfer ID with files status or files cancel; wait for a terminal transfer state and inspect completed file hashes.
error.code / error.message / error.retryable
Use the stable error code for decisions, the message for context and retryable as a hint, not permission to repeat an action blindly.

All commands accept --request-id and --timeout-ms. Reuse a request ID only with the identical command and arguments within the retention window. A local timeout does not prove that input was never sent; query operations status before retrying.

--request-id ID · --timeout-ms MILLISECONDS

Sessions

connect requires --host and, for RDP, --user. RDP defaults to port 3389; VNC to 5900. For connections requiring password authentication, choose exactly one password source: --password, --password-stdin or --credential-ref. VNC with --vnc-security none uses no password source. --domain is for RDP accounts; --size and --layout are mutually exclusive. --connect-timeout-ms bounds connection setup. reconnect keeps the session paused; disconnect closes the connection without logging off the remote user.

rdp-cli connect#

Create and connect a persistent RDP or VNC session

No session argument.

Command options
OptionFormat and valuesRequirement
--host

Remote host name or IP address

TextRequired
--protocol

Remote desktop protocol

Choice
rdp | vnc
Default: rdp
Optional
--vnc-security

VNC authentication; none requires explicit selection

Choice
vnc-auth | none
Optional
--port

TCP port: RDP 3389, VNC 5900

Positive integer
Default: RDP 3389 · VNC 5900
Optional
--user

Local or domain account; required for RDP

TextOptional
--domain

Windows domain

TextOptional
--password

Password; classic VNC uses the first 8 UTF-8 bytes

TextOptional
--password-stdin

Read password from standard input until EOF

FlagOptional
--cert-policy

RDP server certificate policy; independent of Web HTTPS

Choice
ignore | strict
Default: ignore
Optional
--tls-profile

modern requires TLS 1.2; legacy permits older TLS and cryptography for this session

Choice
modern | legacy
Default: modern
Optional
--credential-ref

Existing platform credential-store reference

TextOptional
--save-credential

Save a successful password with this reference

TextOptional
--name

Readable session name

TextOptional
--size

Desktop WIDTHxHEIGHT

TextOptional
--layout

Monitor layout JSON or @file

TextOptional
--connect-timeout-ms

Connection deadline in milliseconds

Positive integerOptional

rdp-cli connect --help

rdp-cli list#

List sessions visible to the caller

No session argument.

rdp-cli list --help

rdp-cli status#

Get a coherent session status snapshot

Requires --session SESSION.

rdp-cli status --help

rdp-cli reconnect#

Reconnect a non-closed session and remain paused

Requires --session SESSION.

rdp-cli reconnect --help

rdp-cli disconnect#

Close a session without logging off Windows

Requires --session SESSION.

rdp-cli disconnect --help

Viewers and desktop status

watch opens a read-only human viewer; Agent commands do not need it. Select --viewer window or web. presence show/hide controls local desktop status; --floating adds controls and --panel opens the session panel on macOS or Linux. Closing a read-only viewer keeps the connection alive.

rdp-cli watch#

Open or activate a viewer for human observation; not required for Agent commands

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--viewer

Viewer implementation

Choice
window | web
Default: window
Optional

rdp-cli watch --help

rdp-cli presence show#

Show desktop session presence

No session argument.

Command options
OptionFormat and valuesRequirement
--floating

Also show optional floating session controls

FlagOptional
--panel

Also open the session panel on macOS or Linux

FlagOptional

rdp-cli presence show --help

rdp-cli presence hide#

Hide desktop presence without closing sessions

No session argument.

rdp-cli presence hide --help

Control and handoff

pause accepts one --session or --all and revokes human control. resume returns a paused session to its Agent. control take requires the connected viewer ID; release can identify that viewer or a target Agent. Respect a human pause and obtain a fresh screenshot after control is returned.

rdp-cli pause#

Stop normal input and revoke human control

Choose exactly one: --session SESSION or --all.

rdp-cli pause --help

rdp-cli resume#

Return a paused session to its Agent

Requires --session SESSION.

rdp-cli resume --help

rdp-cli control take#

Give a connected viewer the human lease

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--viewer-id

Connected viewer ID, including control-lease owner where applicable

TextRequired

rdp-cli control take --help

rdp-cli control release#

Return the human lease to an Agent

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--viewer-id

Connected viewer ID, including control-lease owner where applicable

TextOptional
--agent-id

Agent receiving control

TextOptional

rdp-cli control release --help

Screenshots, input and clipboard

screenshot writes a PNG with --out and can select --monitor. Coordinate input requires an observation and either monitor-relative coordinates or --desktop coordinates; do not mix both. drag uses from/to coordinates and optional monitor IDs. type accepts exactly one of --text or --text-stdin; --sensitive changes the visible hint, not the screenshot. key accepts --keys or --key with --state. Clipboard writes explicitly replace remote text.

rdp-cli screenshot#

Capture a coherent PNG observation

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--monitor

Monitor ID; screenshot also accepts all

Text
Default: all
Optional
--out

Destination PNG file

PathOptional

rdp-cli screenshot --help

rdp-cli move#

Move the remote pointer

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--x

Remote x coordinate

IntegerRequired
--y

Remote y coordinate

IntegerRequired
--monitor

Monitor ID; screenshot also accepts all

TextOptional
--desktop

Use desktop coordinates instead of monitor-local coordinates

FlagOptional
--observation

Token from a fresh screenshot

TextRequired

rdp-cli move --help

rdp-cli click#

Click at a remote coordinate

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--x

Remote x coordinate

IntegerRequired
--y

Remote y coordinate

IntegerRequired
--button

Mouse button

Choice
left | right | middle
Default: left
Optional
--count

Number of clicks

Positive integerOptional
--monitor

Monitor ID; screenshot also accepts all

TextOptional
--desktop

Use desktop coordinates instead of monitor-local coordinates

FlagOptional
--observation

Token from a fresh screenshot

TextRequired

rdp-cli click --help

rdp-cli scroll#

Scroll at a remote coordinate

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--x

Remote x coordinate

IntegerRequired
--y

Remote y coordinate

IntegerRequired
--delta-x

Signed horizontal wheel units

IntegerOptional
--delta-y

Signed vertical wheel units

IntegerOptional
--monitor

Monitor ID; screenshot also accepts all

TextOptional
--desktop

Use desktop coordinates instead of monitor-local coordinates

FlagOptional
--observation

Token from a fresh screenshot

TextRequired

rdp-cli scroll --help

rdp-cli drag#

Drag between remote coordinates

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--from-x

Start x coordinate

IntegerRequired
--from-y

Start y coordinate

IntegerRequired
--to-x

End x coordinate

IntegerRequired
--to-y

End y coordinate

IntegerRequired
--from-monitor

Starting monitor ID

TextOptional
--to-monitor

Ending monitor ID

TextOptional
--desktop

Use desktop coordinates instead of monitor-local coordinates

FlagOptional
--observation

Token from a fresh screenshot

TextRequired

rdp-cli drag --help

rdp-cli type#

Type Unicode text without replacing the clipboard

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--text

Unicode input or clipboard text

TextOptional
--text-stdin

Read input or clipboard text from standard input until EOF

FlagOptional
--sensitive

Redact text in observable events; screenshots still show the desktop

FlagOptional
--observation

Token from a fresh screenshot

TextRequired

rdp-cli type --help

rdp-cli key#

Send a key combination or key state

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--keys

Key combination such as CTRL+S

TextOptional
--key

Single key name

TextOptional
--state

Key state or audio mute state, as listed

Choice
down | up
Optional
--observation

Token from a fresh screenshot

TextRequired

rdp-cli key --help

rdp-cli clipboard get#

Read remote text clipboard

Requires --session SESSION.

rdp-cli clipboard get --help

rdp-cli clipboard set#

Write remote text clipboard

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--text

Unicode input or clipboard text

TextOptional
--text-stdin

Read input or clipboard text from standard input until EOF

FlagOptional
--observation

Token from a fresh screenshot

TextRequired

rdp-cli clipboard set --help

Files

--path is relative to the session exchange drive, not an arbitrary remote disk. --local names a client file or directory. Replacement requires --overwrite. upload/download return a transfer ID; status without an ID lists transfers. cancel can leave completed files; cleanup removes selected exchange content and can return FILE_BUSY.

rdp-cli files list#

List exchange-drive content

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--path

Path relative to the session file exchange, not an arbitrary remote disk path

PathOptional

rdp-cli files list --help

rdp-cli files upload#

Upload into the session exchange drive

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--local

Local file/directory for upload or download destination

PathRequired
--path

Path relative to the session file exchange, not an arbitrary remote disk path

PathRequired
--overwrite

Allow replacing an existing target

FlagOptional

rdp-cli files upload --help

rdp-cli files download#

Download from the session exchange drive

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--path

Path relative to the session file exchange, not an arbitrary remote disk path

PathRequired
--local

Local file/directory for upload or download destination

PathRequired
--overwrite

Allow replacing an existing target

FlagOptional

rdp-cli files download --help

rdp-cli files status#

Get transfer status

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--transfer-id

Transfer ID; files status without this lists session transfers

TextOptional

rdp-cli files status --help

rdp-cli files cancel#

Cancel a transfer

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--transfer-id

Transfer ID; files status without this lists session transfers

TextRequired

rdp-cli files cancel --help

rdp-cli files cleanup#

Remove selected exchange content

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--path

Path relative to the session file exchange, not an arbitrary remote disk path

PathRequired

rdp-cli files cleanup --help

Sound and microphone

audio status reports negotiated capabilities. mute and volume address one --viewer-id; mute uses on/off and volume uses a positive --percent. audio microphone can only inspect or stop a source. Starting a microphone requires a person to enable it in an authorized viewer while holding control.

rdp-cli audio status#

Get session audio capabilities and sources

Requires --session SESSION.

rdp-cli audio status --help

rdp-cli audio mute#

Mute or unmute one viewer

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--viewer-id

Connected viewer ID, including control-lease owner where applicable

TextRequired
--state

Key state or audio mute state, as listed

Choice
on | off
Required

rdp-cli audio mute --help

rdp-cli audio volume#

Set one viewer's playback gain

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--viewer-id

Connected viewer ID, including control-lease owner where applicable

TextRequired
--percent

Playback gain percentage

Positive integerRequired

rdp-cli audio volume --help

rdp-cli audio microphone#

Query or stop an active microphone source

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--action

Microphone status or stop; start requires a human viewer

Choice
status | stop
Default: status
Optional

rdp-cli audio microphone --help

Displays

monitors returns negotiated topology. monitors set accepts layout JSON or @file; --allow-reconnect permits reconnect when a live layout change is unavailable. Read the resulting topology and take a new screenshot before input. VNC can report its framebuffer but rejects requested layout changes.

rdp-cli monitors#

Get negotiated monitor topology

Requires --session SESSION.

rdp-cli monitors --help

rdp-cli monitors set#

Change monitor topology

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--layout

Monitor layout JSON or @file

TextRequired
--allow-reconnect

Permit reconnect if dynamic monitor layout is unavailable

FlagOptional

rdp-cli monitors set --help

Browser access

web start configures the listener and TLS certificate/key or trusted proxy; --ice-server can repeat. Use LAN/VPN access with HTTPS and authorization outside loopback. access grant requires repeated --permission values and --expires-in seconds. Permissions include session.observe, session.control, clipboard.read/write, files.read/write and audio.listen/send. Revocation stops that grant’s live streams.

rdp-cli web start#

Start the embedded authenticated Web service

No session argument.

Command options
OptionFormat and valuesRequirement
--listen

Listen address

TextOptional
--tls-cert

HTTPS certificate file

PathOptional
--tls-key

HTTPS private-key file

PathOptional
--trust-proxy

Trust the configured proxy

FlagOptional
--ice-server

STUN/TURN URL for WebRTC peers

TextOptional · Repeatable

rdp-cli web start --help

rdp-cli web status#

Get Web service status

No session argument.

rdp-cli web status --help

rdp-cli web stop#

Stop Web access without closing RDP

No session argument.

rdp-cli web stop --help

rdp-cli access grant#

Create a scoped Web grant

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--permission

Permission granted to this access token

TextRequired · Repeatable
--expires-in

Grant lifetime in seconds

Positive integerRequired

rdp-cli access grant --help

rdp-cli access list#

List scoped Web grants

Requires --session SESSION.

rdp-cli access list --help

rdp-cli access revoke#

Revoke a Web grant and its live streams

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--grant-id

Grant identifier

TextRequired

rdp-cli access revoke --help

Operations and events

operations status queries an operation ID or the original request ID when a result is uncertain. It does not repeat input. events reads the stream; --follow keeps it open and --after resumes from a cursor. Verify the remote application separately after a sent result.

rdp-cli operations status#

Query a retained operation result

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--operation-id

Operation identifier

TextOptional
--request-id

Request correlation/idempotency ID; operations status queries the original ID

TextOptional

rdp-cli operations status --help

rdp-cli events#

Read or follow the session event stream

Requires --session SESSION.

Command options
OptionFormat and valuesRequirement
--follow

Keep following new events

FlagOptional
--after

Resume after an event cursor

TextOptional

rdp-cli events --help

Trust, credentials and installation

trust records apply to an exact RDP target and fingerprint in strict certificate mode. credentials remove deletes only the named product credential reference. On macOS and Linux, install-cli/uninstall-cli manage the CLI entry and --prefix chooses the installation location; Windows runs the downloaded executable directly. presence show --panel opens the session panel on macOS and Linux. The saved catalog was verified with the released macOS 0.1.0 CLI; these Linux behaviors were checked against the released Linux implementation. licenses prints the bundled third-party versions and notices.

rdp-cli trust list#

List scoped RDP certificate trust records

No session argument.

rdp-cli trust list --help

rdp-cli trust add#

Trust one target certificate fingerprint

No session argument.

Command options
OptionFormat and valuesRequirement
--target

RDP trust target

TextRequired
--fingerprint

Certificate fingerprint

TextRequired

rdp-cli trust add --help

rdp-cli trust remove#

Remove one target trust record

No session argument.

Command options
OptionFormat and valuesRequirement
--target

RDP trust target

TextRequired

rdp-cli trust remove --help

rdp-cli credentials remove#

Remove one product credential-store item

No session argument.

Command options
OptionFormat and valuesRequirement
--reference

Credential-store reference to remove

TextRequired

rdp-cli credentials remove --help

rdp-cli install-cli#

Install the CLI entry on macOS or Linux

No session argument.

Command options
OptionFormat and valuesRequirement
--prefix

User-controlled installation prefix

PathOptional

rdp-cli install-cli --help

rdp-cli uninstall-cli#

Remove the CLI entry point created by rdp-cli

No session argument.

rdp-cli uninstall-cli --help

rdp-cli licenses#

Show third-party versions and license notices

No session argument.

rdp-cli licenses --help

Protocol and platform conditions

  • RDP defaults to --cert-policy ignore and --tls-profile modern. strict verifies certificate trust/name; legacy is an explicit compatibility choice that permits older TLS. Neither setting changes Web HTTPS verification.
  • VNC rejects --user, --domain, --size, --layout, --cert-policy and --tls-profile. Classic authentication uses the first eight UTF-8 password bytes; unauthenticated access requires explicit --vnc-security none and no password option. Supported VNC transports are not encrypted.
  • VNC does not provide files, audio, microphone or requested display layout changes. Clipboard UTF-8 depends on negotiation; otherwise only Latin-1 is accepted.
  • RDP files require drive redirection; audio, clipboard, microphone and multiple displays also depend on server policy and negotiated capabilities.
  • Windows and macOS offer native viewing and desktop status. Linux native viewing needs a desktop/display service, audio needs the host audio service and saved credentials need Secret Service. A headless host can still use supported CLI operations.
  • Long Unicode input is paced for remote applications. Choose an appropriate timeout and verify the result; changing input method or opening a viewer cannot guarantee that every server accepts every character.

Recover from an error

OBSERVATION_REQUIRED / INVALID_COORDINATES
Capture again, inspect monitor topology and choose valid remote coordinates.
SESSION_PAUSED / CONTROL_HELD_BY_HUMAN
Stop input and respect human control; continue only when the session is deliberately returned to the Agent.
AUTH_FAILED / VNC_AUTH_FAILED
Check the account/password source and remote authentication policy.
RDP_TLS_HANDSHAKE_FAILED / CERTIFICATE_UNTRUSTED
Check server TLS support, certificate policy and the actual fingerprint; do not treat a TLS error as a password error.
CAPABILITY_UNAVAILABLE / CLIPBOARD_ENCODING_UNSUPPORTED
Inspect protocol/capabilities or text encoding and use a supported operation.
REQUEST_TIMEOUT / REQUEST_ID_CONFLICT / REQUEST_WINDOW_EXPIRED
Query the original operation and current screen before retrying. Never reuse an ID for different arguments or assume expired retention still deduplicates.