2.7 KiB
2.7 KiB
task +create
Prerequisites: Please read
../lark-shared/SKILL.mdto understand authentication, global parameters, and security rules.
Create a new task in Lark.
Recommended Commands
# Create a task with all details
lark-cli task +create \
--summary "Quarterly Sales Review" \
--description "Review the sales performance for the last quarter." \
--assignee "ou_xxx" \
--due "2026-03-25" \
--tasklist-id "https://applink.larkoffice.com/client/todo/task_list?guid=a4b00000-000-000-000-00000000036c"
# Create a task assigned to an app
lark-cli task +create \
--summary "Nightly Sync" \
--assignee "cli_xxx"
# Create a simple task
lark-cli task +create \
--summary "Buy milk"
# Preview the API call without executing
lark-cli task +create --summary "Test Task" --dry-run
Parameters
| Parameter | Required | Description |
|---|---|---|
--summary <text> |
Yes | The title or summary of the task |
--description <text> |
No | Detailed description of the task |
--assignee <id> |
No | Assignee ID. Use user open_id like ou_xxx for people, or app ID like cli_xxx for apps. |
--follower <id> |
No | Follower ID. Use user open_id like ou_xxx for people, or app ID like cli_xxx for apps. |
--due <time> |
No | Due date. Supports ISO 8601, YYYY-MM-DD, relative time (e.g., +2d), or ms timestamp. YYYY-MM-DD and relative time will automatically set it as an all-day task. |
--tasklist-id <id> |
No | The GUID of the tasklist, or a full AppLink URL (the CLI will automatically extract the guid parameter from the URL). |
--idempotency-key <key> |
No | Client token to ensure idempotency of the request. |
--dry-run |
No | Preview the API call (JSON payload) without actually creating the task. |
Workflow
- Confirm with the user: task summary, due date, assignee, and tasklist if necessary.
- Crucial Rule for Assignee: If the user explicitly or implicitly says "create a task for me" (给我创建一个任务), or "help me create a task" (帮我新建/创建一个任务), you MUST assign the task to the current logged-in user. You can get the current user's
open_idby executinglark-cli auth status(it already outputs JSON by default, so do not add--json) orlark-cli contact +get-userfirst, extracting theuserOpenIdoropen_id, and then passing it to the--assigneeparameter.
- Crucial Rule for Assignee: If the user explicitly or implicitly says "create a task for me" (给我创建一个任务), or "help me create a task" (帮我新建/创建一个任务), you MUST assign the task to the current logged-in user. You can get the current user's
- Execute
lark-cli task +create --summary "..." ... - Report the result: task ID and summary.
Caution
This is a Write Operation -- You must confirm the user's intent before executing.
References
- lark-task -- All task commands
- lark-shared -- Authentication and global parameters