Skip to content

sdks: add zip archive format option - #46

Closed
claude[bot] wants to merge 1 commit into
mainfrom
claude/archive-zip-format
Closed

sdks: add zip archive format option#46
claude[bot] wants to merge 1 commit into
mainfrom
claude/archive-zip-format

Conversation

@claude

@claude claude Bot commented Aug 10, 2026

Copy link
Copy Markdown

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 zip and 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).

// TypeScript
const resp = await repo.getArchiveStream({ ref: 'main', format: 'zip' });
# Python
resp = await repo.get_archive_stream(ref="main", format="zip")
// Go
resp, err := repo.ArchiveStream(ctx, storage.ArchiveOptions{Ref: "main", Format: storage.ArchiveFormatZip})

Leaving the option unset is unchanged: no format key is sent at all, so existing callers produce byte-identical requests and keep getting tar.gz.

How

The archive endpoint gains an optional top-level format field in its JSON body, accepting "tar.gz" (the default) or "zip". Each SDK exposes it in that package's idiom for enum-ish options:

  • GoArchiveFormat string type with ArchiveFormatTarGz / ArchiveFormatZip constants, plumbed through ArchiveOptions.Format into archiveRequest with json:"format,omitempty".
  • TypeScriptArchiveFormat = "tar.gz" | "zip" string-literal union, ArchiveOptions.format, serialized only when non-empty.
  • PythonArchiveFormat = Literal["tar.gz", "zip"], keyword-only format argument on get_archive_stream and the Repo protocol.

READMEs in all three packages show requesting a zip and note the resulting content type and filename. skills/code-storage/SKILL.md gets the same for the raw endpoint (format in the body, plus the endpoint-table row).

Tests in each package cover: format serializes into the request body when set, is absent when unset, and a zip response is handed back with Content-Type: application/zip.

No version bump — releases are cut separately.

Depends on the server-side format support landing in pierredotco/monorepo; until then "zip" will be ignored or rejected by the API.

Closes CSW-533.


Generated by Claude Code

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
@notion-workspace

Copy link
Copy Markdown

@unknwon unknwon closed this Aug 12, 2026
@unknwon
unknwon deleted the claude/archive-zip-format branch August 12, 2026 18:16
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