
Add Command
Straightforward guide for extending todoist-cli with new commands or subcommands. You'll reach for this when you're wiring up SDK endpoints to the CLI, adding subcommands to existing command groups, or generally expanding what the tool can do from the command line. The skill points to a detailed markdown guide with the actual implementation steps, so this is more of an entry point than a standalone reference. Useful if you're contributing to the project or maintaining a fork, less so if you're just using the CLI as is. The structure assumes you're already familiar with the codebase and just need the pattern for adding commands consistently.
- GitHub stars
- 217
- last updated
- Jun 11, 2026
Install
$ npx -y skills add doist/todoist-cli --skill add-command --agent claude-codeInstalls into .claude/skills of the current project.
Files
Adding a New CLI Command or Subcommand
Follow this checklist when adding new commands. Each step references the exact file to modify.
1. Mock API (src/test-support/mock-api.ts)
Add a mock for each new SDK method in createMockApi(). Place it in the correct entity group.
- List/read methods:
.mockResolvedValue({ results: [], nextCursor: null })or appropriate empty default - Mutation methods:
vi.fn()(no default return needed)
2. Spinner Messages (src/lib/api/core.ts)
Add an entry to API_SPINNER_MESSAGES for each new SDK method.
Color convention:
blue— read/fetch operationsgreen— create/join operationsyellow— update/delete/archive mutations
3. Read-Only Permissions (src/lib/permissions.ts)
If the new command uses a read-only SDK method (e.g., getXxx, listXxx), add it to the KNOWN_SAFE_API_METHODS set. This set uses a default-deny approach: any method not listed is treated as mutating and will be blocked when the CLI is authenticated with a read-only OAuth token (td auth login --read-only).
Sponsors
Details
- Repository
- github.com/doist/todoist-cli
- Categories
- Documentation, CLI & Terminal
- License
- MIT
- First seen
- Jun 11, 2026