Skip to content

Add subtasks (checklist items) support - #89

Open
underwear wants to merge 1 commit into
kiblee:masterfrom
underwear:add-checklist-items
Open

Add subtasks (checklist items) support#89
underwear wants to merge 1 commit into
kiblee:masterfrom
underwear:add-checklist-items

Conversation

@underwear

@underwear underwear commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds commands for managing checklist items (steps) within tasks via the Microsoft Graph checklistItems API
  • Adds --steps/-s flag to lst command to display steps inline

New commands

Command Usage Description
new-step todocli new-step "list/task" "step text" Create a checklist item on a task
list-steps todocli list-steps "list/task" Display all checklist items for a task
complete-step todocli complete-step "list/task" "step or index" Mark a step as checked
rm-step todocli rm-step "list/task" "step or index" Delete a step from a task

The lst command now accepts -s/--steps to show steps inline:

todocli lst "Shopping" -s
[0]  Buy groceries
    [x] Buy eggs
    [ ] Buy milk
[1]  Clean house

All commands support the -l/--list flag for explicit list specification.

Changes

  • todocli/models/checklistitem.py (new) — ChecklistItem data model with flexible datetime parsing for the checklistItems API format
  • todocli/graphapi/wrapper.py — add StepNotFoundByName/StepNotFoundByIndex exceptions and 5 new API functions (get_checklist_items, create_checklist_item, complete_checklist_item, delete_checklist_item, get_step_id)
  • todocli/cli.py — add 4 handler functions, 4 subparsers, --steps flag on lst, and exception handlers
  • todocli/help_msg.py / README.md — document new commands
  • tests/test_checklist_*.py (3 new files) — 26 new unit tests for model, wrapper, and CLI parsing

Test plan

  • All 80 unit tests pass
  • black --check passes on all files
  • Manual test: new-step, list-steps, complete-step (by name and index), rm-step — all verified against live API
  • Manual test: lst "list" -s — displays steps inline with [x]/[ ] status

Closes #83

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Add commands for managing checklist items (steps) within tasks
via the Microsoft Graph checklistItems API:

- new-step: create a checklist item on a task
- list-steps: display checklist items for a task
- complete-step: mark a checklist item as checked
- rm-step: remove a checklist item from a task
- lst --steps/-s: display steps inline when listing tasks

Includes ChecklistItem model, wrapper functions, CLI handlers,
and 26 new unit tests (80 total).

Closes kiblee#83
@underwear
underwear force-pushed the add-checklist-items branch from 1efbb62 to 7c9d4da Compare February 4, 2026 19:15
Comment thread todocli/cli.py
Comment on lines +63 to +64
items = wrapper.get_checklist_items(
list_name=args.list_name, task_name=task.title

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lst --steps fetches checklist items by task.title, so if multiple tasks share the same title it will always show steps for the first match, not the specific task being listed. Should we use task’s id when calling get_checklist_items to avoid title collisions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, definitely should use task ID here — title matching breaks as soon as you have duplicates. The IDs are annoyingly long so not great for humans to type manually, but I think most people would use the interactive mode anyway, and non-interactive is more for scripts.

I actually ran into this and a bunch of other issues when trying to use the CLI in automation scripts. Like no --json output, no state returned after operations (so you have to call another command and parse it just to check if anything changed), and title-based lookups everywhere. Eventually it felt like too much to fix in PRs, so I forked it, stripped out the interactive mode, and rethought the whole non-interactive flow from scratch to make it work for scripting and AI agents: https://github.com/underwear/microsoft-todo-cli

Feel free to grab any ideas from there if useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for subtasks (checklist items / steps)

2 participants