feat(cli): image generation + catalog refresh (v0.2.0)#1
Merged
Conversation
Add `qsp image "PROMPT"` — text-to-image via /v1/images/generations, saves to disk (b64 or URL), default model flux.2-pro. `-n` loops client-side since the endpoint only accepts n=1; `-o` honours the user's filename and warns when the returned format differs. Refresh `qsp models`: split chat vs image-generation tables (image models bill per image, not per token; the live /models endpoint doesn't expose per-image price, so it's carried in the CLI). Update the hardcoded pre-signin fallback to the current lineup + prices (verified 2026-05-26). Default chat model deepseek-v3 -> deepseek-v4-flash. Update pyproject description/keywords + README for image gen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What
Bring
qspcurrent with the platform: add image generation and refresh the model catalog. Last release (v0.1.2) predates the catalog expansion, FLUX image launch, etc.New:
qsp image "PROMPT"Text-to-image via
/v1/images/generations, saves to disk. Default modelflux.2-pro.-o FILE(defaultqsp-image-<ts>.<ext>),--size,-n N,--json.-n Nloops client-side (the endpoint accepts onlyn=1); each is a separate request/charge, written the moment its request succeeds so a later failure never discards already-paid images.--jsonstreams each response (one object forn=1, JSONL forn>1).Refreshed
qsp models/modelsendpoint doesn't expose per-image price, so it's carried in the CLI)._is_image_modelis a strict allowlist so token-pricedgemini-*-imagecorrectly stays in the chat table.Other
deepseek-v3→deepseek-v4-flash(cheaper, faster, 1M context).QSP_IMAGE_MODELenv added.pyprojectdescription/keywords + README updated for image gen.run()gained ajson.JSONDecodeErrorhandler (CLI-wide).Verification
End-to-end against the live public API (
flux.1-schnell): single + named output,-nindexing,--json(single object & JSONL), extension-override warning, bad-output-dir clean failure, both model tables. Reviewed to P1=P2=0 (5 codex rounds; money-adjacent path).🤖 Generated with Claude Code