rdp-cli
How to Use RDP Automation with Codex
How to Use RDP Automation with Codex
Codex can plan the task, but it cannot see or click a Windows desktop by itself. With rdp-cli, it can connect to an RDP session, inspect screenshots, perform controlled input, move files, and verify the result.
Connect safely
Keep the RDP password out of prompts and command history:
$pw = Read-Host "RDP password"
$connection = $pw | .\rdp-cli.exe connect --host 192.0.2.20 --user USER --password-stdin | ConvertFrom-Json
$session = $connection.data.session
Keep the returned session ID for later commands.
Observe before input
Capture the desktop before choosing a window or coordinate:
$shot = .\rdp-cli.exe screenshot --session $session --out .\before.png | ConvertFrom-Json
$observation = $shot.data.observation
Let Codex inspect the fresh image. After each click or typing command, take another screenshot and use the newest observation. Do not reuse coordinates from an old screen.
Move files directly
Structured transfer is usually more reliable than file-dialog automation:
.\rdp-cli.exe files upload --session $session --local .\sales.xlsx --path sales.xlsx
.\rdp-cli.exe files download --session $session --path report.xlsx --local .\report.xlsx
Check the transfer result and verify the final file.
Keep a human takeover path
.\rdp-cli.exe watch --session $session --viewer window
.\rdp-cli.exe pause --session $session
Pause on unexpected dialogs, login prompts, or destructive actions. The next screenshot and the final file are the evidence that the remote task actually succeeded.