← 返回
未分类 Key

caldav-sync

Calendar and task management via CalDAV protocol. Query, create, edit, and delete calendar events and todos. Free/busy query, multi-account support.
通过 CalDAV 协议管理日历和任务。可查询、创建、编辑、删除日历事件和待办事项,支持空闲/忙碌查询和多账户。
gzlicanyi
未分类 clawhub v1.0.3 2 版本 100000 Key: 需要
★ 1
Stars
📥 442
下载
💾 0
安装
2
版本
#latest

概述

CalDAV Sync Tool

Manage calendar events and todos via CalDAV protocol. Supports Google Calendar, iCloud, Nextcloud, Fastmail, NetEase (163/126/yeah.net), and any standard CalDAV server.

Configuration

Run the setup script to install dependencies and configure your CalDAV account:

bash setup.sh

If running commands manually without setup.sh, install dependencies first:

npm install --production

Configuration is stored at ~/.config/mail-skills/.env (shared with imap-smtp-email skill). If no shared config is found, the skill falls back to a .env file in the skill directory.

Config file format

# Default account
PROVIDER=163
USERNAME=your@163.com
PASSWORD=your_password
CALDAV_DEFAULT_CALENDAR=

The PROVIDER preset auto-fills the CalDAV server URL. For custom servers:

PROVIDER=custom
USERNAME=your@email.com
PASSWORD=your_password
CALDAV_SERVER_URL=https://your-caldav-server.com/

Multi-Account

You can configure additional accounts in the same config file. Each account uses a name prefix (uppercase) on all variables.

# Work account (WORK_ prefix)
WORK_PROVIDER=gmail
WORK_USERNAME=me@company.com
WORK_PASSWORD=app_password
WORK_CALDAV_DEFAULT_CALENDAR=work

Add --account before the command:

node scripts/caldav.js --account work list-calendars
node scripts/caldav.js --account work list-events --start 2026-01-01 --end 2026-12-31

Supported Providers

ProviderServer URLAuth
---------------------------
Google Calendarhttps://calendar.google.com/calendar/dav/App Password
iCloudhttps://caldav.icloud.com/App-Specific Password
Nextcloudhttps:///remote.php/dav/calendars//Username/Password
Fastmailhttps://caldav.fastmail.com/dav/Username/Password
NetEase (163/126/yeah.net)https://caldav.163.com/Authorization Code
NetEase Enterprise (North)https://caldav.qiye.163.com/Username/Password
NetEase Enterprise (East)https://caldavhz.qiye.163.com/Username/Password

Commands

list-calendars

List all available calendars.

node scripts/caldav.js [--account <name>] list-calendars

list-events

Query events in a time range.

node scripts/caldav.js [--account <name>] list-events --start <date> --end <date> [--calendar <id>] [--force-refresh]

get-event

Get a specific event by UID.

node scripts/caldav.js [--account <name>] get-event --uid <uid> [--calendar <id>]

create-event

Create a new calendar event.

node scripts/caldav.js [--account <name>] create-event --summary <text> --start <datetime> --end <datetime> \
  [--description <text>] [--location <text>] [--calendar <id>]

update-event

Update an existing event.

node scripts/caldav.js [--account <name>] update-event --uid <uid> [--summary <text>] [--start <datetime>] \
  [--end <datetime>] [--description <text>] [--location <text>] [--calendar <id>]

delete-event

Delete an event.

node scripts/caldav.js [--account <name>] delete-event --uid <uid> [--calendar <id>]

list-todos

List all todos/tasks.

node scripts/caldav.js [--account <name>] list-todos [--status <all|pending|completed>] [--calendar <id>] [--force-refresh]

create-todo

Create a new todo/task.

node scripts/caldav.js [--account <name>] create-todo --summary <text> [--due <date>] \
  [--description <text>] [--priority <1-9>] [--calendar <id>]

update-todo

Update an existing todo.

node scripts/caldav.js [--account <name>] update-todo --uid <uid> [--summary <text>] [--due <date>] \
  [--status <pending|completed>] [--calendar <id>]

delete-todo

Delete a todo.

node scripts/caldav.js [--account <name>] delete-todo --uid <uid> [--calendar <id>]

freebusy

Query free/busy information for a time range.

node scripts/caldav.js [--account <name>] freebusy --start <datetime> --end <datetime> [--calendar <id>]

list-accounts

List all configured CalDAV accounts.

node scripts/caldav.js list-accounts

Incremental Sync

list-events and list-todos automatically use incremental sync when available:

  1. sync-token — only fetches changed resources (preferred)
  2. ctag + etag — compares calendar tag and resource tags to fetch only changes
  3. full — fetches all resources (fallback)

Sync state is cached at ~/.config/mail-skills/caldav-cache/ per account and calendar. Write operations (create/update/delete) automatically invalidate the cache.

Use --force-refresh to bypass the cache and force a full sync:

node scripts/caldav.js list-events --start 2026-01-01 --end 2026-12-31 --force-refresh
node scripts/caldav.js list-todos --force-refresh

Security Notes

  • Configuration is stored at ~/.config/mail-skills/.env with 600 permissions (owner read/write only)
  • For Google: regular password is rejected -- generate an App Password at https://myaccount.google.com/apppasswords
  • For NetEase: use authorization code (授权码), not account password

Troubleshooting

Connection failed:

  • Verify server URL is correct and accessible
  • Check username and password

Authentication failed:

  • For Google: use App Password, not regular password
  • For NetEase: use authorization code, not account password
  • For iCloud: use App-Specific Password

No calendars found:

  • Verify CalDAV service is enabled in your account settings
  • Check the server URL includes the correct path

Related Skills

  • imap-smtp-email - Read, search, manage, and send emails via IMAP/SMTP. Supports Gmail, Outlook, NetEase (163/126/188), and any standard IMAP/SMTP server. Install with:

```bash

npx skills add https://github.com/gzlicanyi/mail-skills -s imap-smtp-email

```

Feedback

Issues and pull requests are welcome at github.com/gzlicanyi/mail-skills.

版本历史

共 2 个版本

  • v1.0.3 当前
    2026-05-23 23:22 安全 安全
  • v1.0.2
    2026-05-20 05:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,081
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,055 📥 795,189
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,714