productivity
TickTick Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the TickTick KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.ticktick.*.
Use lua_read_doc("integrations.ticktick") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
TickTick workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.ticktick.list_projects({}))' --json kosmo integrations:lua --eval 'print(docs.read("ticktick"))' --json
kosmo integrations:lua --eval 'print(docs.read("ticktick.list_projects"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local ticktick = app.integrations.ticktick
local result = ticktick.list_projects({})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.ticktick, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.ticktick.default.* or app.integrations.ticktick.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need TickTick, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
TickTick — Lua API Reference
list_projects
List all projects (task lists). No parameters. Call this first to discover project IDs.
local projects = app.integrations.ticktick.list_projects({})
for _, p in ipairs(projects) do
print(p.name .. " (id: " .. p.id .. ")")
end
get_tasks
Get all tasks in a project.
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | Project ID (from list_projects) |
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })
create_task
Create a new task.
| Name | Type | Required | Description |
|---|---|---|---|
title | string | yes | Task title |
project_id | string | no | Project ID. Omit to add to Inbox |
content | string | no | Description/notes |
start_date | string | no | ISO 8601 (e.g. "2026-03-30T09:00:00+0000") |
due_date | string | no | ISO 8601 (e.g. "2026-03-30T17:00:00+0000") |
priority | integer | no | 0 = none, 1 = low, 3 = medium, 5 = high |
is_all_day | boolean | no | true for all-day, false for specific times |
items | string | no | JSON array of subtasks (see below) |
Subtask format
[{"title": "Subtask 1", "status": 0}, {"title": "Subtask 2", "status": 0}]
Status: 0 = unchecked, 2 = checked.
complete_task
Mark a task as complete.
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | Project ID the task belongs to |
task_id | string | yes | Task ID to complete |
update_task
Update an existing task (same fields as create, plus task_id and project_id).
delete_task
Delete a task (requires project_id and task_id).
Examples
List projects, then create a task
-- Step 1: find the project
local projects = app.integrations.ticktick.list_projects({})
local project_id = nil
for _, p in ipairs(projects) do
if p.name == "Work" then
project_id = p.id
break
end
end
-- Step 2: create a high-priority task with a due date
app.integrations.ticktick.create_task({
title = "Finish quarterly report",
project_id = project_id,
content = "Include revenue and churn metrics",
due_date = "2026-04-01T17:00:00+0000",
priority = 5,
is_all_day = false
})
Create a task with subtasks
app.integrations.ticktick.create_task({
title = "Launch checklist",
project_id = project_id,
priority = 3,
items = '[{"title": "Update changelog", "status": 0}, {"title": "Tag release", "status": 0}, {"title": "Notify team", "status": 0}]'
})
Complete a task
-- Step 1: get tasks in the project
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })
-- Step 2: complete the first one
app.integrations.ticktick.complete_task({
project_id = "abc123",
task_id = tasks[1].id
})
Create a quick Inbox task
app.integrations.ticktick.create_task({
title = "Buy groceries",
priority = 1
})
Multi-Account Usage
If you have multiple ticktick accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.ticktick.function_name({...})
-- Explicit default (portable across setups)
app.integrations.ticktick.default.function_name({...})
-- Named accounts
app.integrations.ticktick.work.function_name({...})
app.integrations.ticktick.personal.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# TickTick — Lua API Reference
## list_projects
List all projects (task lists). No parameters. Call this first to discover project IDs.
```lua
local projects = app.integrations.ticktick.list_projects({})
for _, p in ipairs(projects) do
print(p.name .. " (id: " .. p.id .. ")")
end
```
## get_tasks
Get all tasks in a project.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | Project ID (from `list_projects`) |
```lua
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })
```
## create_task
Create a new task.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | Task title |
| `project_id` | string | no | Project ID. Omit to add to Inbox |
| `content` | string | no | Description/notes |
| `start_date` | string | no | ISO 8601 (e.g. `"2026-03-30T09:00:00+0000"`) |
| `due_date` | string | no | ISO 8601 (e.g. `"2026-03-30T17:00:00+0000"`) |
| `priority` | integer | no | `0` = none, `1` = low, `3` = medium, `5` = high |
| `is_all_day` | boolean | no | `true` for all-day, `false` for specific times |
| `items` | string | no | JSON array of subtasks (see below) |
### Subtask format
```
[{"title": "Subtask 1", "status": 0}, {"title": "Subtask 2", "status": 0}]
```
Status: `0` = unchecked, `2` = checked.
## complete_task
Mark a task as complete.
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | yes | Project ID the task belongs to |
| `task_id` | string | yes | Task ID to complete |
## update_task
Update an existing task (same fields as create, plus `task_id` and `project_id`).
## delete_task
Delete a task (requires `project_id` and `task_id`).
## Examples
### List projects, then create a task
```lua
-- Step 1: find the project
local projects = app.integrations.ticktick.list_projects({})
local project_id = nil
for _, p in ipairs(projects) do
if p.name == "Work" then
project_id = p.id
break
end
end
-- Step 2: create a high-priority task with a due date
app.integrations.ticktick.create_task({
title = "Finish quarterly report",
project_id = project_id,
content = "Include revenue and churn metrics",
due_date = "2026-04-01T17:00:00+0000",
priority = 5,
is_all_day = false
})
```
### Create a task with subtasks
```lua
app.integrations.ticktick.create_task({
title = "Launch checklist",
project_id = project_id,
priority = 3,
items = '[{"title": "Update changelog", "status": 0}, {"title": "Tag release", "status": 0}, {"title": "Notify team", "status": 0}]'
})
```
### Complete a task
```lua
-- Step 1: get tasks in the project
local tasks = app.integrations.ticktick.get_tasks({ project_id = "abc123" })
-- Step 2: complete the first one
app.integrations.ticktick.complete_task({
project_id = "abc123",
task_id = tasks[1].id
})
```
### Create a quick Inbox task
```lua
app.integrations.ticktick.create_task({
title = "Buy groceries",
priority = 1
})
```
---
## Multi-Account Usage
If you have multiple ticktick accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.ticktick.function_name({...})
-- Explicit default (portable across setups)
app.integrations.ticktick.default.function_name({...})
-- Named accounts
app.integrations.ticktick.work.function_name({...})
app.integrations.ticktick.personal.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.ticktick.list_projects({})
print(result) Functions
list_projects Read
List all TickTick projects (task lists). Returns project names, IDs, and metadata. Use this first to discover available projects before working with tasks.
- Lua path
app.integrations.ticktick.list_projects- Full name
ticktick.ticktick_list_projects
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_project Read
Get a TickTick project with all its tasks, sections, and columns. Use this to see everything in a project at once.
- Lua path
app.integrations.ticktick.get_project- Full name
ticktick.ticktick_get_project
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID. Use ticktick_list_projects to find project IDs. |
create_project Write
Create a new TickTick project (task list).
- Lua path
app.integrations.ticktick.create_project- Full name
ticktick.ticktick_create_project
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name of the project. |
color | string | no | Color of the project (e.g., "#ff8c00"). |
view_mode | string | no | View mode: "list", "kanban", or "timeline". |
delete_project Write
Delete a TickTick project and all its tasks. This action cannot be undone.
- Lua path
app.integrations.ticktick.delete_project- Full name
ticktick.ticktick_delete_project
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID to delete. Use ticktick_list_projects to find project IDs. |
get_tasks Read
Get all tasks in a TickTick project. Returns task titles, IDs, priorities, due dates, and subtasks.
- Lua path
app.integrations.ticktick.get_tasks- Full name
ticktick.ticktick_get_tasks
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID to get tasks from. Use ticktick_list_projects to find project IDs. |
create_task Write
Create a new task in TickTick. If no project_id is given, the task goes to the Inbox. Supports subtasks via the items array.
- Lua path
app.integrations.ticktick.create_task- Full name
ticktick.ticktick_create_task
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | yes | Task title. |
project_id | string | no | Project ID to create the task in. Omit to add to Inbox. |
content | string | no | Task description/notes. |
start_date | string | no | Start date in ISO 8601 format (e.g., "2026-02-15T09:00:00+0000"). |
due_date | string | no | Due date in ISO 8601 format (e.g., "2026-02-15T17:00:00+0000"). |
priority | integer | no | Priority: 0 = none, 1 = low, 3 = medium, 5 = high. |
is_all_day | boolean | no | Whether this is an all-day task (true) or has specific times (false). |
items | string | no | JSON array of subtasks, e.g., [{"title": "Subtask 1", "status": 0}]. Status: 0 = unchecked, 2 = checked. |
update_task Write
Update an existing TickTick task. Requires both the task ID and its project ID. Only provided fields will be changed.
- Lua path
app.integrations.ticktick.update_task- Full name
ticktick.ticktick_update_task
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | yes | The task ID to update. |
project_id | string | yes | The project ID the task belongs to. |
title | string | no | New title for the task. |
content | string | no | New description/notes for the task. |
start_date | string | no | New start date in ISO 8601 format. |
due_date | string | no | New due date in ISO 8601 format. |
priority | integer | no | New priority: 0 = none, 1 = low, 3 = medium, 5 = high. |
complete_task Write
Mark a TickTick task as complete.
- Lua path
app.integrations.ticktick.complete_task- Full name
ticktick.ticktick_complete_task
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID the task belongs to. |
task_id | string | yes | The task ID to complete. |
delete_task Write
Delete a TickTick task. This action cannot be undone.
- Lua path
app.integrations.ticktick.delete_task- Full name
ticktick.ticktick_delete_task
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The project ID the task belongs to. |
task_id | string | yes | The task ID to delete. |