---
title: "pols computer"
description: "Use a sandbox's desktop: screenshots, mouse and keyboard"
---

<!-- Generated by scripts/reference.mjs from the pols CLI's --help. Do not edit; run `npm run reference:sync`. -->

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

```text
pols computer [flags]
pols computer [command]
```

## Examples

```sh
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`](#pols-computer-click) | Click at X Y |
| [`pols computer double-click`](#pols-computer-double-click) | Double-click at X Y |
| [`pols computer drag`](#pols-computer-drag) | Drag with the left button from X1 Y1 to X2 Y2 |
| [`pols computer key`](#pols-computer-key) | Press keys or key chords |
| [`pols computer screenshot`](#pols-computer-screenshot) | Save a PNG screenshot of the whole desktop |
| [`pols computer scroll`](#pols-computer-scroll) | Scroll the mouse wheel with the pointer at X Y |
| [`pols computer type`](#pols-computer-type) | Type text as keystrokes |

## Flags

```text
-h, --help   help for computer
```

## pols computer click

Click at X Y

### Usage

```text
pols computer click SANDBOX X Y [flags]
```

### Flags

```text
    --button string   left, middle or right (default left)
-h, --help            help for click
```

## pols computer double-click

Double-click at X Y

### Usage

```text
pols computer double-click SANDBOX X Y [flags]
```

### Flags

```text
    --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

```text
pols computer drag SANDBOX X1 Y1 X2 Y2 [flags]
```

### Flags

```text
-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

```text
pols computer key SANDBOX KEYS... [flags]
```

### Examples

```sh
pols computer key web ctrl+l
pols computer key web ctrl+a BackSpace
```

### Flags

```text
-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

```text
pols computer screenshot SANDBOX [flags]
```

### Flags

```text
-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

```text
pols computer scroll SANDBOX X Y up|down|left|right [flags]
```

### Flags

```text
    --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

```text
pols computer type SANDBOX [TEXT] [flags]
```

### Examples

```sh
pols computer type web 'hello world'
printf 'line 1\nline 2\n' | pols computer type web --stdin
```

### Flags

```text
-h, --help    help for type
-i, --stdin   read the text from stdin
```

The [global flags](/reference/cli/#global-flags) work with this command too.
