feishu-cli-calendar

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

飞书日历操作技能

Feishu Calendar Operation Skill

管理飞书日历和日程,包括列出日历、创建/查看/更新/删除日程等。
Manage Feishu calendars and schedules, including listing calendars, creating/viewing/updating/deleting schedules, etc.

使用方法

Usage

bash
/feishu-calendar list                                   # 列出所有日历
/feishu-calendar list-events <calendar_id>              # 列出日历中的日程
/feishu-calendar create-event --calendar-id <id> ...    # 创建日程
/feishu-calendar get-event <calendar_id> <event_id>     # 获取日程详情
/feishu-calendar update-event <calendar_id> <event_id>  # 更新日程
/feishu-calendar delete-event <calendar_id> <event_id>  # 删除日程
bash
/feishu-calendar list                                   # List all calendars
/feishu-calendar list-events <calendar_id>              # List events in a calendar
/feishu-calendar create-event --calendar-id <id> ...    # Create an event
/feishu-calendar get-event <calendar_id> <event_id>     # Get event details
/feishu-calendar update-event <calendar_id> <event_id>  # Update an event
/feishu-calendar delete-event <calendar_id> <event_id>  # Delete an event

CLI 命令详解

CLI Command Details

1. 列出日历

1. List Calendars

bash
feishu-cli calendar list
输出示例
日历列表:
  1. 日历ID: CAL_xxx
     名称: 我的日历
     类型: primary

  2. 日历ID: CAL_yyy
     名称: 团队日历
     类型: shared
bash
feishu-cli calendar list
Output Example
Calendar List:
  1. Calendar ID: CAL_xxx
     Name: My Calendar
     Type: primary

  2. Calendar ID: CAL_yyy
     Name: Team Calendar
     Type: shared

2. 创建日程

2. Create an Event

bash
undefined
bash
undefined

基本用法

Basic usage

feishu-cli calendar create-event
--calendar-id CAL_ID
--summary "日程标题"
--start 2024-01-21T14:00:00+08:00
--end 2024-01-21T15:00:00+08:00
feishu-cli calendar create-event
--calendar-id CAL_ID
--summary "Event Title"
--start 2024-01-21T14:00:00+08:00
--end 2024-01-21T15:00:00+08:00

带描述和地点

With description and location

feishu-cli calendar create-event
--calendar-id CAL_ID
--summary "项目评审"
--start 2024-01-21T14:00:00+08:00
--end 2024-01-21T16:00:00+08:00
--description "Q1 项目进度评审"
--location "会议室 A101"
feishu-cli calendar create-event
--calendar-id CAL_ID
--summary "Project Review"
--start 2024-01-21T14:00:00+08:00
--end 2024-01-21T16:00:00+08:00
--description "Q1 Project Progress Review"
--location "Meeting Room A101"

JSON 格式输出

JSON format output

feishu-cli calendar create-event
--calendar-id CAL_ID
--summary "会议"
--start 2024-01-21T14:00:00+08:00
--end 2024-01-21T15:00:00+08:00
--output json

**参数说明**:
| 参数 | 简写 | 说明 | 必填 |
|------|------|------|------|
| `--calendar-id` | `-c` | 日历 ID | 是 |
| `--summary` | `-s` | 日程标题 | 是 |
| `--start` | | 开始时间(RFC3339 格式) | 是 |
| `--end` | | 结束时间(RFC3339 格式) | 是 |
| `--description` | `-d` | 日程描述 | 否 |
| `--location` | `-l` | 地点 | 否 |
| `--output` | `-o` | 输出格式(json) | 否 |
feishu-cli calendar create-event
--calendar-id CAL_ID
--summary "Meeting"
--start 2024-01-21T14:00:00+08:00
--end 2024-01-21T15:00:00+08:00
--output json

**Parameter Description**:
| Parameter | Shortcut | Description | Required |
|------|------|------|------|
| `--calendar-id` | `-c` | Calendar ID | Yes |
| `--summary` | `-s` | Event title | Yes |
| `--start` | | Start time (RFC3339 format) | Yes |
| `--end` | | End time (RFC3339 format) | Yes |
| `--description` | `-d` | Event description | No |
| `--location` | `-l` | Location | No |
| `--output` | `-o` | Output format (json) | No |

3. 列出日程

3. List Events

bash
undefined
bash
undefined

列出所有日程

List all events

feishu-cli calendar list-events CAL_ID
feishu-cli calendar list-events CAL_ID

指定时间范围

Specify time range

feishu-cli calendar list-events CAL_ID
--start-time 2024-01-01T00:00:00+08:00
--end-time 2024-01-31T23:59:59+08:00
feishu-cli calendar list-events CAL_ID
--start-time 2024-01-01T00:00:00+08:00
--end-time 2024-01-31T23:59:59+08:00

分页查询

Pagination query

feishu-cli calendar list-events CAL_ID --page-size 20
feishu-cli calendar list-events CAL_ID --page-size 20

JSON 格式输出

JSON format output

feishu-cli calendar list-events CAL_ID --output json

**参数说明**:
| 参数 | 说明 | 默认值 |
|------|------|--------|
| `--start-time` | 开始时间过滤 | 无 |
| `--end-time` | 结束时间过滤 | 无 |
| `--page-size` | 每页数量 | 50 |
| `--page-token` | 分页标记 | 无 |
| `--output, -o` | 输出格式 | 文本 |
feishu-cli calendar list-events CAL_ID --output json

**Parameter Description**:
| Parameter | Description | Default Value |
|------|------|--------|
| `--start-time` | Start time filter | None |
| `--end-time` | End time filter | None |
| `--page-size` | Number of items per page | 50 |
| `--page-token` | Pagination token | None |
| `--output, -o` | Output format | Text |

4. 获取日程详情

4. Get Event Details

bash
feishu-cli calendar get-event CAL_ID EVENT_ID
bash
feishu-cli calendar get-event CAL_ID EVENT_ID

5. 更新日程

5. Update an Event

bash
undefined
bash
undefined

更新标题

Update title

feishu-cli calendar update-event CAL_ID EVENT_ID --summary "新标题"
feishu-cli calendar update-event CAL_ID EVENT_ID --summary "New Title"

更新时间

Update time

feishu-cli calendar update-event CAL_ID EVENT_ID
--start 2024-01-21T15:00:00+08:00
--end 2024-01-21T16:00:00+08:00
feishu-cli calendar update-event CAL_ID EVENT_ID
--start 2024-01-21T15:00:00+08:00
--end 2024-01-21T16:00:00+08:00

更新多个字段

Update multiple fields

feishu-cli calendar update-event CAL_ID EVENT_ID
--summary "更新后的会议"
--description "会议内容已更新"
--location "会议室 B202"

**参数说明**:
| 参数 | 简写 | 说明 |
|------|------|------|
| `--summary` | `-s` | 新的日程标题 |
| `--start` | | 新的开始时间 |
| `--end` | | 新的结束时间 |
| `--description` | `-d` | 新的日程描述 |
| `--location` | `-l` | 新的地点 |
| `--output` | `-o` | 输出格式(json) |
feishu-cli calendar update-event CAL_ID EVENT_ID
--summary "Updated Meeting"
--description "Meeting content has been updated"
--location "Meeting Room B202"

**Parameter Description**:
| Parameter | Shortcut | Description |
|------|------|------|
| `--summary` | `-s` | New event title |
| `--start` | | New start time |
| `--end` | | New end time |
| `--description` | `-d` | New event description |
| `--location` | `-l` | New location |
| `--output` | `-o` | Output format (json) |

6. 删除日程

6. Delete an Event

bash
feishu-cli calendar delete-event CAL_ID EVENT_ID
bash
feishu-cli calendar delete-event CAL_ID EVENT_ID

时间格式说明

Time Format Description

使用 RFC3339 格式,示例:
  • 2024-01-21T14:00:00+08:00
    - 北京时间 14:00
  • 2024-01-21T06:00:00Z
    - UTC 时间 06:00
常见时区
时区偏移量示例
北京时间
+08:00
2024-01-21T14:00:00+08:00
UTC
Z
2024-01-21T06:00:00Z
东京时间
+09:00
2024-01-21T15:00:00+09:00
Use RFC3339 format, examples:
  • 2024-01-21T14:00:00+08:00
    - Beijing Time 14:00
  • 2024-01-21T06:00:00Z
    - UTC Time 06:00
Common Time Zones
Time ZoneOffsetExample
Beijing Time
+08:00
2024-01-21T14:00:00+08:00
UTC
Z
2024-01-21T06:00:00Z
Tokyo Time
+09:00
2024-01-21T15:00:00+09:00

典型工作流

Typical Workflow

查看今日日程

View Today's Events

bash
undefined
bash
undefined

1. 获取日历列表

1. Get calendar list

feishu-cli calendar list
feishu-cli calendar list

2. 查看指定日历今日日程

2. View today's events in the specified calendar

feishu-cli calendar list-events CAL_ID
--start-time 2024-01-21T00:00:00+08:00
--end-time 2024-01-21T23:59:59+08:00
undefined
feishu-cli calendar list-events CAL_ID
--start-time 2024-01-21T00:00:00+08:00
--end-time 2024-01-21T23:59:59+08:00
undefined

创建会议日程

Create a Meeting Event

bash
undefined
bash
undefined

1. 获取日历 ID

1. Get calendar ID

feishu-cli calendar list
feishu-cli calendar list

2. 创建日程

2. Create event

feishu-cli calendar create-event
--calendar-id CAL_xxx
--summary "周会"
--start 2024-01-21T10:00:00+08:00
--end 2024-01-21T11:00:00+08:00
--description "每周团队例会"
--location "会议室 101"
undefined
feishu-cli calendar create-event
--calendar-id CAL_xxx
--summary "Weekly Meeting"
--start 2024-01-21T10:00:00+08:00
--end 2024-01-21T11:00:00+08:00
--description "Weekly Team Meeting"
--location "Meeting Room 101"
undefined

修改日程时间

Modify Event Time

bash
undefined
bash
undefined

1. 获取日程列表

1. Get event list

feishu-cli calendar list-events CAL_ID
feishu-cli calendar list-events CAL_ID

2. 更新日程时间

2. Update event time

feishu-cli calendar update-event CAL_ID EVENT_ID
--start 2024-01-21T15:00:00+08:00
--end 2024-01-21T16:00:00+08:00
undefined
feishu-cli calendar update-event CAL_ID EVENT_ID
--start 2024-01-21T15:00:00+08:00
--end 2024-01-21T16:00:00+08:00
undefined

命令别名

Command Aliases

calendar
命令支持别名
cal
bash
feishu-cli cal list
feishu-cli cal list-events CAL_ID
The
calendar
command supports the alias
cal
bash
feishu-cli cal list
feishu-cli cal list-events CAL_ID

错误处理

Error Handling

错误原因解决
Access denied
权限不足检查应用是否开通日历权限
invalid calendar_id
日历 ID 无效先用
calendar list
获取有效 ID
invalid event_id
日程 ID 无效先用
list-events
获取有效 ID
invalid time format
时间格式错误使用 RFC3339 格式(含时区)
rate limit
API 限流等待几秒后重试
ErrorCauseSolution
Access denied
Insufficient permissionsCheck if the app has calendar permissions enabled
invalid calendar_id
Invalid calendar IDUse
calendar list
to get valid IDs first
invalid event_id
Invalid event IDUse
list-events
to get valid IDs first
invalid time format
Incorrect time formatUse RFC3339 format (including time zone)
rate limit
API rate limit exceededWait a few seconds and try again

注意事项

Notes

  1. 日历 ID:创建日程前需要先通过
    calendar list
    获取日历 ID
  2. 时间格式:必须使用 RFC3339 格式,包含时区信息
  3. 权限要求:需要应用具有日历相关权限
  4. 创建日历:当前 CLI 不支持创建新日历,只能使用已有日历创建日程
  1. Calendar ID: You need to get the calendar ID via
    calendar list
    before creating an event
  2. Time Format: Must use RFC3339 format with time zone information
  3. Permission Requirements: The app needs to have calendar-related permissions
  4. Create Calendar: The current CLI does not support creating new calendars; you can only use existing calendars to create events

权限要求(重要)

Permission Requirements (Important)

⚠️ 日历功能需要在飞书开放平台为应用开通以下权限之一:
  • calendar:calendar:readonly
    - 只读权限
  • calendar:calendar
    - 读写权限
  • calendar:calendar.calendar:readonly
    - 日历只读
  • calendar:calendar:read
    - 日历读取
申请链接:在飞书开放平台应用后台 → 权限管理 → 申请对应权限
如果遇到
Access denied
错误,请检查应用权限配置。
⚠️ The calendar function requires the app to have one of the following permissions enabled on the Feishu Open Platform:
  • calendar:calendar:readonly
    - Read-only permission
  • calendar:calendar
    - Read-write permission
  • calendar:calendar.calendar:readonly
    - Calendar read-only
  • calendar:calendar:read
    - Calendar read
Application Link: In the Feishu Open Platform app backend → Permission Management → Apply for the corresponding permission
If you encounter an
Access denied
error, please check the app permission configuration.