Repository navigation
feat(task): add task archive - #49
Merged
Merged
Conversation
timimsms
force-pushed
the
feat/task-archive
branch
from
November 15, 2026 18:23
3e28215 to
941b434
Compare
Archiving removes a task from active views while keeping its history and URL, which is the right primitive for retiring a task whose work has moved elsewhere. Closing it would assert a status the task never reached — and "closed" is not a status name on every list — while deleting destroys the record. The SDK cannot express this: clickup.TaskUpdateRequest has no archived field, so the request is built directly against the exported NewRequest/Do. Reversible with --undo; round-trip verified against a real workspace, with the task URL and status intact afterwards. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aqbmccWm1tqttmBUCR5rv ClickUp: 86dxbeqyt
Escape the task ID with url.PathEscape when building the archive path. Set SilenceUsage on task archive so API failures no longer print the usage block, and wrap errors as "failed to archive/unarchive task". Give the --undo flag its own comment block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
timimsms
force-pushed
the
feat/task-archive
branch
from
November 15, 2026 18:26
941b434 to
8471eef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
cu task archive, which had no equivalent in the CLI.Why archive rather than close or delete. Archiving removes a task from active views while keeping its history and its URL. For retiring a task whose work has moved elsewhere, that is the only correct primitive: closing asserts a status the task never actually reached — and after #45 we know "closed"/"complete" is not even a status name on every list — while deleting destroys the record and breaks any link to it.
Implementation note worth a look: the SDK cannot express this.
clickup.TaskUpdateRequesthas noarchivedfield, soUpdateTaskcan never send it. The request is built directly against the SDK's exportedNewRequest/Do, which is the same path its own services use, rather than adding a second HTTP client.Verification
Round-tripped against a real workspace on a throwaway task:
archivedgoesfalse → true → false, and the task's URL and status are intact afterwards. The task was deleted after the test.Checklist
./scripts/ci.shpasses locally — excepterrcheck, which reports the same pre-existing findings onmain, none in files this PR touchescu docs markdown --dir docs/site/commands) and added to the mkdocs navReview fixes
internal/api/archive_test.gorunsSetTaskArchivedagainst anhttptest.Server. It checks the method (PUT), the path (/task/<id>), the body ({"archived":true}, andfalsefor--undo), that a 404 returns an error, and that the ID is path-escaped.internal/cmd/task_test.gochecks thattask archiveis registered and has a--undobool flag.task archivesetsSilenceUsage, so an API failure no longer prints the usage block. Errors are now wrapped asfailed to archive task: …(orunarchivewith--undo). The root command is unchanged.url.PathEscapewhen the request path is built.--undois registered under its own// Archive command flagscomment.The generated CLI docs only changed their timestamps, so they are not included.
🤖 Generated with Claude Code