Skip to content

fix(folders): preserve parent folder in JSON output - #136

Open
justkelvin wants to merge 1 commit into
krodak:mainfrom
justkelvin:fix/preserve-parent-folder
Open

fix(folders): preserve parent folder in JSON output#136
justkelvin wants to merge 1 commit into
krodak:mainfrom
justkelvin:fix/preserve-parent-folder

Conversation

@justkelvin

Copy link
Copy Markdown

Summary

Preserve ClickUp's documented parent_folder field in the JSON output of:

cup folders <space-id> --json

This allows consumers and AI agents to distinguish subfolders from top-level folders and reconstruct the folder hierarchy.

Problem

ClickUp's Get Folders API includes parent_folder for subfolders.

The API response reached the client intact, but the local Folder type did not expose the field and the folders command rebuilt each result using only:

  • id
  • name
  • lists

As a result, cup folders --json flattened folders and subfolders without preserving their parent relationship.

Changes

  • Add parent_folder?: string to the API folder type.
  • Add parent_folder?: string to the folders command result type.
  • Preserve the field only when ClickUp supplies it.
  • Keep the existing flat-array JSON structure.
  • Leave TTY and Markdown output unchanged.
  • Add regression coverage for both top-level folders and subfolders.
  • Document the JSON behavior in the README, command reference, and agent skill.

Example

[
  {
    "id": "100100",
    "name": "Acme Operations",
    "lists": []
  },
  {
    "id": "100110",
    "name": "Acme Launches",
    "parent_folder": "100100",
    "lists": []
  }
]

Copilot AI review requested due to automatic review settings July 31, 2026 12:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@justkelvin

Copy link
Copy Markdown
Author

Fixes #135

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants