egaki 0.0.2 → 0.1.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,45 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.1.0
6
+
7
+ 1. **New `egaki video` command** — generate videos from text prompts using AI models
8
+ via `experimental_generateVideo`:
9
+
10
+ ```bash
11
+ egaki video "a paper boat drifting on a calm lake at sunrise" -o boat.mp4
12
+ egaki video "timelapse of a stormy sea" -m google/veo-3.1-generate-001 --duration 8 -o storm.mp4
13
+ ```
14
+
15
+ Supports all major AI Gateway video models: Google Veo 3.0/3.1, Kling v2.5/v2.6/v3.0,
16
+ Bytedance Seedance, Alibaba Wan, and xAI Grok video.
17
+
18
+ 2. **Image-to-video support** — animate a still image with models that support `i2v`:
19
+
20
+ ```bash
21
+ egaki video "slowly animate the clouds" --input photo.jpg -m klingai/kling-v2.6-i2v -o animated.mp4
22
+ ```
23
+
24
+ 3. **New video options** — `--duration`, `--resolution`, `--aspect-ratio`, `--fps`,
25
+ `--seed`, `--count`, `--input`, `--stdout`, `--json` for full control over generation.
26
+
27
+ 4. **`egaki models --type` filter** — filter model listing by modality:
28
+
29
+ ```bash
30
+ egaki models --type video
31
+ egaki models --type image
32
+ egaki models --type all # default
33
+ ```
34
+
35
+ Video models show duration range, capabilities (t2v, i2v, r2v), and resolution tiers.
36
+
37
+ 5. **Egaki subscription now covers video** — all gateway video models work with your
38
+ `egaki_...` key; usage is tracked per-second based on model tier and duration.
39
+
40
+ 6. **AI SDK dependencies pinned to exact versions** — `ai`, `@ai-sdk/google`,
41
+ `@ai-sdk/fal`, `@ai-sdk/openai`, `@ai-sdk/replicate` are now pinned so AI Gateway
42
+ protocol changes can't silently break the CLI.
43
+
5
44
  ## 0.0.2
6
45
 
7
46
  - Make subscribe messaging explicit about both auth modes.
package/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # egaki
2
2
 
3
- Generate AI images from the terminal with one command.
3
+ Generate AI images and videos from the terminal with one command.
4
4
 
5
5
  `egaki` is a TypeScript CLI built on the Vercel AI SDK and goke. It supports
6
- Google Imagen, Gemini image-capable models, and model discovery with pricing.
6
+ Google Imagen, Gemini image-capable models, video generation (Veo, Kling, Wan,
7
+ Bytedance Seedance, xAI Grok), and model discovery with pricing.
7
8
 
8
9
  ## Install
9
10
 
@@ -16,18 +17,19 @@ pnpm add -g egaki
16
17
  ```bash
17
18
  egaki login
18
19
  egaki image "a watercolor fox reading a map" -o fox.png
20
+ egaki video "a paper boat drifting on a calm lake at sunrise" -o boat.mp4
19
21
  ```
20
22
 
21
23
  ## CLI examples
22
24
 
23
- ### Generate from text
25
+ ### Generate an image from text
24
26
 
25
27
  ```bash
26
28
  egaki image "cinematic mountain village at sunrise" -o village.png
27
29
  egaki image "isometric floating city, detailed, soft colors" -m imagen-4.0-generate-001
28
30
  ```
29
31
 
30
- ### Edit with input image
32
+ ### Edit with an input image
31
33
 
32
34
  ```bash
33
35
  egaki image "add a red scarf and make it winter" --input portrait.jpg -o portrait-winter.png
@@ -53,21 +55,74 @@ egaki image "cyberpunk alley at night" --aspect-ratio 16:9
53
55
  egaki image "polaroid-style travel photo" --aspect-ratio 4:5
54
56
  ```
55
57
 
56
- ### Pipe output to other tools
58
+ ### Pipe image output to other tools
57
59
 
58
60
  ```bash
59
61
  egaki image "flat icon of a fox" --stdout | magick - -resize 512x512 fox-icon.png
60
62
  ```
61
63
 
64
+ ---
65
+
66
+ ### Generate a video from text
67
+
68
+ ```bash
69
+ egaki video "a paper boat drifting on a calm lake at sunrise" -o boat.mp4
70
+ egaki video "timelapse of a stormy sea, cinematic" -m google/veo-3.1-generate-001 --duration 8 -o storm.mp4
71
+ ```
72
+
73
+ ### Generate with a cheap model
74
+
75
+ ```bash
76
+ # Kling v2.5 Turbo — fast and inexpensive
77
+ egaki video "a cat walking on a rooftop at night" -m klingai/kling-v2.5-turbo-t2v --duration 5 -o cat.mp4
78
+ ```
79
+
80
+ ### Image-to-video
81
+
82
+ ```bash
83
+ # Animate a still image (model must support i2v)
84
+ egaki video "slowly animate the clouds" --input photo.jpg -m klingai/kling-v2.6-i2v -o animated.mp4
85
+ ```
86
+
87
+ ### Control resolution and aspect ratio
88
+
89
+ ```bash
90
+ egaki video "aerial drone shot over a city grid" \
91
+ -m google/veo-3.1-fast-generate-001 \
92
+ --aspect-ratio 16:9 \
93
+ --resolution 1080p \
94
+ --duration 6 \
95
+ -o city.mp4
96
+ ```
97
+
98
+ ### Generate multiple videos
99
+
100
+ ```bash
101
+ egaki video "waves crashing on cliffs at golden hour" -n 2 -o waves.mp4
102
+ # writes waves.mp4 and waves-1.mp4
103
+ ```
104
+
105
+ ### Pipe video output to other tools
106
+
107
+ ```bash
108
+ egaki video "looping rain animation" --stdout | ffmpeg -i pipe:0 -vf fps=12 rain.gif
109
+ ```
110
+
111
+ ---
112
+
62
113
  ### Discover models and pricing
63
114
 
64
115
  ```bash
65
116
  egaki models
117
+ egaki models --type video
118
+ egaki models --type image
66
119
  egaki models --provider google
67
120
  egaki models --json
68
121
  ```
69
122
 
70
- ### Advanced examples
123
+ ---
124
+
125
+ ### Advanced image examples
71
126
 
72
127
  ```bash
73
128
  # Deterministic result (models that support seed)
@@ -104,30 +159,42 @@ egaki image "mascot variations, flat vector look" \
104
159
  # writes mascot-0.png ... mascot-5.png
105
160
  ```
106
161
 
107
- ## Model input examples
162
+ ## Model quick reference
108
163
 
109
- Use `egaki models --json` to see the full list. These are practical examples of
110
- which flags pair well with common models:
164
+ ### Image models
111
165
 
112
166
  | Model ID | Best for | Example command |
113
167
  | --- | --- | --- |
114
168
  | `imagen-4.0-ultra-generate-001` | High-quality prompt-to-image with seed + ratio | `egaki image "luxury perfume ad on marble" -m imagen-4.0-ultra-generate-001 --aspect-ratio 3:4 --seed 7 -o perfume.png` |
115
169
  | `gemini-3.1-flash-image-preview` | Fast, cheap text+image edits with wide aspect-ratio support | `egaki image "turn into manga splash page" -m gemini-3.1-flash-image-preview --input portrait.jpg --aspect-ratio 4:1 -o manga-wide.png` |
116
170
  | `nano-banana-pro-preview` | Highest-fidelity Google text+image output | `egaki image "fashion editorial, dramatic rim light" -m nano-banana-pro-preview --input model.jpg --image-size 2K -o editorial.png` |
117
- | `gpt-image-1.5` | OpenAI image generation with strong editing/inpainting support | `egaki image "replace background with neon city" -m gpt-image-1.5 --input product.png --mask bg-mask.png -o product-neon.png` |
118
- | `black-forest-labs/flux-fill-pro` | Inpainting-focused Flux workflow on Replicate | `egaki image "restore damaged poster corners" -m black-forest-labs/flux-fill-pro --input poster.png --mask corners-mask.png -o restored.png` |
171
+ | `gpt-image-1.5` | OpenAI image generation with strong editing/inpainting | `egaki image "replace background with neon city" -m gpt-image-1.5 --input product.png --mask bg-mask.png -o product-neon.png` |
119
172
  | `fal-ai/flux/schnell` | Very fast low-cost ideation batches | `egaki image "logo sketch, geometric fox" -m fal-ai/flux/schnell -n 8 -o fox-logo.png` |
120
173
 
121
- ## Feature support by model family
174
+ ### Video models
175
+
176
+ | Model ID | Best for | Example command |
177
+ | --- | --- | --- |
178
+ | `google/veo-3.1-generate-001` | Highest quality video with audio, up to 4K | `egaki video "rainy Tokyo street at night" -m google/veo-3.1-generate-001 --duration 8 -o tokyo.mp4` |
179
+ | `google/veo-3.1-fast-generate-001` | Fast Veo with 720p–4K, good for iteration | `egaki video "abstract paint patterns" -m google/veo-3.1-fast-generate-001 --duration 5 -o paint.mp4` |
180
+ | `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` |
181
+ | `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` |
182
+ | `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` |
122
183
 
123
- Quick rule of thumb for flags:
184
+ ## Feature support by model family
124
185
 
125
186
  - **Google Imagen (`imagen-*`)**: supports `--seed`, `--aspect-ratio`, `--input`, `--mask`, `-n`
126
187
  - **Google Gemini image models**: supports `--input`, `--aspect-ratio`, `--image-size`; usually no `--seed`
127
188
  - **OpenAI image models**: strong editing and inpainting; size controls are model-specific
128
- - **Flux/Fal/Replicate models**: broad aspect-ratio + seed support; editing/inpainting depends on exact model
189
+ - **BFL image models (`flux-*`)**: Kontext/Pro variants via AI Gateway subscription
190
+ - **Recraft models (`recraft-*`)**: v2/v3/v4 families available via AI Gateway subscription
191
+ - **xAI image models (`grok-imagine-*`)**: Grok image generation via AI Gateway subscription
192
+ - **Google Veo video models**: up to 4K, audio optional, duration 4–8s
193
+ - **Kling video models**: mode (std/pro), audio on v2.6+, image-to-video support
194
+ - **Bytedance Seedance**: 480p–1080p, audio support on v1.5-pro
195
+ - **xAI Grok video**: 480p–720p, short clips (1–15s)
129
196
 
130
- ### Subscription and usage
197
+ ## Subscription and usage
131
198
 
132
199
  egaki supports **both** authentication modes:
133
200
 
@@ -138,6 +205,9 @@ egaki supports **both** authentication modes:
138
205
  # Subscribe and get a checkout URL
139
206
  egaki subscribe --email user@example.com --plan pro
140
207
 
208
+ # Subscribe without email prefill
209
+ egaki subscribe --plan pro
210
+
141
211
  # Save your Egaki key after checkout
142
212
  egaki login --provider egaki --key egaki_...
143
213
 
@@ -154,12 +224,15 @@ egaki unsubscribe
154
224
  ```bash
155
225
  egaki --help
156
226
  egaki image --help
227
+ egaki video --help
228
+ egaki models --help
157
229
  ```
158
230
 
159
231
  ## Auth and billing
160
232
 
161
233
  - `egaki login` stores provider keys in `~/.config/egaki/credentials.json`.
162
234
  - `egaki subscribe`, `egaki usage`, and `egaki unsubscribe` manage Egaki plans.
235
+ - Video costs are tracked per-second based on model, resolution, and duration.
163
236
 
164
237
  ## License
165
238
 
@@ -0,0 +1,15 @@
1
+ export type AntigravityAuth = {
2
+ email?: string;
3
+ refresh: string;
4
+ access: string;
5
+ expires: number;
6
+ projectId?: string;
7
+ };
8
+ export declare function refreshAntigravityToken(auth: AntigravityAuth): Promise<AntigravityAuth | Error>;
9
+ export declare function getValidAntigravityAccessToken(auth: AntigravityAuth, onRefresh?: (updated: AntigravityAuth) => void): Promise<{
10
+ accessToken: string;
11
+ projectId: string;
12
+ } | Error>;
13
+ export declare function antigravityOAuthLogin(): Promise<AntigravityAuth>;
14
+ export declare function antigravityOAuthFromCallbackUrl(callbackUrl: string): Promise<AntigravityAuth>;
15
+ //# sourceMappingURL=antigravity-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"antigravity-auth.d.ts","sourceRoot":"","sources":["../src/antigravity-auth.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAqUD,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,KAAK,CAAC,CAuCrG;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,eAAe,EACrB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,GAC7C,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,CAoD7D;AAsKD,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,eAAe,CAAC,CAsCtE;AAED,wBAAsB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAiBnG"}