关于 findmy
findmy 是通过 macOS 上的 Find My 应用查看 Apple 设备和 AirTag 位置的技能,适用于检查设备位置或跟踪物品移动。它使用 AppleScript、屏幕截图和视觉分析,而非 CLI 或 API。
主要功能
- 01打开 Find My 并切换页面
- 02通过截图读取设备和物品位置
- 03使用 Peekaboo 辅助界面自动化
- 04定期记录 AirTag 位置以整理路线
适用场景
- 01查看 iPhone、iPad、Mac 或 AirPods 的位置
- 02检查 AirTag 标记物品的位置
- 03按时间记录 AirTag 的移动路线
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ nousresearch/ hermes-agent --skill findmy安装后在 Claude Code 中输入/findmy确认已加载。
详细介绍
Find My(Apple)
通过 macOS 上的 FindMy.app 跟踪 Apple 设备和 AirTag。由于 Apple 没有为 FindMy 提供命令行工具,此技能会使用 AppleScript 打开应用,并通过屏幕截图读取设备位置。
前提条件
- macOS,已登录 iCloud,且安装了 Find My 应用
- 设备/AirTag 已在 Find My 中注册
- 为终端授予屏幕录制权限(系统设置 → 隐私与安全性 → 屏幕录制)
- 可选但推荐:安装
peekaboo,以便更好地自动化操作界面:brew install steipete/tap/peekaboo
适用场景
- 用户询问“我的[设备/猫/钥匙/包]在哪里?”
- 跟踪 AirTag 位置
- 检查设备位置(iPhone、iPad、Mac、AirPods)
- 随时间监控宠物或物品的移动情况(AirTag 巡逻路线)
方法 1:AppleScript + 截图(基础)
打开 FindMy 并导航
# Open Find My app
osascript -e 'tell application "FindMy" to activate'
# Wait for it to load
sleep 3
# Take a screenshot of the Find My window
screencapture -w -o ~/.hermes/cache/scratch/findmy.png
然后使用 vision_analyze 读取截图:
vision_analyze(image_url="~/.hermes/cache/scratch/findmy.png", question="What devices/items are shown and what are their locations?")
在标签页之间切换
# Switch to Devices tab
osascript -e '
tell application "System Events"
tell process "FindMy"
click button "Devices" of toolbar 1 of window 1
end tell
end tell'
# Switch to Items tab (AirTags)
osascript -e '
tell application "System Events"
tell process "FindMy"
click button "Items" of toolbar 1 of window 1
end tell
end tell'
方法 2:Peekaboo UI 自动化(推荐)
如果已安装 peekaboo,请使用它进行更可靠的界面交互:
# Open Find My
osascript -e 'tell application "FindMy" to activate'
sleep 3
# Capture and annotate the UI
peekaboo see --app "FindMy" --annotate --path ~/.hermes/cache/scratch/findmy-ui.png
# Click on a specific device/item by element ID
peekaboo click --on B3 --app "FindMy"
# Capture the detail view
peekaboo image --app "FindMy" --path ~/.hermes/cache/scratch/findmy-detail.png
然后使用视觉功能进行分析:
vision_analyze(image_url="~/.hermes/cache/scratch/findmy-detail.png", question="What is the location shown for this device/item? Include address and coordinates if visible.")
工作流:随时间跟踪 AirTag 位置
监控 AirTag 时(例如跟踪猫的巡逻路线):
# 1. Open FindMy to Items tab
osascript -e 'tell application "FindMy" to activate'
sleep 3
# 2. Click on the AirTag item (stay on page — AirTag only updates when page is open)
# 3. Periodically capture location
while true; do
screencapture -w -o ~/.hermes/cache/scratch/findmy-$(date +%H%M%S).png
sleep 300 # Every 5 minutes
done
使用视觉功能分析每张截图以提取坐标,然后汇总成路线。
限制
- FindMy 没有命令行工具或 API,必须使用界面自动化
- 只有在 FindMy 页面处于活动显示状态时,AirTag 才会更新位置
- 位置精度取决于 FindMy 网络中附近的 Apple 设备
- 截图需要屏幕录制权限
- AppleScript 界面自动化可能会因 macOS 版本不同而失效
规则
- 跟踪 AirTag 时,让 FindMy 应用保持在前台(最小化后将停止更新)
- 使用
vision_analyze读取截图内容,不要尝试解析像素 - 如需持续跟踪,请使用 cronjob 定期捕获并记录位置
- 尊重隐私,只跟踪用户拥有的设备/物品
评论
支持 Markdown