Apple Calendar CLI Plus — 应用le Calendar 命令行工具 Plus
v1.2.4Manage 应用le Calendar 事件 from the command line on macOS — 创建, 更新, 删除, 搜索, 导出, and 检查 avAIlability with full JSON 输出 for 代理 use.
运行时依赖
安装命令
点击复制技能文档
ac命令行工具 — 应用le Calendar 命令行工具
ac命令行工具 manages 应用le Calendar on macOS via EventKit. All commands support --json for structured 输出. Exit codes: 0=成功, 1=运行time error, 2=验证 error, 10=auth error.
First 运行: ac命令行工具 设置up to grant Calendar 权限s (Full 访问 required in 系统 设置tings > 隐私 & Security > Calendars).
Calendars ac命令行工具 calendars [--json]
Returns 列出 of calendars with id, name, source, 索引, writable. Always prefer --calendar-id over calendar name — IDs are stable, names are not.
事件 ac命令行工具 事件 [] [--calendar-id ] --from --to [--json]
列出s 事件 in a date range. Calendar is required (use name, --calendar-id, or 设置 a default via ac命令行工具 config 设置-default).
Single Event ac命令行工具 event [] [--calendar-id ] [--json]
Fetches full event detAIl including alerts array (minutes before 启动).
创建 Event ac命令行工具 创建 --summary --启动 --end \ [--location ] [--description ] [--all-day] \ [--alert ] [--alert ] \ [--recur dAIly|weekly|monthly|yearly] [--recur-count ] [--recur-end ] \ [--json]
--alert is repeatable — 添加s one alert per flag (minutes before 启动) --recur-end and --recur-count are mutually exclusive All-day 事件: use YYYY-MM-DD for --启动 and --end Timed 事件: use YYYY-MM-DDTHH:mm 更新 Event ac命令行工具 更新 \ [--summary ] [--启动 ] [--end ] \ [--location ] [--description ] \ [--alert ] [--alert ] \ [--dry-运行] [--json]
--alert on 更新 replaces all existing alerts. Omit --alert to leave alerts unchanged. --dry-运行 returns { dry运行: true, would更新: { eventId, changes } } without modifying anything.
删除 Event ac命令行工具 删除 [--dry-运行] [--json]
--dry-运行 returns { dry运行: true, would删除: { id, summary, calendar, 启动, end } } without deleting.
搜索 ac命令行工具 搜索 --查询 [--from ] [--to ] [--calendar-id ] [--json]
Case-insensitive 搜索 across summary, location, and description. 搜索es all calendars unless --calendar-id is provided. Returns 事件 with calendarId field for tar获取ing.
导出 ac命令行工具 导出 --from --to [--calendar-id ] [--json]
导出s all 事件 grouped by calendar. 响应: { calendars: [{ id, name, source, 事件, t运行cated }], total事件, t运行cated }. Each calendar t运行cates at 500 事件 per calendar and 设置s t运行cated: true if hit.
Free/Busy ac命令行工具 freebusy --from --to [--calendar-name ] [--json]
Returns busy time slots across calendars.
Config ac命令行工具 config 设置-default --calendar-id [--json] ac命令行工具 config show [--json] ac命令行工具 config clear [--json]
Persists default calendar to ~/.ac命令行工具rc (override with AC命令行工具_CONFIG_PATH). Commands that require a calendar use the default when no calendar is specified.
DateTime 格式化s Timed: YYYY-MM-DDTHH:mm or YYYY-MM-DDTHH:mm:ss Date-only (all-day 事件, --from/--to): YYYY-MM-DD 代理 Best Practices Always use --json for programmatic parsing Use --calendar-id not calendar name (stable across renames) Use --dry-运行 before destructive operations to confirm tar获取 event Use ac命令行工具 搜索 to find event IDs before 更新/删除 检查 ok: false in JSON 响应 before proceeding ac命令行工具 导出 is suitable for full calendar 备份; 检查 t运行cated field Multiple alerts: repeat --alert flag — e.g. --alert 5 --alert 15 macOS only — do not attempt on non-darwin 系统s Error Codes Code Meaning NOT_授权D Calendar 访问 not granted or 设置 to 添加 Only CALENDAR_NOT_FOUND Calendar ID or name not found AMBIGUOUS_CALENDAR Multiple calendars with same name — use --calendar-id EVENT_NOT_FOUND Event ID not found in calendar MISSING_REQUIRED Required flag missing INVALID_ARGUMENT Invalid flag value INVALID_RANGE 启动 is after end