AgentSkillsCN

todoist

在 Todoist 中轻松管理任务、项目与生产力。查看待办事项、新增任务、核对已完成工作,并对项目进行有序整理。

SKILL.md
--- frontmatter
name: todoist
description: Manage tasks, projects, and productivity in Todoist. View tasks, add new items, check completed work, and organize projects.

Todoist Task Management

This skill provides access to Todoist via the REST API.

Setup Required

Get your API token:

  1. Go to Todoist Settings → Integrations → Developer
  2. Or visit: https://todoist.com/app/settings/integrations/developer
  3. Copy your API token

Set as environment variable:

bash
export TODOIST_TOKEN="your-api-token"

When to Use

Use this skill when the user:

  • Asks about their tasks, TODOs, or what they need to do
  • Wants to add a new task or reminder
  • Asks about completed tasks or productivity
  • Wants to organize projects or sections
  • Mentions "Todoist" or their task list

API Endpoints

Base URL: https://api.todoist.com/rest/v2

All requests need:

bash
-H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Important: Use $(printenv TODOIST_TOKEN) to ensure the token expands correctly in all shell contexts (zsh eval can lose variable values).

Tasks

Get All Tasks:

bash
curl -s "https://api.todoist.com/rest/v2/tasks" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Get Tasks by Filter:

bash
curl -s -G "https://api.todoist.com/rest/v2/tasks" \
  --data-urlencode "filter=today" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Get Single Task:

bash
curl -s "https://api.todoist.com/rest/v2/tasks/{TASK_ID}" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Create Task:

bash
curl -s -X POST "https://api.todoist.com/rest/v2/tasks" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Task name",
    "due_string": "tomorrow",
    "priority": 2
  }'

Complete Task:

bash
curl -s -X POST "https://api.todoist.com/rest/v2/tasks/{TASK_ID}/close" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Projects

Get All Projects:

bash
curl -s "https://api.todoist.com/rest/v2/projects" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Get Project:

bash
curl -s "https://api.todoist.com/rest/v2/projects/{PROJECT_ID}" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Sections

Get Sections:

bash
curl -s "https://api.todoist.com/rest/v2/sections" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Get Sections in Project:

bash
curl -s "https://api.todoist.com/rest/v2/sections?project_id={PROJECT_ID}" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Labels

Get All Labels:

bash
curl -s "https://api.todoist.com/rest/v2/labels" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Comments

Get Comments on Task:

bash
curl -s "https://api.todoist.com/rest/v2/comments?task_id={TASK_ID}" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Add Comment:

bash
curl -s -X POST "https://api.todoist.com/rest/v2/comments" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)" \
  -H "Content-Type: application/json" \
  -d '{
    "task_id": "TASK_ID",
    "content": "Comment text"
  }'

Filter Syntax

The filter parameter accepts Todoist filter syntax:

FilterDescription
todayDue today
tomorrowDue tomorrow
overduePast due
7 days or next 7 daysDue in next 7 days
no dateNo due date
p1Priority 1 (urgent)
@label_nameHas label
#project_nameIn project
/section_nameIn section
assigned to: meAssigned to you
today & p1Combine with &
`todaytomorrow`

Common Workflows

Get Today's Tasks

bash
curl -s -G "https://api.todoist.com/rest/v2/tasks" \
  --data-urlencode "filter=today" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)" | jq '.[] | {content, due: .due.string, priority}'

Get Overdue Tasks

bash
curl -s -G "https://api.todoist.com/rest/v2/tasks" \
  --data-urlencode "filter=overdue" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Add a Task for Tomorrow

bash
curl -s -X POST "https://api.todoist.com/rest/v2/tasks" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Review the PR",
    "due_string": "tomorrow",
    "priority": 2
  }'

Get All Tasks in a Project

bash
# First, find project ID
curl -s "https://api.todoist.com/rest/v2/projects" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)" | jq '.[] | {name, id}'

# Then get tasks
curl -s "https://api.todoist.com/rest/v2/tasks?project_id={PROJECT_ID}" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

Get High Priority Tasks

bash
curl -s -G "https://api.todoist.com/rest/v2/tasks" \
  --data-urlencode "filter=p1 | p2" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)"

List Projects with Task Counts

bash
curl -s "https://api.todoist.com/rest/v2/projects" \
  -H "Authorization: Bearer $(printenv TODOIST_TOKEN)" | jq '.[] | {name, id}'

Task Properties

When creating tasks:

  • content: Task text (required)
  • description: Additional details
  • due_string: Natural language date ("tomorrow", "every monday")
  • due_date: Specific date (YYYY-MM-DD)
  • due_datetime: With time (RFC3339)
  • priority: 1 (urgent) to 4 (normal) - note: API uses 1=urgent, opposite of UI
  • project_id: Project to add to
  • section_id: Section within project
  • labels: Array of label names
  • assignee_id: For shared projects

Notes

Sources