Skip to content

feat: add folder command group#248

Merged
scottlovegrove merged 5 commits intomainfrom
scottl/folders
Apr 20, 2026
Merged

feat: add folder command group#248
scottlovegrove merged 5 commits intomainfrom
scottl/folders

Conversation

@scottlovegrove
Copy link
Copy Markdown
Collaborator

Summary

  • Adds td folder command group with list, view, create, update, and delete subcommands
  • Exposes the SDK's folder CRUD endpoints (getFolders, getFolder, addFolder, updateFolder, deleteFolder)
  • Folders are workspace-scoped — list and create require a workspace ref (positional or --workspace), while update/delete/view support id:xxx directly or name-based lookup with --workspace
  • Auto-detects workspace when only one exists

Test plan

  • 21 new tests in folder.test.ts covering all subcommands, JSON output, dry-run, empty states, workspace auto-detection, and error cases
  • All 1271 existing tests still pass
  • Type check, lint, format, and skill sync all clean
  • Manual test: td folder list <workspace>, td folder create <workspace> --name "Test", td folder view <ref>, td folder update <ref> --name "New", td folder delete <ref> --yes

🤖 Generated with Claude Code

@doistbot doistbot requested a review from rmartins90 April 11, 2026 09:25
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

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

This PR introduces the new td folder command group, providing a complete set of CRUD operations for workspace-scoped folders along with excellent test coverage. These additions thoughtfully extend the CLI's capabilities by seamlessly integrating folder management with workspace auto-detection. A few adjustments are needed to ensure the --cursor flag is properly passed to the pagination function in the list command, and to include the 'folder' entity type argument for formatJson in mutating commands for consistent output formatting.

Share FeedbackReview Logs

Comment thread src/commands/folder/create.ts Outdated
Comment thread src/commands/folder/update.ts Outdated
Comment thread src/commands/folder/list.ts Outdated
Comment thread src/commands/folder/helpers.ts
Comment thread src/commands/folder/view.ts Outdated
@scottlovegrove scottlovegrove force-pushed the scottl/folders branch 3 times, most recently from bd82746 to e6ee682 Compare April 13, 2026 20:29
Copy link
Copy Markdown
Contributor

@rmartins90 rmartins90 left a comment

Choose a reason for hiding this comment

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

scottlovegrove and others added 3 commits April 20, 2026 15:33
Adds `td folder` with list, view, create, update, and delete subcommands,
exposing the SDK's folder CRUD endpoints for workspace folder management.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Pass startCursor to paginate() in folder list so --cursor works
- Add 'folder' to EntityType and pass it to formatJson in create/update
- Define FOLDER_ESSENTIAL_FIELDS for consistent JSON output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove parseInt() wrappers and update test expectations to match
the string-typed workspaceId from SDK v9.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SDK 9.8 adds folderId filter to getProjects() and folderId field to
updateProject() (Doist/todoist-sdk-typescript#590).

- folder view now uses getProjects({ folderId }) instead of fetching
  all projects and filtering client-side
- project update --folder <ref> moves a workspace project into a folder
- project update --no-folder removes a workspace project from its folder

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove self-assigned this Apr 20, 2026
@scottlovegrove
Copy link
Copy Markdown
Collaborator Author

@doistbot /review

Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

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

This PR introduces the td folder command group, bringing comprehensive CRUD operations for workspace folders to the CLI. The implementation is solid, featuring a strong test suite and clean integration with the workspace auto-detection logic. There are just a couple of adjustments needed, specifically passing the project's workspace ID during folder resolution to prevent errors for multi-workspace users, and adding upfront validation for order flags to ensure malformed inputs aren't sent to the SDK.

Share FeedbackReview Logs

Comment thread src/commands/project/update.ts Outdated
Comment thread src/commands/folder/create.ts Outdated
- project update --folder now passes the project's workspaceId to the
  folder resolver, so users with multiple workspaces don't get a
  confusing "specify --workspace" error
- folder create/update validate --default-order and --child-order
  upfront via a parseOrderArg validator (non-negative integer), instead
  of silently coercing malformed input

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove added the 👀 Show PR PR must be reviewed before or after merging label Apr 20, 2026
@scottlovegrove scottlovegrove merged commit 4a17765 into main Apr 20, 2026
4 checks passed
@scottlovegrove scottlovegrove deleted the scottl/folders branch April 20, 2026 15:17
doist-release-bot bot added a commit that referenced this pull request Apr 20, 2026
## [1.51.0](v1.50.0...v1.51.0) (2026-04-20)

### Features

* add folder command group ([#248](#248)) ([4a17765](4a17765))
@doist-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.51.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

released 👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants