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
- Editing
- Function keys
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
Mode 2: Paste file from path
Mode 3: Paste from stdin pipe
File type handling
Image files
Images are added to clipboard in both PNG and TIFF 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:Workflow examples
Fill form and submit
Navigate and search
Copy and paste between apps
Upload file
Send message with attachment
Terminal automation
Multi-step keyboard navigation
Tips
There’s a small delay (50ms) between each key argument to ensure proper processing.