feat: rewrite remote.py as Rust CLI binary (crates/cli)

This commit is contained in:
Helios 2026-03-06 03:02:22 +01:00
parent ba3b365f4e
commit 98b6fabef6
No known key found for this signature in database
GPG key ID: C8259547CD8309B5
6 changed files with 815 additions and 45 deletions

View file

@ -15,7 +15,7 @@ When Moritz asks to do something on a connected PC:
## Setup
- **Script:** `skills/helios-remote/remote.py`
- **Script:** `skills/helios-remote/helios`
- **Config:** `skills/helios-remote/config.env` (URL + API key, don't modify)
- `SKILL_DIR=/home/moritz/.openclaw/workspace/skills/helios-remote`
@ -31,54 +31,54 @@ When Moritz asks to do something on a connected PC:
SKILL_DIR=/home/moritz/.openclaw/workspace/skills/helios-remote
# List connected devices
python $SKILL_DIR/remote.py devices
$SKILL_DIR/helios devices
# Screenshot → /tmp/helios-remote-screenshot.png
# ALWAYS prefer window screenshots (saves bandwidth)!
python $SKILL_DIR/remote.py screenshot moritz-pc chrome # window by label
python $SKILL_DIR/remote.py screenshot moritz-pc screen # full screen only when no window known
$SKILL_DIR/helios screenshot moritz-pc chrome # window by label
$SKILL_DIR/helios screenshot moritz-pc screen # full screen only when no window known
# List visible windows (use labels for screenshot/focus/maximize)
python $SKILL_DIR/remote.py windows moritz-pc
$SKILL_DIR/helios windows moritz-pc
# Window labels come from the process name (e.g. chrome, discord, pycharm64)
# Duplicates get a number suffix: chrome, chrome2, chrome3
# Use `windows` to discover labels before targeting a specific window
# Focus / maximize a window
python $SKILL_DIR/remote.py focus moritz-pc discord
python $SKILL_DIR/remote.py maximize moritz-pc chrome
$SKILL_DIR/helios focus moritz-pc discord
$SKILL_DIR/helios maximize moritz-pc chrome
# Minimize all windows
python $SKILL_DIR/remote.py minimize-all moritz-pc
$SKILL_DIR/helios minimize-all moritz-pc
# Shell command (PowerShell, no wrapper needed)
python $SKILL_DIR/remote.py exec moritz-pc "Get-Process"
python $SKILL_DIR/remote.py exec moritz-pc "hostname"
$SKILL_DIR/helios exec moritz-pc "Get-Process"
$SKILL_DIR/helios exec moritz-pc "hostname"
# With longer timeout for downloads etc. (default: 30s)
python $SKILL_DIR/remote.py exec moritz-pc --timeout 600 "Invoke-WebRequest -Uri https://... -OutFile C:\file.zip"
$SKILL_DIR/helios exec moritz-pc --timeout 600 "Invoke-WebRequest -Uri https://... -OutFile C:\file.zip"
# Launch program (fire-and-forget)
python $SKILL_DIR/remote.py run moritz-pc notepad.exe
$SKILL_DIR/helios run moritz-pc notepad.exe
# Ask user to do something (shows MessageBox, blocks until OK)
python $SKILL_DIR/remote.py prompt moritz-pc "Please click Save, then OK"
python $SKILL_DIR/remote.py prompt moritz-pc "UAC dialog coming - please confirm" --title "Action required"
$SKILL_DIR/helios prompt moritz-pc "Please click Save, then OK"
$SKILL_DIR/helios prompt moritz-pc "UAC dialog coming - please confirm" --title "Action required"
# Clipboard
python $SKILL_DIR/remote.py clipboard-get moritz-pc
python $SKILL_DIR/remote.py clipboard-set moritz-pc "Text for clipboard"
$SKILL_DIR/helios clipboard-get moritz-pc
$SKILL_DIR/helios clipboard-set moritz-pc "Text for clipboard"
# File transfer
python $SKILL_DIR/remote.py upload moritz-pc /tmp/local.txt "C:\Users\Moritz\Desktop\remote.txt"
python $SKILL_DIR/remote.py download moritz-pc "C:\Users\Moritz\file.txt" /tmp/downloaded.txt
$SKILL_DIR/helios upload moritz-pc /tmp/local.txt "C:\Users\Moritz\Desktop\remote.txt"
$SKILL_DIR/helios download moritz-pc "C:\Users\Moritz\file.txt" /tmp/downloaded.txt
# Version: compare relay + remote.py + client commits (are they in sync?)
python $SKILL_DIR/remote.py version moritz-pc
# Version: compare relay + helios + client commits (are they in sync?)
$SKILL_DIR/helios version moritz-pc
# Client log (last 100 lines, --lines for more)
python $SKILL_DIR/remote.py logs moritz-pc
python $SKILL_DIR/remote.py logs moritz-pc --lines 200
$SKILL_DIR/helios logs moritz-pc
$SKILL_DIR/helios logs moritz-pc --lines 200
```
## Typical Workflow: UI Task
@ -94,7 +94,7 @@ python $SKILL_DIR/remote.py logs moritz-pc --lines 200
**Never interact with UI blindly.** When you need the user to click something:
```bash
python $SKILL_DIR/remote.py prompt moritz-pc "Please click [Save], then press OK"
$SKILL_DIR/helios prompt moritz-pc "Please click [Save], then press OK"
```
This blocks until the user confirms. Use it whenever manual interaction is needed.