dialog

dialog is a command for coding agents from openclaw/Peekaboo. It costs 0 tokens per session (1,661 once invoked), scanned A, original, MIT.

A command group for inspecting and controlling macOS dialogs through Peekaboo. It can work with buttons, text fields, and file chooser dialogs such as Open and Save windows.

In plain words
What is it for?
Clicking dialog buttons, entering or clearing text, selecting files or folders, driving Open and Save panels, and verifying saved files.
Why use it?
It removes repetitive manual dialog handling while keeping targeted actions separate from global keyboard or coordinate control.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/openclaw/peekaboo/dialog
Clone the repo
git clone --depth 1 https://github.com/openclaw/Peekaboo

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dialog

README.md
[![agentmods](https://agentmods.dev/badge/commands/openclaw/peekaboo/dialog.svg)](https://agentmods.dev/commands/openclaw/peekaboo/dialog)
Your own site
<a href="https://agentmods.dev/commands/openclaw/peekaboo/dialog"><img src="https://agentmods.dev/badge/commands/openclaw/peekaboo/dialog.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01661
Opus 5 $0.00000 $0.00830
Sonnet 5 $0.00000 $0.00332
Haiku 4.5 $0.00000 $0.00166

Measured 3d ago against content hash 7dfe62474ba0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dialog scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/dialog.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

peekaboo dialog

dialog wraps DialogService so you can programmatically inspect, click, set text in, dismiss, or drive file dialogs without re-running see. Exact targeted click, non-forced dismiss, and input stay in the background by default. Global keyboard/coordinate paths are never implicit: targetless input, file, and dismiss --force require --foreground.

Subcommands

Name Purpose Key options
click Press a dialog button with AX. --button <exact label> and an app/PID/window target are required; --foreground may focus first but never enables pointer fallback.
input Set text in a dialog field. --text plus an app/PID/window target default to background AXValue. Use --foreground only for targetless/global keyboard input. Optional --field <label> or --index <0-based> and --clear.
file Drive NSOpenPanel/NSSavePanel style dialogs. --foreground is required; an app/PID/window target is optional and recommended. Supports --path <dir>, --name <filename>, --select <button>, --ensure-expanded, and --timeout <duration>. Save-like actions verify the file exists and return saved_path.
dismiss Close the current dialog. Normal dismissal requires a target and uniquely resolves one cancel/close AXPress button in the background. --force --foreground explicitly sends global Escape.
list Read dialog metadata (buttons, text fields, static text) without focusing or mutating it. Optional --app/--pid, optional --window-id/--window-title/--window-index, and --timeout <duration>.

Implementation notes

  • Every dialog list form is read-only/background and creates no mutation or snapshot debt. A targeted list must resolve exactly one dialog; ambiguity reports candidate window IDs.
  • Static text includes nested AXStaticText descendants of the resolved dialog in depth-first child order, once per AX element. Extraction follows structural children and does not enter other application/window roots. It uses the first nonblank string from AXValue, AXTitle, AXLabel, then AXDescription, preserving the selected string's whitespace; button labels and editable field values remain in their separate lists. Alert message and informative text do not replace the dialog's own title.
  • When an exact titled parent AX window contains one structural child sheet or alert, Peekaboo treats that child as the active dialog while retaining the parent window receipt. The parent remains targetable when it has no structural child, and multiple child dialogs remain ambiguous. If a blank-title transient sheet CGWindow ID does not resolve, use the titled parent AX window ID reported by window list.
  • Default background click and non-forced dismiss use Bridge protocol 1.25's two-phase contract: a read-only prepare operation uniquely upgrades app/PID/title selectors to one exact process-generation/window receipt and retains the raw AX window, dialog, and button identities under a short-lived one-shot token.
  • Immediately before AXPress, Peekaboo consumes the token, reacquires the exact-window write lane, re-enumerates and compares all three raw AX identities, and rechecks owner generation, window bounds, enabled state, and AXPress support. It never falls back to the physical pointer, clipboard, focus, or global input.
  • Success is confirmed only after the retained dialog or sheet disappears. An accepted press without a verified postcondition is retry-unsafe and requires fresh observation; planning or identity ambiguity is a retry-safe pre-dispatch refusal.
  • Remote targeted list/prepare/click/dismiss require the exact advertised and enabled operation, not merely a 1.25 version number. Missing capabilities refuse before operation transport.
  • Exact targeted dialog input resolves and revalidates one process-generation/window target, then sets the selected field through background AXValue. Targetless input uses global keyboard delivery and requires --foreground (or foreground: true over MCP).
  • dialog file and forced dismissal use global keyboard or coordinate events and therefore require foreground consent. For compatibility with interactive foreground workflows, input and file may target the current dialog only in that foreground mode. Receipt-pinned background click and non-forced dismiss never allow a targetless path.
  • Button clicks and text entry route through services.dialogs helpers, which return dictionaries describing what happened; JSON output exposes those details verbatim (button, field, text_length, etc.).
  • dialog input accepts either a field label (--field) or an index; when neither is provided it targets the first text field. --clear replaces the value directly in background AXValue mode; the targetless foreground route uses Cmd+A/Delete before typing.
  • dialog file can both navigate to a path and fill the filename field, then clicks the action button you specify (--select Save, --select Open, etc.). Leave --path blank to simply confirm the current directory.
  • dialog file defaults to clicking the dialog’s OKButton when --select is omitted (or set to default). Prefer this when you don’t want to guess whether the button is labeled “Save”, “Open”, “Choose”, etc.
  • --ensure-expanded expands the dialog (Show Details) before applying --path. If no PathTextField is present, Peekaboo falls back to the standard “Go to Folder…” shortcut to reliably land in the requested directory.
  • For save-like actions (resolved by the actual clicked button title), dialog file verifies that the saved file appears on disk (5s timeout). On success it returns saved_path and saved_path_verified=true. If you provided --path + --name, Peekaboo also enforces that the file landed in the requested directory (symlinks like /tmp/private/tmp are normalized).
  • JSON output includes additional provenance for debugging without screenshots, including dialog_identifier, found_via, button_identifier, saved_path_found_via, and path_navigation_method (e.g. path_textfield_typed+fallback_go_to_folder).
  • dialog list is invaluable before scripting a dialog: it prints button titles, placeholders, and static text so you can pick stable labels instead of guessing.

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · +1 lines 7dfe62474ba0
  2. 4d ago First seen · 70 lines · 0 tokens per session scan A c3b290fee47e

Subscribe to this mod's changes

dialog is a command published in the GitHub repository openclaw/Peekaboo (5,105 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,661 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.