rdp-cli
Run an AI Agent From Your Phone While Your Laptop Is Closed
You can run an AI agent from your phone without keeping your laptop open.
The practical setup is to run the AI agent on an always-on remote host, then use your phone to open the same session, review progress and take over when necessary.
With rdp-cli, an agent can control authorized RDP, VNC, X11 or Android sessions without opening a local desktop viewer. The remote session can remain available while you access it through an authorized browser.
This setup is useful for remote AI coding agents, long-running GUI workflows and desktop applications that require visual interaction.
How Does Running an AI Agent from Your Phone Work?
The phone usually acts as a control and access device. The AI agent, its files and its working environment remain on a remote computer or server.
Phone browser
↓
Authorized Web Viewer
↓
Remote host running the AI agent and rdp-cli
↓
RDP, VNC, X11 or Android target
The remote host running the AI agent must remain awake and connected. Closing your laptop does not keep a process alive if that process is still running locally on the laptop.
Why Close the Laptop?
Running an agent directly on your laptop can create several problems:
- Closing the lid may suspend the computer.
- Sleep mode can interrupt the task.
- A local GUI agent may move your mouse.
- The active window may change unexpectedly.
- Long builds or exports may stop when the laptop disconnects.
- You may need to stay near the computer for approvals.
A separate remote session keeps the agent away from your local desktop. Your laptop can be closed as long as the remote agent host remains available.
What You Need Before Starting
Prepare:
- An always-on computer or server for the AI agent
- An existing RDP, VNC, X11 or Android target
- Network access through a trusted LAN or VPN
- rdp-cli installed on the machine running the agent or control service
- Remote credentials
- A recovery procedure for interrupted tasks
For Windows RDP, the target computer must allow Remote Desktop connections. Android automation requires authorized ADB over USB or Wi-Fi.
See the rdp-cli Quick Start Guide for setup details.
How to Run an AI Agent Remotely
1. Connect to the Remote Desktop
Run rdp-cli on the remote agent host or control machine.
For an existing Windows RDP server:
$secret = Read-Host 'Password' -AsSecureString
try {
[System.Net.NetworkCredential]::new('', $secret).Password |
.\rdp-cli.exe connect --host REMOTE_HOST --user REMOTE_USER --password-stdin
} finally {
$secret.Dispose()
}
Save the returned session ID. Later commands use this ID to address the correct remote desktop.
Never place passwords directly in shell history or source code.
2. Capture the Current Screen
Before the agent performs an action, capture the current state:
.\rdp-cli.exe screenshot --session SESSION --out .\before.png
The agent should inspect the latest screenshot instead of assuming that the application is ready.
3. Let the Agent Work Without a Viewer
Normal agent commands do not require an open desktop window.
Use this workflow:
Capture the screen
→ Perform one action
→ Capture a fresh screenshot
→ Verify the result
Example:
.\rdp-cli.exe click --session SESSION --desktop --x X --y Y --observation OBSERVATION
.\rdp-cli.exe screenshot --session SESSION --out .\after-click.png
A successful click only confirms that input was dispatched. It does not prove that the application completed the task.
Keep a Long-Running AI Agent Working
Before closing your laptop:
- Start the AI agent on the remote host.
- Open the target application or terminal.
- Connect the rdp-cli session.
- Save the session ID and task status.
- Capture an initial screenshot.
- Disable sleep on the remote agent host.
- Close the local viewer or laptop.
rdp-cli supports persistent remote sessions. Closing a read-only viewer keeps the remote session connected, but rdp-cli does not restart an AI process that has exited.
If the session reconnects or control changes, the agent must capture a fresh screenshot before sending new input. See the rdp-cli Features page for session behavior.
Human Takeover from Your Phone
This guide explains how to keep an AI agent working after you close your laptop. It does not repeat the complete pause, takeover and handoff procedure.
For detailed human takeover steps, read Watch, Pause and Take Over an AI Agent’s Remote Desktop.
To open the same session from a phone browser, run this command on the remote agent or control host:
.\rdp-cli.exe watch --session SESSION --viewer web
Then open the authorized Web Viewer through your LAN or VPN on your phone.
The viewer starts in read-only mode. You can pause the Agent, take control, make a correction and release control afterward.
For a related phone-control reference, see Control an Android Phone with an AI Agent over USB or Wi-Fi.
Recover an Interrupted Agent Session
A long-running Agent may need recovery after a network interruption, reconnection or human takeover.
The recovery flow is:
Check session status
→ Reconnect if needed
→ Capture a fresh screenshot
→ Verify the current state
→ Resume the Agent
For detailed recovery commands and error handling, see Troubleshoot RDP Connections, Black Screens and Blocked Input.
The rdp-cli Features page also explains persistent sessions and fresh observations after reconnection or control changes.
Transfer Files While the Agent Keeps Working
rdp-cli can upload project files and download generated results through supported sessions.
The basic workflow is:
Upload the input files
→ Let the remote application process them
→ Check transfer status
→ Download the result
For supported protocols and file-transfer capabilities, see the rdp-cli Features page.
For exact upload, status and download commands, see the rdp-cli Command Documentation.
What This Setup Does Not Do
Running an AI agent from your phone does not mean that:
- The phone runs the full AI model
- rdp-cli creates a remote computer
- Every coding agent automatically receives a mobile interface
- The remote host can sleep during the task
- rdp-cli restarts an Agent process after a crash
- A disconnected remote server will continue running indefinitely
rdp-cli provides the remote session, screenshots, input, file transfer and control handoff. The AI agent remains responsible for reasoning and task planning.
FAQ
Can I run an AI agent from my phone?
Yes. Run the agent on an always-on remote host and use your phone to open and control the same authorized session through a browser.
Does closing my laptop stop a remote AI coding agent?
No, if the AI agent is running on a separate remote host that remains awake and connected.
Can I control a long-running AI agent from mobile?
Yes. You can open the same session, inspect the desktop, pause the agent, take control, correct the workflow and return control afterward.
Does rdp-cli include an AI model?
No. rdp-cli provides remote desktop connections, screenshots, input, file transfer and session control. The AI model comes from your selected agent.
Can rdp-cli control Windows and Android?
Yes. rdp-cli supports authorized RDP, VNC, X11 and Android sessions. Android devices connect through authorized ADB over USB or Wi-Fi. See the rdp-cli Command Documentation.
Final Takeaway
You can close your laptop and keep an AI agent working, but the agent needs a separate remote execution environment.
The practical workflow is:
Run the agent on an always-on remote host
→ Connect with rdp-cli
→ Capture and verify the remote screen
→ Close the laptop
→ Open the Web Viewer from your phone
→ Take over only when needed
With rdp-cli, your phone becomes a convenient access point while the AI agent continues working on the remote desktop.
Download rdp-cli and keep your long-running AI workflows available wherever you are.