# Tools

Every tool a machine offers, grouped by risk class. An agent may call a tool only when its grant and the machine's ceiling both allow the tool's class.

## Risk classes

| Class | Meaning |
| --- | --- |
| `read` | Looks, changes nothing. |
| `write` | Creates or changes files. |
| `destructive` | Removes or stops something. |
| `exec` | Runs a program: can do anything the user can. |
| `network` | Reaches other hosts on the network. |
| `screen` | Sees the machine's screen and windows. Opt-in: never in the default ceiling. |
| `control` | Moves the pointer, presses keys, types, opens apps. Opt-in like `Screen`. |

## Tools

### `read`

| Tool | What it does |
| --- | --- |
| [`fs_list`](https://docs.cmdop.ai/reference/tools/fs_list.md) | List a folder on the machine: name, kind (file, dir, symlink), size and change time of each entry, sorted by name. |
| [`fs_read`](https://docs.cmdop.ai/reference/tools/fs_read.md) | Read a file on the machine, exactly as stored: text as text, anything else as base64. |
| [`fs_search`](https://docs.cmdop.ai/reference/tools/fs_search.md) | Find files under a folder by name pattern (`*`, `?`) and/or by plain text inside them; returns paths, and with content the first matching line. |
| [`fs_stat`](https://docs.cmdop.ai/reference/tools/fs_stat.md) | Facts about one file or folder without reading it: kind, size, change and creation time, permission bits, whether it is writable, a symlink's target; with… |
| [`journal_search`](https://docs.cmdop.ai/reference/tools/journal_search.md) | What was done on one machine, kept on it: tool calls with their arguments as kept and task starts and ends, by author, tool, task, time and text. |
| [`proc_list`](https://docs.cmdop.ai/reference/tools/proc_list.md) | The processes of the user cmdop runs as that a person or an agent started (shells, their children, agent CLIs), with pid, parent, command line, working… |
| [`sys_info`](https://docs.cmdop.ai/reference/tools/sys_info.md) | What the machine is: host name, OS and version, architecture, CPUs, memory, disks with free space, uptime, the user cmdop runs as and its home folder. |
| [`task_output`](https://docs.cmdop.ai/reference/tools/task_output.md) | A task's screen as text, whether it runs. |

### `write`

| Tool | What it does |
| --- | --- |
| [`fs_edit`](https://docs.cmdop.ai/reference/tools/fs_edit.md) | Replace exact text in a text file (up to 4 MiB): `old` must occur exactly once, or set replace_all. |
| [`fs_write`](https://docs.cmdop.ai/reference/tools/fs_write.md) | Create a file or replace it whole, atomically (a half-written file is never seen). |

### `destructive`

| Tool | What it does |
| --- | --- |
| [`fs_delete`](https://docs.cmdop.ai/reference/tools/fs_delete.md) | Remove a file or folder by moving it to the user's trash (macOS ~/.Trash, Linux the freedesktop trash), so the owner can put it back. |
| [`proc_kill`](https://docs.cmdop.ai/reference/tools/proc_kill.md) | Send a signal to one process of the user cmdop runs as (default term) and wait up to 3 s for it to end. |

### `exec`

| Tool | What it does |
| --- | --- |
| [`exec_run`](https://docs.cmdop.ai/reference/tools/exec_run.md) | Run one command on the machine and wait for it: exit code, stdout and stderr apart, whether it timed out. |
| [`task_start`](https://docs.cmdop.ai/reference/tools/task_start.md) | Start a command in a terminal on the machine. |
| [`task_stop`](https://docs.cmdop.ai/reference/tools/task_stop.md) | Stop a task: SIGTERM to its process group, SIGKILL after 5 seconds. |

### `screen`

| Tool | What it does |
| --- | --- |
| [`screen_capture`](https://docs.cmdop.ai/reference/tools/screen_capture.md) | A screenshot of a display, a window or a region, as a PNG (default longest side 1280 px). |
| [`screen_info`](https://docs.cmdop.ai/reference/tools/screen_info.md) | What can be seen and driven on this machine: displays with size and scale, the frontmost app, the cursor, whether the screen is locked, whether the OS… |
| [`ui_snapshot`](https://docs.cmdop.ai/reference/tools/ui_snapshot.md) | The accessibility tree of a window as text, each element with an id that `ui_act` and the pointer tools accept. |
| [`ui_wait`](https://docs.cmdop.ai/reference/tools/ui_wait.md) | Wait until an element, text or window appears or is gone, or the screen is stable, for at most 30 s. |
| [`window_list`](https://docs.cmdop.ai/reference/tools/window_list.md) | Windows of the apps on screen, front to back: id, app, title, bounds in screen points, focus, whether visible, and whether `control` is allowed for the app. |

### `control`

| Tool | What it does |
| --- | --- |
| [`app_open`](https://docs.cmdop.ai/reference/tools/app_open.md) | Launch or focus an app, or open a file in it. |
| [`control_release`](https://docs.cmdop.ai/reference/tools/control_release.md) | Give control back: release held keys and buttons and end the lease, so the owner can use the machine at once. |
| [`key_press`](https://docs.cmdop.ai/reference/tools/key_press.md) | Press one key with optional modifiers, to the frontmost app. |
| [`pointer_click`](https://docs.cmdop.ai/reference/tools/pointer_click.md) | Click an element or an image pixel (from the latest `screen_capture` of that display; without one, `stale_capture`). |
| [`pointer_drag`](https://docs.cmdop.ai/reference/tools/pointer_drag.md) | Press, drag along a path of image pixels (or between two elements) and release. |
| [`pointer_move`](https://docs.cmdop.ai/reference/tools/pointer_move.md) | Move the pointer without clicking, for hover menus and tooltips. |
| [`pointer_scroll`](https://docs.cmdop.ai/reference/tools/pointer_scroll.md) | Scroll the wheel at an element or an image pixel by lines (-10..10 on each axis). |
| [`text_type`](https://docs.cmdop.ai/reference/tools/text_type.md) | Type text into the focused field. |
| [`ui_act`](https://docs.cmdop.ai/reference/tools/ui_act.md) | Act on an element of the latest `ui_snapshot` by id, through the accessibility API: invoke, set a value, focus, toggle, expand. |
