egaki 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,77 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.6.0
6
+
7
+ 1. **xAI provider with Grok image and video generation** — generate images and videos using xAI's Aurora and Grok models. Two auth paths: direct API key via `XAI_API_KEY` or Grok Build OAuth browser flow:
8
+
9
+ ```bash
10
+ # Direct API key
11
+ egaki login --provider xai --key xai-xxx
12
+
13
+ # OAuth (opens browser)
14
+ egaki login --provider xai-oauth
15
+
16
+ # Generate images
17
+ egaki image "cyberpunk cityscape at dusk" -m xai/grok-2-image -o city.png
18
+
19
+ # Generate videos
20
+ egaki video "a cat playing piano" -m xai/grok-3-mini-video -o cat.mp4
21
+ ```
22
+
23
+ Auth priority: explicit `XAI_API_KEY` > xAI OAuth > stored xai key > egaki gateway.
24
+
25
+ 2. **New CLI flags for provider-specific options** — control quality, resolution, output format, and more per-provider:
26
+
27
+ ```bash
28
+ # Quality and resolution (xAI)
29
+ egaki image "portrait" -m xai/grok-2-image --quality high --resolution 2k
30
+
31
+ # Output format
32
+ egaki image "logo" -m xai/grok-2-image --output-format png
33
+
34
+ # Negative prompts (Fal models)
35
+ egaki image "landscape" -m fal/flux-pro/v1.1 --negative-prompt "blurry, low quality"
36
+
37
+ # Video modes (xAI): edit, extend, reference-to-video
38
+ egaki video "slow zoom out" -m xai/grok-3-mini-video --mode extend-video --input clip.mp4
39
+ egaki video "a person walking" -m xai/grok-3-mini-video --mode reference-to-video --reference-images ref1.png ref2.png
40
+ ```
41
+
42
+ Flag descriptions are auto-derived from the model catalog so `--help` shows valid values per provider.
43
+
44
+ 3. **Local file upload for video editing and reference images** — `--input` and `--reference-images` on the video command now accept local file paths. Files are uploaded to a temporary R2 bucket (auto-expires after 2 days) and the URL is passed to the provider:
45
+
46
+ ```bash
47
+ # Edit a local video file
48
+ egaki video "add lens flare" -m xai/grok-3-mini-video --mode edit-video --input local-clip.mp4
49
+
50
+ # Reference images from disk
51
+ egaki video "person walking in park" -m xai/grok-3-mini-video --mode reference-to-video --reference-images photo1.jpg photo2.jpg
52
+ ```
53
+
54
+ The `--video-url` flag was removed; `--input` now handles both local files and URLs depending on the mode.
55
+
56
+ 4. **Unified model catalog** — all image and video model definitions (provider, pricing, features, provider options) now live in a single `model-catalog.ts` file. Provider option schemas are sourced directly from `@ai-sdk/*` package types with URL comments pointing to upstream docs for easy verification.
57
+
58
+ 5. **Type-safe provider options** — provider option objects passed to the AI SDK now use `satisfies` with the actual SDK types, catching mismatches at compile time instead of runtime.
59
+
60
+ 6. **Fixed OAuth race condition** — the xAI OAuth callback server is now resilient to state mismatches from stale browser tabs or retried requests, preventing silent auth failures.
61
+
62
+ ## 0.5.0
63
+
64
+ 1. **Interactive model picker** — omitting `--model` now shows a select prompt with popular models instead of silently using a default:
65
+
66
+ ```bash
67
+ # Shows a model picker in the terminal
68
+ egaki image "a dreamy watercolor landscape" -o landscape.png
69
+
70
+ # Explicit model skips the picker
71
+ egaki image "a dreamy watercolor landscape" -m imagen-4.0-generate-001 -o landscape.png
72
+ ```
73
+
74
+ Works for both `egaki image` and `egaki video`. In non-interactive (piped/scripted) mode, the default model is used automatically so existing scripts are unaffected.
75
+
5
76
  ## 0.4.1
6
77
 
7
78
  1. **Added `gpt-image-2` model** — OpenAI's new flagship image generation model (released 2026-04-21) is now available in the model catalog:
package/README.md CHANGED
@@ -128,6 +128,109 @@ egaki video "looping rain animation" --stdout | ffmpeg -i pipe:0 -vf fps=12 rain
128
128
 
129
129
  ---
130
130
 
131
+ ### xAI Grok image generation
132
+
133
+ ```bash
134
+ # Basic text-to-image
135
+ egaki image "a fox wearing armor in a misty forest" -m grok-imagine-image -o fox.png
136
+
137
+ # High quality + 2K resolution
138
+ egaki image "product photo of a ceramic vase on linen" \
139
+ -m grok-imagine-image-pro \
140
+ --quality high \
141
+ --resolution 2k \
142
+ -o vase.png
143
+
144
+ # Edit an existing image
145
+ egaki image "add dramatic storm clouds to the sky" \
146
+ -m grok-imagine-image \
147
+ --input landscape.jpg \
148
+ -o landscape-storm.png
149
+
150
+ # Generate multiple variations
151
+ egaki image "abstract geometric pattern" -m grok-imagine-image -n 3 -o pattern.png
152
+ # writes pattern-0.png, pattern-1.png, pattern-2.png
153
+
154
+ # Control aspect ratio and output format
155
+ egaki image "vertical phone wallpaper, aurora borealis" \
156
+ -m grok-imagine-image \
157
+ --aspect-ratio 9:16 \
158
+ --output-format jpeg \
159
+ -o wallpaper.jpg
160
+ ```
161
+
162
+ ### xAI Grok video generation
163
+
164
+ ```bash
165
+ # Basic text-to-video
166
+ egaki video "a paper airplane gliding through clouds" \
167
+ -m grok-imagine-video \
168
+ --duration 5 \
169
+ -o airplane.mp4
170
+
171
+ # Text-to-video with resolution and aspect ratio
172
+ egaki video "cinematic drone shot over a city at sunset" \
173
+ -m grok-imagine-video \
174
+ --duration 8 \
175
+ --resolution 720p \
176
+ --aspect-ratio 16:9 \
177
+ -o city.mp4
178
+
179
+ # Image-to-video (animate a still image)
180
+ egaki video "slowly pan across the scene with gentle wind" \
181
+ -m grok-imagine-video \
182
+ --input photo.jpg \
183
+ --duration 5 \
184
+ -o animated.mp4
185
+
186
+ # Video editing (modify an existing video — pass the source via --input)
187
+ egaki video "make it look like a watercolor painting" \
188
+ -m grok-imagine-video \
189
+ --mode edit-video \
190
+ --input ./original.mp4 \
191
+ -o edited.mp4
192
+
193
+ # Video extension (continue from last frame)
194
+ egaki video "the camera keeps moving forward" \
195
+ -m grok-imagine-video \
196
+ --mode extend-video \
197
+ --input ./clip.mp4 \
198
+ -o extended.mp4
199
+
200
+ # Reference-to-video (R2V): generate a video guided by 1-7 reference images.
201
+ # The images act as style and content references (not as the first frame).
202
+ # Accepts local files or URLs; local files are uploaded automatically.
203
+ egaki video "the model walks down a white runway wearing the outfit from the reference" \
204
+ -m grok-imagine-video \
205
+ --mode reference-to-video \
206
+ --reference-images ./model-face.jpg \
207
+ --reference-images ./outfit.jpg \
208
+ --duration 8 \
209
+ -o runway.mp4
210
+
211
+ # Low-res draft for quick iteration
212
+ egaki video "test animation concept" \
213
+ -m grok-imagine-video \
214
+ --duration 3 \
215
+ --resolution 480p \
216
+ -o draft.mp4
217
+ ```
218
+
219
+ ### xAI Grok auth
220
+
221
+ ```bash
222
+ # Option 1: direct API key
223
+ egaki login --provider xai --key xai-...
224
+
225
+ # Option 2: Grok Build subscription (browser OAuth)
226
+ egaki login --provider xai-oauth
227
+
228
+ # Check auth status
229
+ egaki login --show
230
+ ```
231
+
232
+ ---
233
+
131
234
  ### Discover models and pricing
132
235
 
133
236
  ```bash
@@ -198,7 +301,7 @@ egaki image "mascot variations, flat vector look" \
198
301
  | `vertex/veo-3.1-generate-001` | Same as above, routed through Vertex AI | `egaki video "rainy Tokyo street" -m vertex/veo-3.1-generate-001 --duration 8 -o tokyo.mp4` |
199
302
  | `klingai/kling-v2.5-turbo-t2v` | Cheap, fast Kling text-to-video | `egaki video "a paper boat on a pond" -m klingai/kling-v2.5-turbo-t2v --duration 5 -o boat.mp4` |
200
303
  | `bytedance/seedance-v1.5-pro` | Bytedance, audio support, three resolutions | `egaki video "timelapse of clouds above mountains" -m bytedance/seedance-v1.5-pro -o clouds.mp4` |
201
- | `xai/grok-imagine-video` | xAI video generation, cheap for short clips | `egaki video "a dog catching a frisbee" -m xai/grok-imagine-video --duration 3 -o dog.mp4` |
304
+ | `grok-imagine-video` | xAI video with editing, extension, R2V | `egaki video "a dog catching a frisbee" -m grok-imagine-video --duration 5 -o dog.mp4` |
202
305
 
203
306
  ## Feature support by model family
204
307
 
@@ -207,12 +310,12 @@ egaki image "mascot variations, flat vector look" \
207
310
  - **OpenAI image models**: strong editing and inpainting; size controls are model-specific
208
311
  - **BFL image models (`flux-*`)**: Kontext/Pro variants via AI Gateway subscription
209
312
  - **Recraft models (`recraft-*`)**: v2/v3/v4 families available via AI Gateway subscription
210
- - **xAI image models (`grok-imagine-*`)**: Grok image generation via AI Gateway subscription
313
+ - **xAI image models (`grok-imagine-*`)**: `--quality`, `--resolution`, `--output-format`, `--input` for editing, `-n` for batches. Auth via API key or Grok Build OAuth
211
314
  - **Vertex models (`vertex/*`)**: same models as Google AI Studio, routed through Vertex AI / Google Cloud billing
212
315
  - **Google Veo video models**: up to 4K, audio optional, duration 4–8s
213
316
  - **Kling video models**: mode (std/pro), audio on v2.6+, image-to-video support
214
317
  - **Bytedance Seedance**: 480p–1080p, audio support on v1.5-pro
215
- - **xAI Grok video**: 480p–720p, short clips (1–15s)
318
+ - **xAI Grok video (`grok-imagine-video`)**: 480p–720p, 1–15s, i2v, video editing, video extension, R2V from reference images
216
319
 
217
320
  ## Subscription and usage
218
321
 
@@ -220,6 +323,7 @@ egaki supports **both** authentication modes:
220
323
 
221
324
  - **BYOK (bring your own keys):** add provider keys with `egaki login` per provider.
222
325
  - **ChatGPT auth:** log in with `egaki login --provider chatgpt` to use the ChatGPT/Codex backend for supported OpenAI image generation and editing flows.
326
+ - **xAI Grok Build auth:** log in with `egaki login --provider xai-oauth` to use your Grok Build subscription for xAI image and video generation.
223
327
  - **Egaki subscription:** use one `egaki_...` key to access all supported models without managing keys for each provider.
224
328
  - **Google vs Vertex:** bare model IDs (e.g. `imagen-4.0-generate-001`) use Google AI Studio. Prefix with `vertex/` (e.g. `vertex/imagen-4.0-generate-001`) to route through Vertex AI / Google Cloud billing.
225
329