drag

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

A command for carrying out drag-and-drop actions on the macOS desktop through Peekaboo. It can drag from an interface element or screen coordinates to another element, coordinates, or an app.

In plain words
What is it for?
Dragging files or interface items between locations, dropping items into apps such as the Trash, and controlling gesture duration, steps, and keyboard modifiers.
Why use it?
It automates drag gestures that are difficult to express as ordinary clicks or typed input, while requiring explicit permission to use the shared cursor.

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/drag
Clone the repo
git clone --depth 1 https://github.com/openclaw/Peekaboo
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 891 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.00891
Opus 5 $0.00000 $0.00445
Sonnet 5 $0.00000 $0.00178
Haiku 4.5 $0.00000 $0.00089

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

Security

Grade A, and why

drag 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/drag.md · 55 lines

How it starts

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

peekaboo drag

drag simulates click-and-drag gestures with the shared physical cursor. It always affects the foreground desktop and requires explicit --foreground consent.

Key options

Flag Description
--from <id-or-x,y> Source element ID or coordinates.
--to <id-or-x,y> / --to-app <name> Destination element, coordinates, or app. Use --to-app Trash for Dock drops.
--snapshot <id> Needed whenever IDs are involved. Defaults to the most recent snapshot otherwise.
--foreground Required confirmation that Peekaboo may use the shared physical cursor.
Target flags --app <name>, --pid <pid>, --window-id <id>, --window-title <title>, --window-index <n> — focus a specific app/window before dragging. (--window-title/--window-index require --app or --pid; --window-id does not.)
--duration <duration> Drag length (default 500ms; bare values are milliseconds).
--steps <count> Number of interpolation points (default 20) to control smoothness.
--modifiers cmd,shift,… Comma-separated list of modifier keys held during the drag.
--button left|right Mouse button held during the drag (default left).
--profile <linear|human> human enables natural-looking arcs and jitter; defaults to linear.
Focus flags FocusCommandOptions ensure the correct window is frontmost before the drag starts.

Implementation notes

  • Input validation enforces “pick exactly one source and one destination flavor,” so you can’t accidentally mix coordinate + ID on the same side.
  • When you pass --to-app, the command resolves the app’s focused window via AX and drags to its midpoint; Trash is handled specially by scraping the Dock’s accessibility hierarchy.
  • Element IDs are resolved through AutomationServiceBridge.waitForElement (5 s timeout) and use the element’s bounds midpoint as the drag point.
  • Modifiers are validated and normalized to cmd|shift|option|ctrl|fn; aliases command|alt|control are accepted.
  • --profile human chooses adaptive duration/samples and posts drag events along the generated curve; --steps is honored up to the 96-sample safety cap.
  • Results are logged in both human-readable form and JSON (DragResult) with start/end coordinates, duration, steps, modifiers, execution time, and fromTargetPoint/toTargetPoint diagnostics when either endpoint resolves from a snapshot element.

Read the full file on GitHub · 55 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 First seen · 55 lines · 0 tokens per session scan A c39e35b4126c

Subscribe to this mod's changes

drag is a command published in the GitHub repository openclaw/Peekaboo (5,098 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 891 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.