keyboard
Type text or press named keys (enter, escape, arrow keys) on iOS simulators, Android emulators, TV devices, and Chromium apps. Use secret placeholders to type credentials securely.
Instructions
Type text or press special keys on the device (iOS simulator, Android emulator or device, Chromium app, Vega Virtual Device, or Apple TV / Android TV) using keyboard events. Use when you need to enter text or trigger a named key such as enter, escape, or arrow keys. On Vega and Apple TV / Android TV, prefer the remote tools for D-pad navigation; use keyboard to type into a focused text field (e.g. a search or login box). Returns { typed: string, keys: number }. Fails if an unsupported key name is provided or the device's input backend is not reachable.
text: types a string (supports uppercase, digits, common punctuation). To type a credential, use
{{secret:<NAME>}}— resolved server-side from theARGENT_SECRET_<NAME>env var (prefix mandatory;{{secret:APP_PASSWORD}}↔ARGENT_SECRET_APP_PASSWORD), so the plaintext never enters agent context; the result echoes the placeholder, not the value, and the after-typing auto-screenshot is skipped.key: presses a single named key (enter, escape, backspace, tab, arrow-up/down/left/right, f1–f12) — NOT supported on TV targets; move focus with
tv-remoteinstead. On a TV target (runtimeKind 'tv') onlytextapplies — focus a text field first (withtv-remote), then type into it (injected HID keyboard on Apple TV,adb input texton Android TV). Provide text, key, or both — when both are given, the text is typed first and the key is pressed after it (text + key:"enter" types and submits).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Named key to press: enter, escape, backspace, tab, space, arrow-up, arrow-down, arrow-left, arrow-right, f1–f12. When combined with `text`, the key is pressed AFTER the text is typed (so text + enter types and submits). Not supported on TV targets — move focus with `tv-remote` (up/down/left/right) instead. | |
| text | No | Text to type character by character. Handles uppercase and common punctuation. To type a credential without its plaintext ever entering your context, use a secret placeholder: `{{secret:<NAME>}}` types the value of the `ARGENT_SECRET_<NAME>` environment variable set on the machine running the tool-server — e.g. text: "{{secret:APP_PASSWORD}}" types the value of `ARGENT_SECRET_APP_PASSWORD`. Only env vars with the `ARGENT_SECRET_` prefix are resolvable. Placeholders can be embedded in longer text and are never echoed back resolved. If the secret you need is not set, ask the user to export it as `ARGENT_SECRET_<NAME>` and restart the session — NEVER ask the user to paste the secret value into the conversation. | |
| udid | Yes | Target device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id). | |
| delayMs | No | Delay in ms between key presses (default 50). Ignored on Android phones/tablets (typed via `adb input text`, which has no per-key cadence), on Vega (text/keys injected in a single shot), and on TV targets (Apple TV / Android TV type the whole string at the daemon's own cadence). |