Skip to content

Commit c3ec0bb

Browse files
authored
new commands: click, type, move mouse, press key, scroll, drag mouse (#28)
1 parent d107fa0 commit c3ec0bb

File tree

6 files changed

+686
-4
lines changed

6 files changed

+686
-4
lines changed

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,50 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
241241

242242
- `kernel browsers extensions upload <id or persistent id> <extension-path>...` - Ad-hoc upload of one or more unpacked extensions to a running browser instance.
243243

244+
### Browser Computer Controls
245+
246+
- `kernel browsers computer click-mouse <id or persistent id>` - Click mouse at coordinates
247+
- `--x <coordinate>` - X coordinate (required)
248+
- `--y <coordinate>` - Y coordinate (required)
249+
- `--num-clicks <n>` - Number of clicks (default: 1)
250+
- `--button <button>` - Mouse button: left, right, middle, back, forward (default: left)
251+
- `--click-type <type>` - Click type: down, up, click (default: click)
252+
- `--hold-key <key>` - Modifier keys to hold (repeatable)
253+
- `kernel browsers computer move-mouse <id or persistent id>` - Move mouse to coordinates
254+
- `--x <coordinate>` - X coordinate (required)
255+
- `--y <coordinate>` - Y coordinate (required)
256+
- `--hold-key <key>` - Modifier keys to hold (repeatable)
257+
- `kernel browsers computer screenshot <id or persistent id>` - Capture a screenshot
258+
- `--to <path>` - Output file path for the PNG image (required)
259+
- `--x <coordinate>` - Top-left X for region capture (optional)
260+
- `--y <coordinate>` - Top-left Y for region capture (optional)
261+
- `--width <pixels>` - Region width (optional)
262+
- `--height <pixels>` - Region height (optional)
263+
- `kernel browsers computer type <id or persistent id>` - Type text on the browser instance
264+
265+
- `--text <text>` - Text to type (required)
266+
- `--delay <ms>` - Delay in milliseconds between keystrokes (optional)
267+
268+
- `kernel browsers computer press-key <id or persistent id>` - Press one or more keys
269+
270+
- `--key <key>` - Key symbols to press (repeatable)
271+
- `--duration <ms>` - Duration to hold keys down in ms (0=tap)
272+
- `--hold-key <key>` - Modifier keys to hold (repeatable)
273+
274+
- `kernel browsers computer scroll <id or persistent id>` - Scroll the mouse wheel
275+
276+
- `--x <coordinate>` - X coordinate (required)
277+
- `--y <coordinate>` - Y coordinate (required)
278+
- `--delta-x <pixels>` - Horizontal scroll amount (+right, -left)
279+
- `--delta-y <pixels>` - Vertical scroll amount (+down, -up)
280+
- `--hold-key <key>` - Modifier keys to hold (repeatable)
281+
282+
- `kernel browsers computer drag-mouse <id or persistent id>` - Drag the mouse along a path
283+
- `--point <x,y>` - Add a point as x,y (repeatable)
284+
- `--delay <ms>` - Delay before dragging starts in ms
285+
- `--button <button>` - Mouse button: left, middle, right (default: left)
286+
- `--hold-key <key>` - Modifier keys to hold (repeatable)
287+
244288
### Extension Management
245289

246290
- `kernel extensions list` - List all uploaded extensions
@@ -330,6 +374,27 @@ kernel browsers fs upload my-browser --file "local.txt:remote.txt" --dest-dir "/
330374

331375
# List files in a directory
332376
kernel browsers fs list-files my-browser --path "/tmp"
377+
378+
# Click the mouse at coordinates (100, 200)
379+
kernel browsers computer click-mouse my-browser --x 100 --y 200
380+
381+
# Double-click the right mouse button
382+
kernel browsers computer click-mouse my-browser --x 100 --y 200 --num-clicks 2 --button right
383+
384+
# Move the mouse to coordinates (500, 300)
385+
kernel browsers computer move-mouse my-browser --x 500 --y 300
386+
387+
# Take a full screenshot
388+
kernel browsers computer screenshot my-browser --to screenshot.png
389+
390+
# Take a screenshot of a specific region
391+
kernel browsers computer screenshot my-browser --to region.png --x 0 --y 0 --width 800 --height 600
392+
393+
# Type text in the browser
394+
kernel browsers computer type my-browser --text "Hello, World!"
395+
396+
# Type text with a 100ms delay between keystrokes
397+
kernel browsers computer type my-browser --text "Slow typing..." --delay 100
333398
```
334399

335400
### Extension management

0 commit comments

Comments
 (0)