Xpersona
A

Apple Icloud Suite

CLAWHUB · Unverified

Apple iCloud 全套服务操作:日历、照片、iCloud Drive、设备查找、提醒事项。 Use when: (1) 用户要求查看/创建/修改/删除日历事件或日程, (2) 用户说"帮我看看今天有什么安排"/"加个日程"/"改一下会议时间", (3) 用户要求查找/下载/管理 iCloud 照片, (4... Skill: Apple Icloud Suite Owner: lovensky1992-wk Summary: Apple iCloud 全套服务操作:日历、照片、iCloud Drive、设备查找、提醒事项。 Use when: (1) 用户要求查看/创建/修改/删除日历事件或日程, (2) 用户说"帮我看看今天有什么安排"/"加个日程"/"改一下会议时间", (3) 用户要求查找/下载/管理 iCloud 照片, (4... Tags: latest:1.1.0 Version history: v1.1.0 | 2026-05-06T06:36:48.003Z | user Weekly sync v1.0.0 | 2026-04-26T12:31:59.150Z | user Weekly sync v1.0.7 | 2026-04-19T04:04:38.204Z | user Daily sync v1.0.6

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17dsprt4znvnqphy9hhy68va983nsqs:apple-icloud-suite
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-lovensky1992-wk-apple-icloud-suite/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

148,336 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: Apple iCloud Suite
description: >
  Apple iCloud 全套服务操作:日历、照片、iCloud Drive、设备查找、提醒事项。
  Use when: (1) 用户要求查看/创建/修改/删除日历事件或日程,
  (2) 用户说"帮我看看今天有什么安排"/"加个日程"/"改一下会议时间",
  (3) 用户要求查找/下载/管理 iCloud 照片,
  (4) 用户提到"查找我的设备"/"手机在哪"/"定位设备",
  (5) 用户要求操作 iCloud Drive 文件(上传/下载/查看),
  (6) 用户讨论 Apple 生态下的日程管理、照片整理、文件同步。
  NOT for: Android 设备管理、Google Calendar/Photos、
  非 Apple 生态的云存储(OneDrive/Google Drive)、钉钉日历(用 mcporter)。
icon: 🍎
os: linux, macos
tools: pyicloud, caldav, icloudpd
install: |
  pip install pyicloud caldav icalendar  # 核心依赖
  pip install icloudpd                    # 照片批量下载(可选)
---

# Apple iCloud Suite

iCloud 日历、照片、Drive、设备查找的命令行操作。

## Step 0: 依赖与认证检查

### 1. 依赖验证
```bash
python3 -c "import pyicloud; print('pyicloud OK')" 2>/dev/null || echo "需安装: pip install pyicloud"
python3 -c "import caldav; print('caldav OK')" 2>/dev/null || echo "需安装: pip install caldav icalendar"
```

### 2. Session 缓存检查(优先复用,避免 2FA)
```bash
ls ~/.pyicloud/ 2>/dev/null && echo "有缓存 session" || echo "无缓存,需新认证"
```
- 有缓存 → 尝试直接连接,通常无需 2FA
- 无缓存 → 需要首次认证(见下方认证流程)

### 3. 认证方式(两条路径)

| 工具 | 认证方式 | 密码类型 |
|------|---------|---------|
| **pyicloud**(照片/Drive/设备) | 主密码 + 2FA 验证码 | Apple ID 主密码 |
| **CalDAV**(日历) | 应用专用密码 | appleid.apple.com 生成 |

**🔴 密码安全**:从环境变量读取,不硬编码
```bash
export ICLOUD_EMAIL="user@icloud.com"
export ICLOUD_PASSWORD="xxx"  # 或用 keychain
```

### 4. pyicloud 认证
```python
from pyicloud import PyiCloudService
import os
os.environ['icloud_china'] = '1'  # 中国大陆用户必须
api = PyiCloudService(os.environ['ICLOUD_EMAIL'], os.environ['ICLOUD_PASSWORD'], china_mainland=True)

if api.requires_2fa:
    # ⚠️ 需要用户参与:在 iPhone 上查看验证码
    code = input("请输入 iPhone 上收到的 6 位验证码: ")
    api.validate_2fa_code(code)
```

**确认点**:2FA 需要用户手动输入验证码。提前告知用户准备 iPhone。

## Step 1: 需求分类

| 用户意图 | 服务 | 跳转 |
|----------|------|------|
| "今天有什么安排" / "加个日程" | **日历** | → Step 2,读 `references/calendar.md` |
| "下载照片" / "看看相册" | **照片** | → Step 2,读 `references/photos.md` |
| "手机在哪" / "查找设备" | **设备查找** | → Step 2,读 `references/findmy.md` |
| "iCloud 文件" / "下载文档" | **Drive** | → Step 2,读 `references/drive.md` |

## Step 2: 执行(按需加载详细文档)

根据 Step 1 的分类,**读取对应 reference 文件** 获取详细操作指令:

| 服务 | Reference | 认证工具 | 主要脚本 |
|------|-----------|---------|---------|
| 📅 日历 | `references/calendar.md` | CalDAV | `scripts/icloud_calendar.py` |
| 📷 照片 | `references/photos.md` | pyicloud | `scripts/icloud-photos.py` |
| 📱 设备 | `references/findmy.md` | pyicloud | `scripts/icloud_tool.py` |
| 💾 Drive | `references/drive.md` | pyicloud | `scripts/icloud_tool.py` |
| 🔧 脚本总览 | `references/scripts.md` | — | 所有脚本用法 |

### 脚本选择指南

| 场景 | 用哪个脚本 |
|------|-----------|
| 设备查找 / Drive 浏览 | `scripts/icloud_tool.py`(通用工具) |
| 照片浏览/下载 | `scripts/icloud-photos.py`(照片专用) |
| 日历操作 | `scripts/icloud_calendar.py`(CalDAV) |
| 提醒事项 | `scripts/icloud-reminders.py` |
| 备忘录(有限) | `scripts/icloud-notes.py`(⚠️ Apple Notes API 有限) |

## Step 3: 验证与交付

1. 确认操作成功(文件已下载/事件已创建/设备已定位)
2. 展示结果给用户
3. 照片/文件 → 用 `MEDIA:<path>` 发送
4. 日

README.md

# 🍎 Apple iCloud Suite

命令行访问 Apple iCloud 服务,同时提供基于 iCloud 的家庭协作场景。

## ✅ 实测验证 (2026-02-05)

| 功能 | 状态 | 说明 |
|------|------|------|
| 📷 照片 | ✅ 可用 | 浏览相册、下载照片 |
| 💾 iCloud Drive | ✅ 可用 | 浏览和下载文件 |
| 📱 查找设备 | ✅ 可用 | 列出所有设备位置 |
| 📅 日历 | ✅ 可用 | 读取/创建/删除事件 (CalDAV) |



## 快速开始

```bash
# 安装依赖
pip install pyicloud caldav icalendar

# 设置环境变量
export ICLOUD_USERNAME="your@email.com"
export ICLOUD_PASSWORD="主密码"
export ICLOUD_APP_PASSWORD="xxxx-xxxx-xxxx-xxxx"  # 应用专用密码
export AMAP_API_KEY="你的高德API Key"              # 逆地理编码
```

### 基础工具

```bash
# 照片
python scripts/icloud_tool.py photos albums
python scripts/icloud_tool.py photos list 10
python scripts/icloud_tool.py photos download 1

# iCloud Drive
python scripts/icloud_tool.py drive list

# 设备
python scripts/icloud_tool.py devices

# 日历
python scripts/icloud_calendar.py today
python scripts/icloud_calendar.py new 2026-03-01 10:00 11:00 "开会"
python scripts/icloud_calendar.py search "开会"
```

### 状态墙

```bash
# 首次配置(含高德API Key)
python scripts/status_wall.py init

# 获取当前位置坐标 + 高德地名验证(在家/公司分别运行一次)
python scripts/status_wall.py show-gps

# 启动后台守护进程
python scripts/status_wall.py start

# 查看运行状态
python scripts/status_wall.py status

# 停止
python scripts/status_wall.py stop
```

**状态判定优先级**:
- P1 日程读取:私人日历有日程 → 直接展示日程名
- P2 物理锚点:Find My GPS + 高德逆地理编码 → 语义化地点

**双向通勤模式**:
- 上班:离开家(>200m) → 1分钟轮询 →「🚗 正在上班途中(当前:xx)」→ 到公司(<100m)
- 下班:离开公司(>200m) → 1分钟轮询 →「🚗 正在下班途中,距离家 Xkm(当前:xx)」→ 到家(<100m)

## 中国大陆用户

```bash
export ICLOUD_CHINA=1
```

## 文件结构

```
├── SKILL.md               # 完整文档 (Skill Prompt)
├── scripts/
│   ├── icloud_tool.py     # 主工具 (照片/Drive/设备)
│   ├── icloud_calendar.py # 日历工具 (CalDAV)
│   └── status_wall.py     # 状态墙守护进程
```

## 认证说明

| 凭证 | 用途 | 获取方式 |
|------|------|---------|
| Apple ID 主密码 | 照片/Drive/设备/GPS定位 | Apple ID 登录密码 |
| 应用专用密码 | CalDAV 日历读写 | [appleid.apple.com](https://appleid.apple.com) 生成 |
| 高德 API Key | 逆地理编码(坐标→地名) | [lbs.amap.com](https://lbs.amap.com/) 创建 Web 服务 Key |

- **GPS 坐标**:中国区 Find My 返回 GCJ-02 坐标,高德 API 原生支持,无需转换
- 配置地点时需用 `show-gps` 实地获取坐标

## 文档

- [完整文档](SKILL.md)

## License

MIT

_meta.json

{
  "ownerId": "kn7cy12yzara9p2s370vsanfe9824vnm",
  "slug": "apple-icloud-suite",
  "version": "1.1.0",
  "publishedAt": 1778049408003
}

references/calendar.md

## 📅 Part 4: 日历 (CalDAV) ✅ 已验证

日历功能使用 CalDAV 协议直接访问 iCloud 日历,**需要应用专用密码**。

### 🎉 测试结果

```
📅 日历列表:
  1. 📁 大麦
  2. 📁 提醒 ⚠️
  3. 📁 哔哩哔哩
  4. 📁 携程
  5. 📁 个人
  6. 📁 工作

共 6 个日历

📅 今天的事件 (2026-02-05):
  📌 和sissi吃芈重山
     📆 2026-02-05 20:00-21:00
```

### 使用 icloud_calendar.py

```bash
# 设置环境变量
export ICLOUD_USERNAME="your@email.com"
export ICLOUD_APP_PASSWORD="xxxx-xxxx-xxxx-xxxx"  # 应用专用密码!

# 列出日历
python icloud_calendar.py list

# 查看今天事件
python icloud_calendar.py today

# 查看未来 N 天
python icloud_calendar.py week 7

# 创建事件
python icloud_calendar.py new 2026-02-10 10:00 11:00 "开会"
python icloud_calendar.py new 2026-02-10 "全天事件"

# 搜索事件
python icloud_calendar.py search 会议
```

### ⚠️ 重要:日历需要应用专用密码

日历功能使用 CalDAV 协议,需要**应用专用密码**(不是主密码):

1. 登录 https://appleid.apple.com
2. 进入「登录与安全」→「应用专用密码」
3. 点击「+」生成新密码
4. 复制密码(格式: `xxxx-xxxx-xxxx-xxxx`)

### 配置 vdirsyncer (可选)

创建 `~/.config/vdirsyncer/config`:

```ini
[general]
status_path = "~/.local/share/vdirsyncer/status/"

[pair icloud_calendar]
a = "icloud_calendar_remote"
b = "icloud_calendar_local"
collections = ["from a", "from b"]
conflict_resolution = "a wins"

[storage icloud_calendar_remote]
type = "caldav"
url = "https://caldav.icloud.com/"
username = "your@email.com"
# 使用应用专用密码
password.fetch = ["command", "cat", "~/.config/vdirsyncer/icloud_password"]

[storage icloud_calendar_local]
type = "filesystem"
path = "~/.local/share/vdirsyncer/calendars/"
fileext = ".ics"
```

### 配置 khal

创建 `~/.config/khal/config`:

```ini
[calendars]
[[icloud]]
path = ~/.local/share/vdirsyncer/calendars/*
type = discover

[default]
default_calendar = Home
highlight_event_days = True

[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
```

### 日历命令

```bash
# 首次设置
vdirsyncer discover
vdirsyncer sync

# 查看事件
khal list                       # 今天
khal list today 7d              # 未来7天

# 创建事件
khal new 2026-01-15 10:00 11:00 "会议"

# 同步
vdirsyncer sync
```

---

## 🏠 Part 5: 家庭共享日历场景 (Skill Prompts)

> **核心思路**:在 iCloud 中新建一个 **共享日历**(如"家庭看板"),所有场景统一往这个日历里写事件。  
> 家庭成员订阅后,iPhone 日历 App 自动同步,实现零成本的家庭信息中枢。

### 前置约定

| 项目 | 值 |
|------|-----|
| 共享日历名 | 用户指定(如 `家庭看板`),通过参数 `--calendar` 传入 |
| 工具 | `icloud_calendar.py` 的 CalDAV 能力 |
| 排序技巧 | 全天事件按标题字母序排列,可用特殊前缀控制顺序(如 `!` < `A`) |
| 去重逻辑 | 创建前先 `search` 同名事件,存在则跳过或更新,避免重复 |
| 完成标记 | 删除事件 **或** 将标题改为 `✅ 原标题` |

---

### 场景一:家庭琐事公告栏 📋

> 把日历当「冰箱上的便签纸」——每条琐事 = 一个全天事件

**触发方式**:用户说出待办琐事(如"帮我记一下要取快递"、"提醒交电费")

**Prompt 模板**:

```
你是家庭助手。用户提到一件家庭琐事时,请执行:

1. 确定任务内容,为其选择合适的 emoji 前缀:
   📦 快递/取件  👕 洗衣/收衣  ⚡️ 缴费  🛒 购物/采购
   🧹 打扫/清洁  🍳 做饭/食材  🐾 宠物  📮 其他

2. 先调用 search 检查今天的共享日历中是否已有同名事件(去重)
   python icloud_calendar.py search "<emoji> <任务>" --calendar "家庭看板"

3. 若不存在,创建全天事件:
   python icloud_calendar.py new today "<emoji> <任务>" --calendar "家庭看板"

4. 若用户说"xx已完成/搞定了",删除对应事件或将标题改为 "✅ <原标题>"

示例输出:
  用户:"要取快递"
  → 创建全天事件「📦 取快递」到 家庭看板
  
  用户:"快递取了"
  → 标记「📦 取快递」→「✅ 📦 取快递」或直接删除
```

---

### 场景二:回家雷达 🚗

> 通过查找设备获取 GPS → 计算预计到家时间 → 日历事件实时显示 ETA

**触发方式**:用户说"我出发了"/"我要回家了",

references/drive.md

## 💾 Part 2: iCloud Drive ✅ 已验证

### 浏览文件

```python
#!/usr/bin/env python3
import os
os.environ['icloud_china'] = '1'
from pyicloud import PyiCloudService

api = PyiCloudService('your@email.com', 'password', china_mainland=True)

# 处理双重认证...

# 列出根目录
drive = api.drive
for item in drive.dir():
    print(f'📂 {item}')

# 进入子目录
subfolder = drive['Downloads']
for item in subfolder.dir():
    print(f'  📄 {item}')
```

### 下载文件

```python
# 下载文件
file = drive['文件名.pdf']
with file.open(stream=True) as response:
    with open('本地文件.pdf', 'wb') as f:
        f.write(response.raw.read())
```

---

Sponsored

Ads related to Apple Icloud Suite and adjacent AI workflows.