Rdcli — headless RustDesk client CLI written in pure Go (file transfer, shells, TCP tunnels)

Just released rdcli v0.1.0 — a headless RustDesk client written in pure Go that speaks the RustDesk wire protocol directly (no GUI, no official binary).

What it does:

- rdcli devices — list your machines (address book + local tags), online status via rendezvous server

- rdcli -c <id|name|tag> ls / cp / sh / tunnel — remote file listing, copy both directions, one-shot or interactive shells, TCP port forwards

- Reuses the desktop app’s stored login and encrypted password blobs (import-gui)

- Works with self-hosted hbbs/hbbr (–server/–key) and the Pro address-book API

- Strict JSON output + exit codes 0/1/2 — built for scripts and AI agents

The interesting engineering:

- Full port of the protocol: variable-length framing (bytes_codec), NaCl box key exchange + secretbox streams, Ed25519 server-signed identity blobs, TCP simultaneous-open hole punch with hbbr relay fallback

- sha256(sha256(pw+salt)+challenge) login flow, decrypts the GUI’s stored 00… password blobs

- Dependency-light: cobra, protobuf, x/crypto, x/term

Honest limitations: UDP NAT test not implemented (relay fallback always works), terminal requires peer >= 1.4.1, no screen sharing — headless by design.

Note: the “Go Client” botnet reported against RustDesk endpoints (rustdesk/rustdesk#14167) is unrelated to this project — rdcli only connects to machine refs you explicitly provide, with zero scanning or brute-force functionality; the README says so explicitly.

Would appreciate a security review of the handshake code, and feedback on the CLI design. GitHub: GitHub - 4nkitd/rustdesk-cli: Headless RustDesk client CLI — remote file transfer, shells & TCP tunnels from the terminal. Pure Go, no GUI. · GitHub (AGPL-3.0, brew tap, binaries for linux/darwin amd64+arm64).