ms-todo-oauthA robust CLI skill to manage Microsoft To Do tasks via Microsoft Graph API. Supports full task lifecycle management including lists, tasks with priorities, due dates, reminders, recurrence patterns, views, search, and data export. Includes comprehensive test suite for reliability. THIS IS A REVISED OAUTH2-BASED VERSION OF ms-todo-sync with AI ASSISTANCE. ALL CREDITS TO THE ORIGINAL AUTHOR.
Install via ClawdBot CLI:
clawdbot install nathanatgit/ms-todo-oauthA fully-tested Microsoft To Do command-line client for managing tasks and lists via Microsoft Graph API.
IF YOU WORRIED ABOUT YOUR PRIVACY, CONSIDER REPLACING THEM TO YOUR OWN IN scripts\ms-todo-oauth.py.
Just search for values below:
client_id="ca6ec244โฆโฆ
client_secret="TwQ8Qโฆโฆ
~/.mstodo_token_cache.json (persists across sessions, auto-refreshed)Before using this skill for the first time, dependencies must be installed:
# Navigate to skill directory
cd <path-to-ms-todo-oauth>
# Create a venv in the project (creates '.venv' folder)
python3 -m venv .venv
# Activate the venv choose based on platforms:
#- Bash/Zsh:
source .venv/bin/activate
# - Fish:
source .venv/bin/activate.fish
# - Windows (PowerShell):
.venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txt
# Alternative (global python env, not recommended):
# pip install -r requirements.txt
Dependencies:
msal (Microsoft Authentication Library) - Official Microsoft OAuth libraryrequests - HTTP client for API callsrequirements.txtAfter installation, verify the setup:
# If using native venv (activate as above):
python3 scripts/ms-todo-oauth.py --help
# Expected: Command help text should be displayed
Troubleshooting:
Python not found, install Python 3.9 or higher from https://python.orgVerify all functionality works correctly:
# Run comprehensive automated test suite (29 tests)
python3 test_ms_todo_oauth.py
# Expected: All tests pass (100% pass rate)
See Testing section for details.
msal library~/.mstodo_token_cache.jsonAll commands follow this pattern:
python3 scripts/ms-todo-oauth.py [GLOBAL_OPTIONS] <command> [COMMAND_OPTIONS]
| Option | Description |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| -v, --verbose | Show detailed information (IDs, dates, notes).Must be placed BEFORE the subcommand. |
| --debug | Enable debug mode to display API requests and responses. Useful for troubleshooting.Must be placed BEFORE the subcommand. |
| --reauth | Force re-authentication by clearing the token cache and starting fresh login |
โ ๏ธ Common mistake: Global options MUST come before the subcommand.
>
- โ
python3 scripts/ms-todo-oauth.py -v lists
- โ
python3 scripts/ms-todo-oauth.py --debug add "Task"
- โ python3 scripts/ms-todo-oauth.py lists -v
Authentication uses OAuth2 authorization code flow, designed for both interactive and automated environments.
login get โ Get OAuth2 authorization URLpython3 scripts/ms-todo-oauth.py login get
Output example:
======================================================================
๐ OAuth2 Authorization Required
======================================================================
Please visit the following URL to authorize the application:
https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?...
After authorization, you will be redirected to a callback URL.
Copy the 'code' parameter from the callback URL and run:
ms-todo-oauth.py login verify <authorization_code>
======================================================================
What to do:
http://localhost:8000/callback?code=M.R3_BAY.abc123...code= (usually a long string starting with M.R3_BAY.)Agent behavior: Present the URL to the user and explain they need to:
login verify โ Complete login with authorization codepython3 scripts/ms-todo-oauth.py login verify <authorization_code>
Example:
python3 scripts/ms-todo-oauth.py login verify "M.R3_BAY.abc123def456..."
Output on success:
โ Authentication successful!
โ Login information saved, you will be logged in automatically next time.
Output on failure:
โ Token acquisition failed
Error: invalid_grant
Description: AADSTS54005: OAuth2 Authorization code was already redeemed...
Exit code: 0 on success, 1 on failure.
Important notes:
login get again to get a new codelogout--reauthlogout โ Clear saved loginpython3 scripts/ms-todo-oauth.py logout
Output: โ Login information cleared
Only use when the user explicitly asks to switch accounts or clear login data. Under normal circumstances, the token is cached and login is automatic.
lists โ List all task listspython3 scripts/ms-todo-oauth.py lists
python3 scripts/ms-todo-oauth.py -v lists # with IDs and creation dates
Output example:
๐ Task Lists (3 total):
1. ไปปๅก
ID: AQMkADAwATYwMAItYTQwZC04OThhLTAwAi0wMAoALgAAA0QJKpxW32BIsIlHaM...
Created: 2024-12-15T08:30:00Z
2. Work
3. Shopping
create-list โ Create a new listpython3 scripts/ms-todo-oauth.py create-list "<name>"
| Argument | Required | Description |
| -------- | -------- | ----------------------------------------------- |
| name | Yes | Name of the new list (supports Unicode/Chinese) |
Example:
python3 scripts/ms-todo-oauth.py create-list "้กน็ฎ A"
Output: โ List created: ้กน็ฎ A
delete-list โ Delete a listpython3 scripts/ms-todo-oauth.py delete-list "<name>" [-y]
| Argument/Option | Required | Description |
| --------------- | -------- | -------------------------- |
| name | Yes | Name of the list to delete |
| -y, --yes | No | Skip confirmation prompt |
โ ๏ธ This is a destructive operation. Without -y, the command will prompt for confirmation. All tasks in the list will be deleted. Consider asking the user before deleting important lists.
Output: โ List deleted:
Exit code: 1 if list not found, 0 on success
add โ Add a new taskpython3 scripts/ms-todo-oauth.py add "<title>" [options]
| Option | Required | Default | Description |
| --------------------- | -------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| title | Yes | โ | Task title (positional argument, supports Unicode/Chinese/emojis) |
| -l, --list | No | (default list) | Target list name. If not specified, uses your Microsoft To Do default list. |
| -p, --priority | No | normal | Priority:low, normal, high |
| -d, --due | No | โ | Due date. Accepts days from now (3 or 3d) or date (2026-02-15). Note: Only date is supported by Microsoft To Do API, not time. |
| -r, --reminder | No | โ | Reminder datetime. Formats:3h (hours from now), 2d (days from now), 2026-02-15 14:30 (date+time with space, needs quotes), 2026-02-15T14:30:00 (ISO format), 2026-02-15 (date only, defaults to 09:00). |
| -R, --recurrence | No | โ | Recurrence pattern. Formats:daily (every day), weekdays (Mon-Fri), weekly (every week), monthly (every month). With interval: daily:2 (every 2 days), weekly:3 (every 3 weeks), monthly:2 (every 2 months). |
| -D, --description | No | โ | Task description/notes (supports multiline with quotes) |
| -t, --tags | No | โ | Comma-separated tags/categories (e.g.,"work,urgent") |
| --create-list | No | False | Create the list if it doesn't exist (deprecated, lists auto-create now) |
Auto-created lists: If the specified list doesn't exist, it will be automatically created.
Output example:
โ Task added: Complete report
With recurrence:
โ Task added: Daily standup
๐ Recurring task created
Examples:
# Simple task
python3 scripts/ms-todo-oauth.py add "Buy milk" -l "Shopping"
# High priority task due in 3 days
python3 scripts/ms-todo-oauth.py add "Submit report" -l "Work" -p high -d 3
# Task with reminder in 2 hours
python3 scripts/ms-todo-oauth.py add "Call client" -r 2h
# Task with specific date and time reminder
python3 scripts/ms-todo-oauth.py add "Meeting" -d 2026-03-15 -r "2026-03-15 14:30"
# Daily recurring task
python3 scripts/ms-todo-oauth.py add "Daily standup" -l "Work" -R daily
# Weekday recurring task
python3 scripts/ms-todo-oauth.py add "Gym" -R weekdays -l "Personal"
# Task with all options
python3 scripts/ms-todo-oauth.py add "Project Review" \
-l "Work" \
-p high \
-d 7 \
-r "2026-02-20 14:00" \
-D "Review Q1 deliverables and prepare presentation" \
-t "work,important,meeting"
# Chinese task with emoji
python3 scripts/ms-todo-oauth.py add "๐ ๅฎๆ้กน็ฎ" -l "ไปปๅก" -p high
complete โ Mark a task as completedpython3 scripts/ms-todo-oauth.py complete "<title>" [-l "<list>"]
| Option | Required | Default | Description |
| -------------- | -------- | -------------- | -------------------------------- |
| title | Yes | โ | Exact task title |
| -l, --list | No | (default list) | List name where the task resides |
Title matching: Requires exact match. If unsure of exact title, use search first.
Output: โ Task completed:
Exit code: 1 if task not found, 0 on success
delete โ Delete a taskpython3 scripts/ms-todo-oauth.py delete "<title>" [-l "<list>"] [-y]
| Option | Required | Default | Description |
| -------------- | -------- | -------------- | -------------------------------- |
| title | Yes | โ | Exact task title |
| -l, --list | No | (default list) | List name where the task resides |
| -y, --yes | No | โ | Skip confirmation prompt |
โ ๏ธ Destructive operation. Without -y, will prompt for confirmation.
Output: โ Task deleted:
Exit code: 1 if task not found, 0 on success
tasks โ List tasks in a specific listpython3 scripts/ms-todo-oauth.py tasks "<list>" [-a]
| Option | Required | Description |
| ------------- | -------- | -------------------------------------------------- |
| list | Yes | List name (exact match) |
| -a, --all | No | Include completed tasks (default: incomplete only) |
Output example:
๐ Tasks in list "Work" (2 total):
1. [In Progress] Write documentation โญ
2. [In Progress] Review PR
With -a flag:
๐ Tasks in list "Work" (3 total):
1. [In Progress] Write documentation โญ
2. [Completed] Submit report
3. [In Progress] Review PR
Exit code: 1 if list not found, 0 on success
pending โ All incomplete tasks across all listspython3 scripts/ms-todo-oauth.py pending [-g]
| Option | Required | Description |
| --------------- | -------- | --------------------- |
| -g, --group | No | Group results by list |
Output example (with -g):
๐ All incomplete tasks (3 total):
๐ Work:
[In Progress] Write documentation โญ
[In Progress] Review PR
๐ Shopping:
[In Progress] Buy groceries
Without -g:
๐ All incomplete tasks (3 total):
[In Progress] Write documentation โญ
List: Work
[In Progress] Review PR
List: Work
[In Progress] Buy groceries
List: Shopping
today โ Tasks due todaypython3 scripts/ms-todo-oauth.py today
Lists incomplete tasks with due date matching today's date.
Output example:
๐
Tasks due today (2 total):
[In Progress] Submit report โญ
List: Work
[In Progress] Buy groceries
List: Shopping
If no tasks: ๐
No tasks due today
overdue โ Overdue taskspython3 scripts/ms-todo-oauth.py overdue
Lists incomplete tasks past their due date, sorted by days overdue.
Output example:
โ ๏ธ Overdue tasks (1 total):
[In Progress] Submit report โญ
List: Work
Overdue: 3 days
If no overdue tasks: โ No overdue tasks
detail โ View full task detailspython3 scripts/ms-todo-oauth.py detail "<title>" [-l "<list>"]
| Option | Required | Default | Description |
| -------------- | -------- | -------------- | -------------------------------------------------- |
| title | Yes | โ | Task title (supportspartial/fuzzy match) |
| -l, --list | No | (default list) | List name |
Fuzzy matching: Matches tasks containing the search string (case-insensitive).
When multiple tasks match:
Output example:
============================================================
๐ Task Details
============================================================
๐ Title: Complete Q1 Report
๐ Status: [In Progress]
โก Priority: โญ High
๐
Created: 2026-01-15 08:30:00
๐ Modified: 2026-02-10 14:22:00
โฐ Due: 2026-02-20 00:00:00
๐ Reminder: 2026-02-20 09:00:00
๐ Notes:
- Review sales figures
- Include charts
- Prepare for board meeting
๐ท๏ธ Categories: work, important, Q1
๐ Recurrence:
Every week on Monday
Start date: 2026-02-17
No end date
============================================================
search โ Search tasks by keywordpython3 scripts/ms-todo-oauth.py search "<keyword>"
Searches across all lists in both task titles and descriptions (case-insensitive).
Output example:
๐ Search results for "report" (2 found):
[In Progress] Complete Q1 Report โญ
List: Work
Notes: Review sales figures...
[Completed] Submit weekly report
List: Work
stats โ Task statisticspython3 scripts/ms-todo-oauth.py stats
Shows aggregate statistics across all lists.
Output example:
๐ Task Statistics:
Total lists: 3
Total tasks: 15
Completed: 10
Pending: 5
High priority: 2
Overdue: 1
Completion rate: 66.7%
export โ Export all tasks to JSONpython3 scripts/ms-todo-oauth.py export [-o "<filename>"]
| Option | Required | Default | Description |
| ---------------- | -------- | -------------------- | ---------------- |
| -o, --output | No | todo_export.json | Output file path |
Exports complete task data from all lists in JSON format.
Output: โ Tasks exported to:
JSON structure:
{
"Work": [
{
"id": "AQMkADAwATYwMAItYTQw...",
"title": "Complete report",
"status": "notStarted",
"importance": "high",
"createdDateTime": "2026-01-15T08:30:00Z",
"dueDateTime": {
"dateTime": "2026-02-20T00:00:00.0000000",
"timeZone": "UTC"
},
"body": {
"content": "Review Q1 numbers",
"contentType": "text"
},
"categories": ["work", "important"]
}
],
"Shopping": [...]
}
| Code | Meaning |
| ----- | ------------------------------------------------------------------------- |
| 0 | Success |
| 1 | Failure (not logged in, API error, invalid arguments, resource not found) |
| 2 | Invalid command-line arguments |
| Error | Cause | Resolution |
| ----------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------- |
| โ Not logged in | No cached token or token expired | Run login get then login verify |
| ModuleNotFoundError: No module named 'msal' | Dependencies not installed | Run pip install -r requirements.txt |
| โ List not found: | Specified list does not exist | Check list name with lists command. Note: exact match required. |
| โ Task not found: | No task with exact matching title | Use search to find exact title, or tasks " to list all tasks |"
| โ Error: Invalid isoformat string | DateTime parsing error | This should not occur in v1.1.0+. If you see this, report as bug. |
| โ Error: Unsupported HTTP method | Internal API error | This should not occur in v1.1.0+. If you see this, report as bug. |
| โ Error: | Microsoft Graph API error | Retry; check network; use --debug for full details |
| Network error / Connection timeout | No internet or API unreachable | Check network connection; verify access to graph.microsoft.com |
This skill includes a comprehensive test suite to ensure reliability.
Run the full test suite:
cd <skill-directory>
python3 test_ms_todo_oauth.py
Prerequisites:
Test Coverage (29 tests):
Expected output:
========================================================================
TEST SUMMARY
========================================================================
Total tests: 29
Passed: 29
Failed: 0
Pass rate: 100.0%
========================================================================
๐ ALL TESTS PASSED! ๐
========================================================================
For manual verification, see MANUAL_TEST_CHECKLIST.txt which provides:
The automated test suite:
๐งช Test List 14:23:45)If tests are interrupted, you may need to manually delete leftover test lists.
cd to the directory containing this SKILL.md before running commands.
python3 scripts/ms-todo-oauth.py lists
If this returns "Not logged in" error (exit code 1), initiate the login flow.
lists to see available task listsdelete and delete-list:-y flag ONLY when:-y-v, --debug, and --reauth must come BEFORE the subcommand:python3 scripts/ms-todo-oauth.py -v listspython3 scripts/ms-todo-oauth.py lists -vlogin verify until user confirms they've completed browser authenticationlogin get again for a new code--debug flag when troubleshooting API issuesStep 1: Setup and Authentication Check
---------------------------------------
cd <skill_directory>
python3 scripts/ms-todo-oauth.py lists # Test auth & see available lists
If exit code is 1 and output contains "Not logged in":
a. python3 scripts/ms-todo-oauth.py login get
b. Present URL to user
c. Explain: "Visit this URL, login, and copy the 'code' parameter from callback URL"
d. Wait for user to provide authorization code
e. python3 scripts/ms-todo-oauth.py login verify "<code>"
f. Verify success (exit code 0)
Step 2: Task Analysis and List Selection
-----------------------------------------
When user requests to add task(s):
a. Analyze task context from user's description
b. Review available lists (from Step 1 output)
c. Choose appropriate list or use default:
- Work-related โ "Work"
- Personal errands โ "Personal" or default
- Shopping items โ "Shopping"
- Project-specific โ "<ProjectName>"
d. If list doesn't exist, it will be auto-created
Step 3: Execute Operation
--------------------------
Add task with appropriate options:
python3 scripts/ms-todo-oauth.py add "Task Title" \
-l "Work" \
-p high \
-d 3 \
-r 2h \
-D "Detailed description" \
-t "tag1,tag2"
Step 4: Verify and Report
--------------------------
Check exit code:
- 0: Success โ Confirm to user
- 1: Failure โ Parse error, provide guidance
- 2: Invalid args โ Fix command syntax
Optionally verify:
python3 scripts/ms-todo-oauth.py tasks "<list>" # Show updated list
complete, delete commandsdetail, search commandssearch first to find exact title, then use it in subsequent commandsExample workflow:
# Find task with fuzzy search
python3 scripts/ms-todo-oauth.py search "report"
# Output shows: "Complete Q1 Report"
# Use exact title from search results
python3 scripts/ms-todo-oauth.py complete "Complete Q1 Report" -l "Work"
-l is not specified, operations use the Microsoft To Do default list-l "" User request: "Add these tasks: buy milk, finish report, call dentist"
Agent approach:
# First check available lists
python3 scripts/ms-todo-oauth.py lists
# Categorize intelligently:
python3 scripts/ms-todo-oauth.py add "Buy milk" -l "Shopping"
python3 scripts/ms-todo-oauth.py add "Finish report" -l "Work" -p high -d 2
python3 scripts/ms-todo-oauth.py add "Call dentist" -l "Personal"
# Or use default list if no specific context: add "Call dentist"
Daily task review:
python3 scripts/ms-todo-oauth.py today # Check today's tasks
python3 scripts/ms-todo-oauth.py overdue # Check overdue tasks
python3 scripts/ms-todo-oauth.py -v pending -g # Review all pending, grouped
Adding various task types:
# Simple task (default list)
python3 scripts/ms-todo-oauth.py add "Buy milk"
# Work task with priority and deadline
python3 scripts/ms-todo-oauth.py add "Quarterly review" -l "Work" -p high -d 7
# Task with reminder
python3 scripts/ms-todo-oauth.py add "Call client" -r 3h
# Detailed task with all options
python3 scripts/ms-todo-oauth.py add "Project meeting" \
-l "Work" \
-p high \
-d 2026-03-15 \
-r "2026-03-15 14:30" \
-D "Discuss Q1 goals and resource allocation" \
-t "meeting,important,Q1"
# Recurring tasks
python3 scripts/ms-todo-oauth.py add "Daily standup" -R daily -l "Work"
python3 scripts/ms-todo-oauth.py add "Weekly review" -R weekly -d 7
python3 scripts/ms-todo-oauth.py add "Gym" -R weekdays -l "Personal"
python3 scripts/ms-todo-oauth.py add "Monthly report" -R monthly -p high
Task completion workflow:
# Search for task
python3 scripts/ms-todo-oauth.py search "report"
# Complete using exact title from search results
python3 scripts/ms-todo-oauth.py complete "Quarterly review" -l "Work"
Data management:
# Export for backup
python3 scripts/ms-todo-oauth.py export -o "backup_$(date +%Y%m%d).json"
# View statistics
python3 scripts/ms-todo-oauth.py stats
start_date parameter in create_task()complete_task() methodProblem: โ Not logged in
login get, complete browser flow, then login verify Problem: โ Token acquisition failed: invalid_grant
login get again to get a fresh codeProblem: Login worked but now getting "Not logged in" again
--reauth to force fresh login:
python3 scripts/ms-todo-oauth.py --reauth lists
Problem: ModuleNotFoundError: No module named 'msal'
pip install -r requirements.txtProblem: Connection timeout or network errors
--debug flag to see full API request/responseProblem: Unexpected API errors
python3 scripts/ms-todo-oauth.py --reauth listspython3 scripts/ms-todo-oauth.py --debug Problem: โ Task not found:
search to find exact titlecomplete and delete require exact title matchProblem: โ List not found:
lists to see exact list namesProblem: Tests failing with datetime errors
_parse_ms_datetime() helper function existsProblem: Tests failing with "Not logged in"
python3 scripts/ms-todo-oauth.py login get
# Complete browser flow
python3 scripts/ms-todo-oauth.py login verify <code>
# Then run tests
python3 test_ms_todo_oauth.py
test_ms_todo_oauth.py - Automated testsMANUAL_TEST_CHECKLIST.txt - Step-by-step testing guideQUICK_REFERENCE.txt - Command cheat sheetCOMPLETE_FIX_PATCH.txt - Documentation of v1.1.0 fixesReporting Issues:
--debug flag if applicablepython3 --versionTesting New Features:
test_ms_todo_oauth.py for new featuresMANUAL_TEST_CHECKLIST.txt with manual test proceduresMIT License - See LICENSE file for details
Version: 1.1.0
Last Updated: 2026-02-13
Status: โ Fully Tested & Production Ready
Generated Mar 1, 2026
Individuals can use this CLI tool to manage their daily tasks, set reminders, and organize lists directly from the terminal. It supports recurring tasks and rich options like priorities and due dates, making it ideal for personal productivity without relying on a GUI.
Small teams or remote workers can integrate this skill into their workflows to track project tasks, assign deadlines, and export data for reporting. The search and export features help in monitoring progress and sharing updates across team members.
Students and educators can manage assignments, study schedules, and deadlines using this tool. The support for Unicode and emojis allows for creative task naming, while recurring patterns help with regular class activities.
Freelancers can automate task creation and tracking for client projects, using due dates and reminders to stay on schedule. The CLI interface enables quick updates from any terminal, streamlining administrative work.
IT professionals can use this skill to log maintenance tasks, set reminders for system checks, and track issues via searchable lists. The robust test suite ensures reliability in critical environments.
Offer a basic version of this CLI tool for free, with premium features like advanced analytics or team collaboration available via subscription. Integrate with existing productivity platforms to attract users seeking enhanced task management.
License this skill to businesses for internal use, providing custom support, security audits, and integration with corporate Microsoft accounts. Target companies needing reliable, tested task management tools for employees.
Provide consulting services to customize the skill for specific client needs, such as adding new features or integrating with other APIs. This model leverages the open-source nature for tailored solutions.
๐ฌ Integration Tip
Ensure proper OAuth2 setup by replacing default client IDs with custom ones for security, and test the skill in a controlled environment before deployment to avoid authentication issues.
Manage Trello boards, lists, and cards via the Trello REST API.
Sync and query CalDAV calendars (iCloud, Google, Fastmail, Nextcloud, etc.) using vdirsyncer + khal. Works on Linux.
Manage tasks and projects in Todoist. Use when user asks about tasks, to-dos, reminders, or productivity.
Master OpenClaw's timing systems. Use for scheduling reliable reminders, setting up periodic maintenance (janitor jobs), and understanding when to use Cron v...
Calendar management and scheduling. Create events, manage meetings, and sync across calendar providers.
Kanban-style task management dashboard for AI assistants. Manage tasks via CLI or dashboard UI. Use when user mentions tasks, kanban, task board, mission con...