feat(get): retrieve/download an image (optionally transformed)#2
Merged
Conversation
… transformed) The CLI could upload/list/delete but had no way to RETRIEVE an image's bytes. Adds `pixelvault get <id>`: - prints the CDN URL to stdout (agent-friendly, mirrors `list`) - `--json` → full metadata - `-o/--output <file>` → download the image to disk - `-t/--transform "<params>"` → apply transform params (resize/format/ segment/effects/tile) to the URL or downloaded variant, e.g. `get img_x -o cut.png -t "segment=foreground"` Output contract preserved: URL to stdout, human messages to stderr. `applyTransform` tolerates a leading ?/&. Tests: applyTransform + metadata fetch (16 total). README + command table updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Council (Claude + Codex) findings fixed: - applyTransform now trims + reserializes params via URLSearchParams, so reserved chars in values are percent-encoded — `-t "background=#ffaa00"` previously sent `background=` (the `#` was parsed as a URL fragment). Also fixes whitespace-only `-t " "`. - encodeURIComponent(args.id) — a raw id like `../whoami` no longer manipulates the request path. - --json is now honored in download mode (was silently overridden by -o) — emits metadata + transformed_url + output. - Refuse to write a 0-byte download; wrap writeFileSync failures in CliError (friendly message instead of a raw fs error). - Docs: standardize the tile example on img_logo.png; note that -t encodes for you. +2 tests (hex encoding, folder-tile encoding); 18 total. typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
Review Council ReportReviewers: Claude + Codex (Gemini skipped: Findings fixed
Verified, not changedClaude flagged the skill's What both praisedCorrect stdout/stderr contract; raw +2 tests (18 total), typecheck clean. No direct injection/SSRF (CDN host is server-controlled). 🤖 Review Council (Claude · Codex) |
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.
The CLI could
upload/list/deletebut had no way to retrieve an image's bytes. Adds agetcommand.pixelvault get <id>list)--json→ full metadata-o/--output <file>→ download the image to disk-t/--transform "<params>"→ apply transform params to the URL / downloaded variantTies the new transform capabilities into the CLI: download a thumbnail, cut-out, or watermarked variant in one call.
Notes
applyTransformtolerates a leading?/&; unit-tested (+ metadata fetch). 16 tests pass; typecheck clean; build ok;get --helpverified.npm publishis needed to ship this to thepixelvault-clipackage (release decision).🤖 Generated with Claude Code