Conversation
doistbot
left a comment
There was a problem hiding this comment.
This PR successfully introduces the td goal command alongside its subcommands, reference resolution, and test coverage, significantly expanding the CLI's capabilities. The implementation is well-structured and aligns closely with existing CLI patterns to provide a seamless experience for the new SDK features. There are just a few logic and consistency details to refine, specifically regarding workspace flag evaluation during listing, pagination in reference resolution, empty update handling, and ensuring JSON outputs include both complete goal objects and their associated ownerId fields.
|
CI failures are expected — this PR depends on the SDK PR (Doist/todoist-sdk-typescript#548) which adds the Goal types and methods. Once that merges and publishes from |
94634c9 to
9c6c4ae
Compare
838d426 to
fd927b3
Compare
scottlovegrove
left a comment
There was a problem hiding this comment.
Approving, but we still need to add the workspaceId to the getGoals() call. We can do that now even though the SDK isn't ready for it, because there is no SDK update for this to validate against just yet 😄
| td goal uncomplete "Ship v2" # Reopen a completed goal | ||
| td goal link "Ship v2" --task "Buy milk" # Link a task to a goal | ||
| td goal unlink "Ship v2" --task "Buy milk" # Unlink a task from a goal | ||
| ``` |
There was a problem hiding this comment.
It would be good if the interface to link tasks to a goal would support passing multiple tasks at once. Ask the coding agent that you're using what would be a good way to support that in the command line interface.
And maybe this is something we should support at the SDK level as well.
There was a problem hiding this comment.
Good idea! Here are the options for supporting multiple tasks:
Option 1: Repeated flag (recommended)
td goal link "Ship v2" --task "Buy milk" --task "Write tests"Commander supports this natively with variadic options. Idiomatic and consistent with how --labels works on td task add.
Option 2: Comma-separated
td goal link "Ship v2" --tasks "id:abc,id:def"Simple but breaks if task names contain commas. Works well with IDs only.
Option 3: Positional args
td goal link "Ship v2" "Buy milk" "Write tests"Clean but ambiguous — hard to tell where the goal ref ends and task refs begin.
At the SDK level, linkTaskToGoal currently takes a single taskId. The CLI can loop over multiple tasks client-side for now. A batch SDK method or backend endpoint could be added later if needed.
What's your preference?
There was a problem hiding this comment.
And maybe this is something we should support at the SDK level as well.
We should, but it would require backend updates as well in order for the SDK to not just be making multiple calls.
What's your preference?
Option 1 I think would be my preference on this.
There was a problem hiding this comment.
yeah, option 1, more explicit, no big deal since it will be the agents generating the command lines they want to execute.
There was a problem hiding this comment.
Option 1 it is. Should I also tackle support at the SDK at backend level?
There was a problem hiding this comment.
Scott: whether we are supporting adding a goalId when creating a task. If we're not, should we?
We should. Adding a task to revisit this later.
Ernesto: what happens if some of the task references are not resolved to actual tasks, but some are?
I'd prefer linking what was resolved, and returning a list of taskId's that weren't able to be linked. This would give the user/agent enough information for the next steps.
Thoughts?
There was a problem hiding this comment.
I'd prefer linking what was resolved, and returning a list of taskId's that weren't able to be linked. This would give the user/agent enough information for the next steps.
Sounds good to me 👍🏻
There was a problem hiding this comment.
@scottlovegrove @gnapse I'll tackle this extension in a separate PR. does that make sense?
Add goal management with subcommands: list, view (default), create, update, delete, complete, uncomplete, link, unlink. Integration points: - resolveGoalRef() in refs.ts - goalsUrl/workspaceGoalsUrl in urls.ts - GOAL_ESSENTIAL_FIELDS in output.ts - goals: 200 in pagination.ts - Goal mocks and fixtures for tests - Skill content updated with goal commands Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- listGoals now resolves --workspace ref and filters by workspace ID - resolveGoalRef now paginates to fetch all goals for name matching Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ct empty updates - Add ownerId to GOAL_ESSENTIAL_FIELDS - goal view --json now includes both goal and tasks objects - goal update with no flags throws an error instead of empty API call Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Make learnRust fixture workspace-owned for coverage - Format ownerType as User/Workspace (not shouty USER/WORKSPACE) - Add accessibility support for completion indicator - Destructure options in updateGoal for cleaner code Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove workspace ref resolution and client-side filtering from list (backend will handle workspace_id filtering before merge) - Use if (name) instead of if (name !== undefined) for update args Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve --workspace ref and pass workspaceId to the API call. Uses type assertion since the SDK doesn't have this param yet — will be cleaned up when the SDK is updated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- linkItemToGoal → linkTaskToGoal - unlinkItemFromGoal → unlinkTaskFromGoal Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fab14dc to
4f0aa3d
Compare
- Update @doist/todoist-sdk to 8.4.0-next.2 (published from next) - Handle nullable goal.progress with optional chaining - Adapt linkTaskToGoal/unlinkTaskFromGoal to TaskLinkingArgs object - Fix isAccessible import (moved to global-args.js on next) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@scottlovegrove |
|
🎉 This PR is included in version 1.40.0-next.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.43.0-next.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
td goalcommand with 9 subcommands: list, view (default), create, update, delete, complete, uncomplete, link, unlinkresolveGoalRef()for name/ID/URL resolutionGOAL_ESSENTIAL_FIELDSfor JSON outputPart of bringing the
Goalsfeature to the REST API, CLI, and MCP. See spec.Depends on SDK PR (Doist/todoist-sdk-typescript#548).
mainmaintd goalmainmainMerge order: 1.1 → 1.2 → 1.3 → 1.4 → 1.5 → 2 → (3 + 4 in parallel)
Test plan
npm test— all 1162 tests passnpm run type-check— cleannpm run check:skill-sync— in sync🤖 Generated with Claude Code