记忆设置:为 AI 智能体启用持久上下文 - Openclaw Skills
2026-08-17 3452437
2026-08-17 0
该技能实现了远程 CalDAV 提供商与本地命令行环境之间的无缝集成。通过利用 Openclaw Skills,开发人员和高级用户可以直接从终端与 iCloud、Google、Fastmail 和 Nextcloud 日历进行交互。它利用 vdirsyncer 作为强大的同步引擎来处理本地目录与远程服务器之间的双向更新,而 khal 则提供用于列出、搜索和创建日历事件的主要界面。
该工具集专为 Linux 环境设计,在基于云的日程安排服务与基于终端的生产力工作流之间架起了一座桥梁。它允许通过本地 .ics 文件存储离线访问日历数据,确保 Openclaw Skills 即使在没有活动互联网连接的情况下也能通过与缓存数据交互来运行。
下载入口:https://github.com/openclaw/skills/tree/main/skills/asleep123/caldav-calendar从源直接安装技能的最快方式。
npx clawhub@latest install caldav-calendar
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 caldav-calendar。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
要开始在 Linux 上使用此技能,请使用包管理器安装必要的二进制文件:
sudo apt update && sudo apt install vdirsyncer khal
~/.config/vdirsyncer/config 创建配置文件,并为您的特定提供商(例如 iCloud 或 Google)定义 storage 和 pair 部分。~/.config/khal/config 创建 khal 配置,指向 vdirsyncer 使用的本地存储路径。vdirsyncer discover
vdirsyncer sync
该技能通过配置文件、原始 .ics 文件和本地缓存数据库的组合来组织日历数据:
| 组件 | 用途 | 默认路径 |
|---|---|---|
| vdirsyncer 配置 | 定义远程同步配对和身份验证 | ~/.config/vdirsyncer/config |
| khal 配置 | 定义日历显示和区域设置 | ~/.config/khal/config |
| ICS 存储 | 原始日历事件文件 (.ics) | ~/.local/share/vdirsyncer/calendars/ |
| 元数据状态 | 跟踪同步状态 | ~/.local/share/vdirsyncer/status/ |
| 事件缓存 | khal 用于快速查找的 SQLite 数据库 | ~/.local/share/khal/khal.db |
name: caldav-calendar
description: Sync and query CalDAV calendars (iCloud, Google, Fastmail, Nextcloud, etc.) using vdirsyncer + khal. Works on Linux.
metadata: {"clawdbot":{"emoji":"??","os":["linux"],"requires":{"bins":["vdirsyncer","khal"]},"install":[{"id":"apt","kind":"apt","packages":["vdirsyncer","khal"],"bins":["vdirsyncer","khal"],"label":"Install vdirsyncer + khal via apt"}]}}
vdirsyncer syncs CalDAV calendars to local .ics files. khal reads and writes them.
Always sync before querying or after making changes:
vdirsyncer sync
khal list # Today
khal list today 7d # Next 7 days
khal list tomorrow # Tomorrow
khal list 2026-01-15 2026-01-20 # Date range
khal list -a Work today # Specific calendar
khal search "meeting"
khal search "dentist" --format "{start-date} {title}"
khal new 2026-01-15 10:00 11:00 "Meeting title"
khal new 2026-01-15 "All day event"
khal new tomorrow 14:00 15:30 "Call" -a Work
khal new 2026-01-15 10:00 11:00 "With notes" :: Description goes here
After creating, sync to push changes:
vdirsyncer sync
khal edit is interactive — requires a TTY. Use tmux if automating:
khal edit "search term"
khal edit -a CalendarName "search term"
khal edit --show-past "old event"
Menu options:
s → edit summaryd → edit descriptiont → edit datetime rangel → edit locationD → delete eventn → skip (save changes, next match)q → quitAfter editing, sync:
vdirsyncer sync
Use khal edit, then press D to delete.
For scripting:
khal list --format "{start-date} {start-time}-{end-time} {title}" today 7d
khal list --format "{uid} | {title} | {calendar}" today
Placeholders: {title}, {description}, {start}, {end}, {start-date}, {start-time}, {end-date}, {end-time}, {location}, {calendar}, {uid}
khal caches events in ~/.local/share/khal/khal.db. If data looks stale after syncing:
rm ~/.local/share/khal/khal.db
~/.config/vdirsyncer/config)Example for iCloud:
[general]
status_path = "~/.local/share/vdirsyncer/status/"
[pair icloud_calendar]
a = "icloud_remote"
b = "icloud_local"
collections = ["from a", "from b"]
conflict_resolution = "a wins"
[storage icloud_remote]
type = "caldav"
url = "https://caldav.icloud.com/"
username = "[email protected]"
password.fetch = ["command", "cat", "~/.config/vdirsyncer/icloud_password"]
[storage icloud_local]
type = "filesystem"
path = "~/.local/share/vdirsyncer/calendars/"
fileext = ".ics"
Provider URLs:
https://caldav.icloud.com/google_calendar storage typehttps://caldav.fastmail.com/dav/calendars/user/EMAIL/https://YOUR.CLOUD/remote.php/dav/calendars/USERNAME/~/.config/khal/config)[calendars]
[[my_calendars]]
path = ~/.local/share/vdirsyncer/calendars/*
type = discover
[default]
default_calendar = Home
highlight_event_days = True
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d
vdirsyncer discover # First time only
vdirsyncer sync