Loading...
Loading...
Compare original and translation side by side
agent-nativeswift build -c release && cp .build/release/agent-native /usr/local/bin/agent-nativeswift build -c release && cp .build/release/agent-native /usr/local/bin/agent-native appsagent-native open <app>agent-native apps # Check what's already running
agent-native snapshot Safari -i # Use the already-open browser
agent-native click @n5 # Interact using refs
agent-native snapshot Safari -i # Re-snapshot after UI changesagent-native appsagent-native open <app>agent-native apps # 查看当前运行的应用
agent-native snapshot Safari -i # 使用已打开的浏览器
agent-native click @n5 # 通过引用进行交互
agent-native snapshot Safari -i # UI变化后重新快照agent-native open <app> # Open/activate by name or bundle ID
agent-native open "System Settings"
agent-native open com.apple.Safari # Already-running apps just activateagent-native open <app> # 通过名称或Bundle ID打开/激活应用
agent-native open "System Settings"
agent-native open com.apple.Safari # 已运行的应用仅会被激活agent-native screenshot <app> [path] # Capture app's frontmost window
agent-native screenshot Slack # Saves to /tmp/agent-native-screenshot.png
agent-native screenshot Slack /tmp/slack.png # Custom path
agent-native screenshot Slack --json # {"path": "...", "width": ..., "height": ...}agent-native screenshot <app> [path] # 捕获应用的前置窗口
agent-native screenshot Slack # 保存至/tmp/agent-native-screenshot.png
agent-native screenshot Slack /tmp/slack.png # 自定义保存路径
agent-native screenshot Slack --json # 返回格式:{"path": "...", "width": ..., "height": ...}agent-native key <app> <keys...> # Send keystrokes to an app
agent-native key Slack "Hello world" # Type text
agent-native key Slack cmd+k # Send Cmd+K
agent-native key Slack escape # Special keys: escape, return, tab, delete, up, down, left, right, space
agent-native key Slack cmd+a delete # Chain multiple keys
agent-native key Calculator 5 + 3 return # Multiple keystrokescmdcommandctrlcontrolaltoptionoptshiftagent-native key <app> <keys...> # 向应用发送按键
agent-native key Slack "Hello world" # 输入文本
agent-native key Slack cmd+k # 发送Cmd+K组合键
agent-native key Slack escape # 特殊按键:escape、return、tab、delete、up、down、left、right、space
agent-native key Slack cmd+a delete # 链式发送多个按键
agent-native key Calculator 5 + 3 return # 发送多组按键cmdcommandctrlcontrolaltoptionoptshiftagent-native paste <app> <path> # Copy file to clipboard and Cmd+V into app
agent-native paste Slack /tmp/screenshot.png # Paste image into Slack
agent-native paste Slack ./report.pdf # Paste any fileagent-native paste <app> <path> # 将文件复制到剪贴板并执行Cmd+V粘贴至应用
agent-native paste Slack /tmp/screenshot.png # 将图片粘贴到Slack
agent-native paste Slack ./report.pdf # 粘贴任意类型文件agent-native snapshot <app> # Full AX tree with refs
agent-native snapshot <app> -i # Interactive elements only (recommended)
agent-native snapshot <app> -i -c # Interactive + compact
agent-native snapshot <app> -d 3 # Limit depth
agent-native snapshot <app> -i --json # JSON for parsing| Flag | Description |
|---|---|
| Interactive elements only |
| Compact -- remove empty structural elements |
| Limit tree depth |
| JSON output |
agent-native snapshot <app> # 带引用的完整AX树
agent-native snapshot <app> -i # 仅显示可交互元素(推荐使用)
agent-native snapshot <app> -i -c # 仅显示可交互元素并启用紧凑模式
agent-native snapshot <app> -d 3 # 限制树的深度
agent-native snapshot <app> -i --json # 输出JSON格式用于解析| 参数 | 说明 |
|---|---|
| 仅显示可交互元素 |
| 紧凑模式 -- 移除空的结构元素 |
| 限制树的深度 |
| 输出JSON格式 |
agent-native click @n2 # Click / press
agent-native fill @n3 "text" # Clear field and type
agent-native type @n3 "text" # Type without clearing
agent-native select @n5 "Option A" # Select from dropdown
agent-native check @n4 # Check checkbox (idempotent)
agent-native uncheck @n4 # Uncheck checkbox (idempotent)
agent-native focus @n3 # Focus element
agent-native hover @n2 # Move cursor to element
agent-native action @n7 AXIncrement # Any AX actionagent-native click @n2 # 点击/按下元素
agent-native fill @n3 "text" # 清空输入框后输入文本
agent-native type @n3 "text" # 追加输入文本(不清空原有内容)
agent-native select @n5 "Option A" # 从下拉菜单中选择选项
agent-native check @n4 # 勾选复选框(幂等操作)
agent-native uncheck @n4 # 取消勾选复选框(幂等操作)
agent-native focus @n3 # 聚焦到元素
agent-native hover @n2 # 将光标移动到元素上
agent-native action @n7 AXIncrement # 执行任意AX操作agent-native get text @n1 # Get text / title / label
agent-native get value @n3 # Get input value
agent-native get attr @n2 AXEnabled # Get any AX attribute
agent-native get title Safari # Frontmost window title
agent-native is enabled @n5 # true / false
agent-native is focused @n3 # true / falseagent-native get text @n1 # 获取文本/标题/标签
agent-native get value @n3 # 获取输入框的值
agent-native get attr @n2 AXEnabled # 获取任意AX属性
agent-native get title Safari # 获取前置窗口的标题
agent-native is enabled @n5 # 返回true/false
agent-native is focused @n3 # 返回true/falseagent-native apps # List running GUI apps
agent-native apps --format json # JSON output
agent-native find <app> --role AXButton # Find elements by filter
agent-native find <app> --title "Submit" # Find by title
agent-native inspect @n3 # All attributes and actions
agent-native tree <app> --depth 3 # Raw AX tree (no refs)agent-native apps # 列出当前运行的GUI应用
agent-native apps --format json # 输出JSON格式
agent-native find <app> --role AXButton # 通过筛选条件查找元素
agent-native find <app> --title "Submit" # 通过标题查找元素
agent-native inspect @n3 # 查看元素的所有属性和可执行操作
agent-native tree <app> --depth 3 # 原始AX树(无引用)agent-native wait <app> --title "Apply" --timeout 5
agent-native wait <app> --role AXSheet --timeout 10agent-native wait <app> --title "Apply" --timeout 5
agent-native wait <app> --role AXSheet --timeout 10snapshotsnapshotsnapshotsnapshotagent-native snapshot Arc -i # Auto-detects Chromium, enables AX enhancement
agent-native snapshot "VS Code" -i # Auto-detects Electron, enables AX enhancementsnapshot--remote-debugging-portAXEnhancedUserInterfaceagent-native snapshot Arc -i # 自动检测Chromium,启用AX增强
agent-native snapshot "VS Code" -i # 自动检测Electron,启用AX增强snapshot--remote-debugging-portAXEnhancedUserInterfaceundefinedundefinedundefinedundefinedagent-native ax-enable Arc # Persistently enable AXEnhancedUserInterface
agent-native snapshot Arc -i # Now shows web page elements
agent-native ax-disable Arc # Restore when doneagent-native ax-enable Arc # 持久化启用AXEnhancedUserInterface
agent-native snapshot Arc -i # 现在会显示网页元素
agent-native ax-disable Arc # 使用完成后恢复设置agent-native key Slack cmd+k # Open quick switcher
agent-native key Slack "channel name" return # Type and confirm
agent-native screenshot Slack /tmp/slack.png # Visual confirmation
agent-native get title Slack # Check navigation stateagent-native key Slack cmd+k # 打开快速切换器
agent-native key Slack "channel name" return # 输入频道名称并确认
agent-native screenshot Slack /tmp/slack.png # 视觉确认
agent-native get title Slack # 检查导航状态agent-native paste Slack /path/to/image.png # Copies to clipboard and pastes in one stepagent-native paste Slack /path/to/image.png # 一步完成复制到剪贴板并粘贴的操作-icheckuncheckfilltype-icheckuncheckfilltype