sdks: add zip archive format option - #46
Closed
claude[bot] wants to merge 1 commit into
Closed
Conversation
Expose the new optional `format` field on the archive endpoint in the Go, TypeScript, and Python SDKs so callers can request a zip archive instead of gzipped tar. Omitting the option leaves the request body unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KGxkVXxgk1EtbomeV74QZe
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.
Requested via Slack thread
Before
repo.getArchiveStream()/repo.get_archive_stream()/repo.ArchiveStream()could only download a gzipped tar. A customer who wanted a zip had to unpack the tar and re-zip it themselves.After
All three SDKs take an optional archive format. Ask for
zipand the response streams a zip archive (Content-Type: application/zip, suggested filename<name>-<ref>.zip) instead of gzipped tar (Content-Type: application/gzip,<name>-<ref>.tar.gz).Leaving the option unset is unchanged: no
formatkey is sent at all, so existing callers produce byte-identical requests and keep gettingtar.gz.How
The archive endpoint gains an optional top-level
formatfield in its JSON body, accepting"tar.gz"(the default) or"zip". Each SDK exposes it in that package's idiom for enum-ish options:ArchiveFormatstring type withArchiveFormatTarGz/ArchiveFormatZipconstants, plumbed throughArchiveOptions.FormatintoarchiveRequestwithjson:"format,omitempty".ArchiveFormat = "tar.gz" | "zip"string-literal union,ArchiveOptions.format, serialized only when non-empty.ArchiveFormat = Literal["tar.gz", "zip"], keyword-onlyformatargument onget_archive_streamand theRepoprotocol.READMEs in all three packages show requesting a zip and note the resulting content type and filename.
skills/code-storage/SKILL.mdgets the same for the raw endpoint (formatin the body, plus the endpoint-table row).Tests in each package cover:
formatserializes into the request body when set, is absent when unset, and a zip response is handed back withContent-Type: application/zip.No version bump — releases are cut separately.
Depends on the server-side
formatsupport landing inpierredotco/monorepo; until then"zip"will be ignored or rejected by the API.Closes CSW-533.
Generated by Claude Code