← 返回
开发者工具 中文

Agent Tool Scout

Give AI hands to control any Mac app. Auto-discover installed apps, generate CLI wrappers, return structured JSON. Works with Music, Finder, Chrome, Word, Fi...
赋予AI操控Mac应用的能力,自动发现已安装程序并生成CLI封装,返回结构化JSON。支持Music、Finder、Chrome、Word等。
mileszhang001-boom mileszhang001-boom 来源
开发者工具 clawhub v0.2.0 1 版本 99887.4 Key: 无需
★ 0
Stars
📥 887
下载
💾 12
安装
1
版本
#latest

概述

TRIGGER SCENARIOS — When to Use CLAM

Rule: ANY mention of a Mac app → try CLAM first. Never say "there's no MCP for this app".

User saysWhat you do
------------------------
"用QQ音乐播放周杰伦"clam_find_app("QQ音乐")clam_installclam_execute
"帮我查微信消息"clam_find_app("微信")clam_installclam_execute
"整理我的邮件 / clean up inbox"clam_find_app("mail") → install → read + categorize → confirm
"今天有什么日程 / what's on my plate"clam_find_app("calendar") → install → read events
"用 Finder 整理 Downloads"clam_find_app("finder") → install → list → plan → confirm → move
"Spotify 播放爵士乐"clam_find_app("spotify") → install → execute
"在 Chrome 打开网页"clam_find_app("chrome") → install → execute
"钉钉发消息给张三"clam_find_app("钉钉") → install → execute

Anti-patterns (never do):

  • ❌ Say "QQ音乐没有 MCP 支持" — call clam_find_app("QQ音乐") first
  • ❌ Write AppleScript directly — use clam_execute instead
  • ❌ Call clam_scan() for discovery — use clam_find_app() (instant, <10ms)

Standard workflow:

clam_find_app(app_name)   # Always start here — instant, no file I/O
    ↓ if not installed
clam_install(app_id)      # ~10 seconds, auto-selects best mode
    ↓ to discover commands
clam_info(app_id)         # Lists all available commands and properties
    ↓ to act
clam_execute(app_id, cmd) # Returns JSON, never raw AppleScript

CLAM — Give AI Hands to Control Mac Apps

You can control any macOS application through CLAM. It auto-discovers scriptable apps on the user's Mac, generates CLI wrappers on the fly, and returns structured JSON — all without API keys or manual configuration.

Setup

If clam is not yet installed, run:

pip install clam-mac

What You Can Do

1. Discover what apps are controllable

clam --json scan

This returns a JSON array of all controllable apps with their command count, property count, and mode (full / ui / basic).

2. Install a CLI wrapper for any app

clam install music         # fuzzy match: "chrome" → "google-chrome"

This auto-generates a typed CLI with dozens to hundreds of commands. Takes ~10 seconds, zero configuration.

3. Execute commands and read structured data

clam-music play
clam-music set-sound-volume 50
clam-music --json get-current-track    # → full JSON with 15+ fields
clam-finder --json open ~/Documents
clam-google-chrome --json get-url      # → current tab URL

Every command returns JSON when called with --json. Use this for reasoning and decision-making.

4. Check command reliability before calling

clam --json doctor music

This tells you which commands are fully supported vs. which have parameter type issues. Only call commands marked as supported: true for reliable results.

Command Pattern

clam --json scan                        # discover apps
clam --json info <app>                  # list all commands for an app
clam install <app>                      # install wrapper (if not already)
clam-<app> --json <command> [args]      # execute
clam --json doctor <app>                # reliability check

Three Modes

  • Full mode: Apps with .sdef scripting definitions (Music, Finder, Chrome, Word) → dozens to hundreds of commands
  • UI Scripting mode: Apps without .sdef but with accessible menus (Figma, Slack, VS Code, Spotify) → menu-click automation
  • Basic mode: Fallback for all .app bundles (WeChat, DingTalk, WPS) → activate, quit, open file, get version

The install command auto-selects the best mode. You don't need to specify it.

Scenarios — What Users Will Ask You To Do

When the user makes a request involving their Mac apps, follow this pattern:

  1. Install the relevant app wrappers (if not already installed)
  2. Use clam --json info to discover available commands
  3. Execute commands and use the JSON output for reasoning
  4. Present results in a clean, human-readable format

Morning Briefing

User says something like: "What's on my plate today?" / "今天有什么?"

Install and read from three apps:

  • Calendar: install → read today's events (times, titles, attendees)
  • Mail: install → read unread messages (sender, subject, date)
  • Reminders: install → read incomplete reminders (title, due date)

Synthesize into a concise daily brief. Group by urgency. Keep it short — this is a glance, not a report. All read-only, zero risk.

Email Triage

User says: "Help me clean up my inbox" / "帮我整理收件箱"

  1. Read all unread messages from Mail
  2. Categorize: needs reply / FYI only / can archive
  3. Show the categorization to the user FIRST — do not take action without confirmation
  4. After user confirms: archive safe emails, mark FYI as read
  5. Leave important emails untouched in inbox

Critical rule: never delete emails. Archive only. Always ask before acting.

Organize Downloads

User says: "Clean up my Downloads folder" / "帮我整理 Downloads"

  1. Use Finder to list all files in ~/Downloads (name, size, date, type)
  2. Categorize: documents, images, installers, code, temp files
  3. Show the plan to the user FIRST — list what goes where
  4. After user confirms: create subfolders, move files
  5. Flag old temp files for deletion but do NOT delete without explicit permission

Play Music

User says: "Play some jazz" / "我想听周杰伦的晴天"

  1. Install Music wrapper
  2. Search the user's music library for matching tracks
  3. Play the result
  4. Confirm what's now playing (track name, artist, album)

This is the simplest scenario — immediate action, instant audio feedback.

General App Control

For any other request involving a Mac app:

  1. Run clam scan to check if the app is controllable
  2. Run clam info to see what commands exist
  3. Install if needed, then execute

Always use --json for structured output. Always show the user what you're about to do before taking destructive actions (delete, move, send).

Important Notes

  • macOS only — requires osascript (built-in on all Macs)
  • Some commands require Automation permission: System Settings > Privacy & Security > Automation
  • UI Scripting commands require Accessibility permission: System Settings > Privacy & Security > Accessibility
  • Commands execute via AppleScript with a 30-second timeout
  • Always use --json flag for structured output when processing results programmatically

Lobster Pipeline Example

CLAM-generated CLIs are standard shell commands, usable as Lobster pipeline steps:

steps:
  - run: clam-music set-sound-volume 20
  - run: clam-music play
  - run: clam-finder open ~/Projects/current

版本历史

共 1 个版本

  • v0.2.0 当前
    2026-03-18 22:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Doubao Podcast TTS

mileszhang001-boom
用于调用豆宝/字节跳动播客TTSAPI生成音频,解析WebSocket二进制帧,处理流式音频块,提取audio_url...
★ 0 📥 385
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,086 📥 813,833
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,383 📥 320,874