pols computer
Use a sandbox's desktop: screenshots, mouse and keyboard
Computer use on a sandbox’s 1920x1080 desktop, for AI agents and scripts.
Coordinates are pixels from the top left: X is 0-1919, Y is 0-1079. Actions
print nothing on success (with --json, the action that ran).
Usage
pols computer [flags]
pols computer [command]
Examples
pols computer screenshot web -o before.png
pols computer click web 960 540
pols computer type web 'hello world'
pols computer key web ctrl+l
pols computer scroll web 960 540 down --amount 5
Subcommands
| Command | Description |
|---|---|
pols computer click |
Click at X Y |
pols computer double-click |
Double-click at X Y |
pols computer drag |
Drag with the left button from X1 Y1 to X2 Y2 |
pols computer key |
Press keys or key chords |
pols computer screenshot |
Save a PNG screenshot of the whole desktop |
pols computer scroll |
Scroll the mouse wheel with the pointer at X Y |
pols computer type |
Type text as keystrokes |
Flags
-h, --help help for computer
pols computer click
Click at X Y
Usage
pols computer click SANDBOX X Y [flags]
Flags
--button string left, middle or right (default left)
-h, --help help for click
pols computer double-click
Double-click at X Y
Usage
pols computer double-click SANDBOX X Y [flags]
Flags
--button string left, middle or right (default left)
-h, --help help for double-click
pols computer drag
Drag with the left button from X1 Y1 to X2 Y2
Usage
pols computer drag SANDBOX X1 Y1 X2 Y2 [flags]
Flags
-h, --help help for drag
pols computer key
Press keys, one after the other. Keys are X keysym names such as Return, Escape, Tab, BackSpace, Page_Down or F5; join them with + for a chord.
Usage
pols computer key SANDBOX KEYS... [flags]
Examples
pols computer key web ctrl+l
pols computer key web ctrl+a BackSpace
Flags
-h, --help help for key
pols computer screenshot
Save a PNG screenshot of the sandbox’s whole 1920x1080 desktop, pointer included, to a unique file (default screenshot-<unique>.png) or to stdout with -o -.
Usage
pols computer screenshot SANDBOX [flags]
Flags
-h, --help help for screenshot
-o, --output string file to write, or - for stdout (default screenshot-<unique>.png)
pols computer scroll
Scroll the mouse wheel with the pointer at X Y
Usage
pols computer scroll SANDBOX X Y up|down|left|right [flags]
Flags
--amount int wheel clicks (1-50) (default 3)
-h, --help help for scroll
pols computer type
Type TEXT, or with --stdin the text read from stdin, as keystrokes into the
focused window (up to 10000 characters, about 80 per second).
Usage
pols computer type SANDBOX [TEXT] [flags]
Examples
pols computer type web 'hello world'
printf 'line 1\nline 2\n' | pols computer type web --stdin
Flags
-h, --help help for type
-i, --stdin read the text from stdin
The global flags work with this command too.