Skip to content

Add label delete command#23

Merged
garaemon merged 2 commits intomainfrom
2026.04.05-label-delete
Apr 7, 2026
Merged

Add label delete command#23
garaemon merged 2 commits intomainfrom
2026.04.05-label-delete

Conversation

@garaemon
Copy link
Copy Markdown
Owner

@garaemon garaemon commented Apr 5, 2026

Delete labels from Paperpile library via the CLI

Adds paperpile label delete <label_name> which resolves the label name to its
ID and marks it as trashed via the Sync API (trashed: 1 on the Collections
mcollection).

Test plan

  • API layer tests: success (verifies sync request structure with trashed=1), label not found, server error
  • CMD layer tests: success output, error propagation
  • go vet and go test ./... pass

🤖 Generated with Claude Code

garaemon and others added 2 commits April 5, 2026 11:37
Implement `label delete` which marks a label as trashed via the Sync API
(mcollection=Collections, action=update, data={trashed:1}).

- Add DeleteLabel method to api.Client
- Add LabelDeleter interface and labelDeleteCmd cobra command
- Add tests for API layer (success, label not found, server error)
- Add tests for CMD layer (success, error)
- Update README with label delete documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Sync API update action requires a "fields" key listing the fields being
updated, and an "updated" timestamp in the data payload. Without these the
server rejects the request with a 400 schema validation error.
Matches the pattern used by TrashItem in delete.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@garaemon garaemon merged commit ac68ddf into main Apr 7, 2026
3 checks passed
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.

1 participant