Skip to content

feat: pixelvault generate (AI image generation) + credits in usage — 0.10.0 - #23

Merged
facundofarias merged 1 commit into
mainfrom
feat/generate
Oct 30, 2026
Merged

facundofarias merged 1 commit into
mainfrom
feat/generate

Conversation

@facundofarias

Copy link
Copy Markdown
Member

Summary

Adds pixelvault generate <prompt> (API: POST /v1/images/generate, live since 2026-10-30) and shows generation credits in usage. Release 0.10.0.

  • stdout is just the hosted URL (--json full response, --optimized the WebP/AVIF URL); the credits used/left go to stderr, so scripts and agents capture the URL cleanly (same contract as upload).
  • Flags: --model/-m, --folder, --private (+ --expires for the signed link; fails closed if the server doesn't confirm private), --delete-after (auto-delete the image). Unquoted multi-word prompts work.
  • Durations are validated before the request, so a bad value never spends a credit. parseExpires now takes the flag name so --delete-after errors name the right flag.
  • No retries on this path (plain fetch), so a lost response can't spend credits twice.
  • pixelvault usage prints AI images: N credits used / limit / remaining when the API reports it.

Verification

typecheck, 92 tests (13 new for generate, 2 for usage), build. Exercised the built binary against production: a free-plan premium-model request exits 1 with the API message; a real generation exited 0 with only the URL on stdout, the credit line on stderr, the CDN serving the image (HTTP 200 image/jpeg), and usage showing the credits. The test image was deleted afterwards.

Release

Tag-triggered (v0.10.0 -> npm publish --provenance). Not tagged yet; the skill doc will reference this command, so it ships after the publish.

🤖 Generated with Claude Code

https://claude.ai/code/session_019sMZVurbKqZ6zsbUYCsLJn

….10.0

- `pixelvault generate <prompt>` -> POST /v1/images/generate. stdout is just the
  hosted URL (or --json for the full response, --optimized for the WebP/AVIF
  URL); the credits used/left go to stderr so scripts and agents can capture the
  URL cleanly. Flags: --model/-m, --folder, --private (+ --expires for the signed
  link, fails closed if the server doesn't confirm private), --delete-after
  (auto-delete the image). Unquoted multi-word prompts work.
- Durations are validated before the request, so a bad value never spends a credit.
- `pixelvault usage` shows AI generation credits when the API reports them.
- parseExpires takes the flag name so --delete-after errors name the right flag.
- Version 0.10.0, README.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019sMZVurbKqZ6zsbUYCsLJn
@facundofarias
facundofarias merged commit 9d5bd88 into main Oct 30, 2026
2 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