A command-line interface for Microsoft To Do, built with TypeScript and Node.js.
- OAuth authentication via Microsoft device code flow
- Manage todo lists (create, list)
- Manage tasks (create, update, complete, list, get)
- Manage task steps / checklist items (create, update, complete, delete, list)
- JSON output for easy scripting and integration
- MSAL token cache stored in
~/.ms-todo-cli/msal-cache.json(mode 0o600)
npm install -g ms-todo-cliOr clone and build locally:
git clone https://github.com/your-org/ms-todo-cli
cd ms-todo-cli
npm install
npm run build
npm linkTo use this CLI, you need to register an application in Azure Active Directory:
- Go to Azure Portal → Azure Active Directory → App registrations
- Click New registration
- Name:
ms-todo-cli(or any name) - Supported account types: Accounts in any organizational directory and personal Microsoft accounts
- Redirect URI: leave blank (device code flow doesn't need one)
- Name:
- Click Register
- Copy the Application (client) ID
- Under API permissions, add:
Tasks.ReadWrite(Microsoft Graph, Delegated)User.Read(Microsoft Graph, Delegated)offline_access(Microsoft Graph, Delegated)
- Grant admin consent if required by your organization
| Variable | Description | Required |
|---|---|---|
MS_TODO_CLIENT_ID |
Azure app client ID | Yes — the CLI will fail fast if not set |
Set your client ID before using:
export MS_TODO_CLIENT_ID="your-azure-client-id"ms-todo-cli auth loginFollow the device code instructions printed to stderr. After login, a success JSON is printed to stdout.
ms-todo-cli auth statusms-todo-cli auth print-accountms-todo-cli auth logoutms-todo-cli list create "Shopping"ms-todo-cli list listms-todo-cli task create --title "Buy milk" --list "Shopping"
ms-todo-cli task create --title "Buy milk" --due "2024-12-31T00:00:00Z" --priority highecho '{"title":"Buy eggs","list":"Shopping"}' | ms-todo-cli task create --stdinms-todo-cli task update --task-id "TASK_ID" --title "Buy oat milk"
ms-todo-cli task update --task-id "TASK_ID" --completed true
# Provide --list-id to skip the O(N) list scan:
ms-todo-cli task update --task-id "TASK_ID" --list-id "LIST_ID" --title "Buy oat milk"ms-todo-cli task complete --task-id "TASK_ID"
# Provide --list-id to skip the O(N) list scan:
ms-todo-cli task complete --task-id "TASK_ID" --list-id "LIST_ID"ms-todo-cli task list --list "Shopping"
ms-todo-cli task list --list-id "LIST_ID"ms-todo-cli task get --task-id "TASK_ID"
# Provide --list-id to skip the O(N) list scan:
ms-todo-cli task get --task-id "TASK_ID" --list-id "LIST_ID"Microsoft To Do supports checklist items (steps) within a task.
ms-todo-cli step list --task-id "TASK_ID"ms-todo-cli step create --task-id "TASK_ID" --title "Sub-task title"ms-todo-cli step update --task-id "TASK_ID" --step-id "STEP_ID" --title "New title"ms-todo-cli step complete --task-id "TASK_ID" --step-id "STEP_ID"ms-todo-cli step delete --task-id "TASK_ID" --step-id "STEP_ID"Top-level shortcuts for common task operations:
ms-todo-cli create --title "Buy milk"
ms-todo-cli update --task-id "TASK_ID" --title "Buy oat milk"
ms-todo-cli get --task-id "TASK_ID"All output is valid JSON. Success responses have ok: true:
{"ok":true,"task":{"id":"...","title":"Buy milk","status":"notStarted"}}Error responses have ok: false and exit with code 1:
{"ok":false,"error":{"code":"AUTH_REQUIRED","message":"Not authenticated. Run: ms-todo-cli auth login"}}The JSON output is designed for easy parsing:
# Get all lists and parse with jq
ms-todo-cli list list | jq '.lists[].displayName'
# Create a task and capture its ID
TASK_ID=$(ms-todo-cli create --title "Review PR" | jq -r '.task.id')
# Complete the task
ms-todo-cli task complete --task-id "$TASK_ID"npm run build # Compile TypeScript
npm test # Run tests
npm run lint # Lint source filesMIT