Skip to main content
Keyboard commands send keyboard input directly to applications without targeting specific UI elements.

key

Send keystrokes and keyboard shortcuts to an application.

Arguments

string
required
Application name or bundle identifier
string[]
required
Keys to send - can be plain text, special keys, or modifier combinations

Options

boolean
Output as JSON

Examples

Output

Keyboard syntax

Plain text

Text without modifiers is typed character by character:

Modifier combinations

Combine modifiers with +:
modifier
Command key (⌘)
modifier
Control key (⌃)
modifier
Option/Alt key (⌥)
modifier
Shift key (⇧)

Special keys

  • return / enter - Return/Enter key
  • tab - Tab key
  • escape / esc - Escape key
  • space - Space bar
  • left - Left arrow
  • right - Right arrow
  • up - Up arrow
  • down - Down arrow
  • home - Home key
  • end - End key
  • pageup - Page Up
  • pagedown - Page Down

Modifier aliases

Multiple aliases are supported:
  • Command: cmd, command
  • Control: ctrl, control
  • Option: alt, option, opt
  • Shift: shift

Common shortcuts

Text editing

Window management

Browser-specific


paste

Paste clipboard contents or file contents into an application.

Arguments

string
required
Application name or bundle identifier
string
Optional file path to paste. If omitted, pastes current clipboard or stdin.

Options

boolean
Output as JSON

Examples

Output

Paste modes

Mode 1: Paste current clipboard

Pastes whatever is currently on the system clipboard.

Mode 2: Paste file from path

Copies the file to clipboard, then pastes it into the app.

Mode 3: Paste from stdin pipe

Reads data from stdin, copies to clipboard, then pastes.

File type handling

Image files

Images are added to clipboard in both PNG and TIFF formats:
Supported formats:
  • PNG (.png)
  • JPEG (.jpg, .jpeg)
  • GIF (.gif)
  • TIFF (.tiff, .tif)
  • BMP (.bmp)
  • WebP (.webp)

Other files

Non-image files are added as file URLs:
The receiving application determines how to handle the file.

Workflow examples

Fill form and submit

Copy and paste between apps

Upload file

Send message with attachment

Terminal automation

Multi-step keyboard navigation

Tips

The app is automatically activated before sending keys, so you don’t need to focus it manually.
For complex input, consider using fill command on specific text fields instead of typing with key.
Use paste for large amounts of text or binary data like images instead of trying to type it.
Keyboard events are sent to the app, not specific elements. Make sure the correct element has focus.
There’s a small delay (50ms) between each key argument to ensure proper processing.
  • fill - Fill text fields directly
  • type - Type into specific elements
  • focus - Set keyboard focus
  • click - Click buttons