egaki 0.0.1 → 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 +54 -0
- package/README.md +239 -0
- package/dist/antigravity-auth.d.ts +15 -0
- package/dist/antigravity-auth.d.ts.map +1 -0
- package/dist/antigravity-auth.js +544 -0
- package/dist/antigravity-image.d.ts +11 -0
- package/dist/antigravity-image.d.ts.map +1 -0
- package/dist/antigravity-image.js +285 -0
- package/dist/chatgpt-auth.js +294 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +666 -0
- package/dist/credentials.d.ts +18 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +107 -0
- package/dist/gateway-model-candidates.generated.d.ts +11 -0
- package/dist/gateway-model-candidates.generated.d.ts.map +1 -0
- package/dist/gateway-model-candidates.generated.js +64 -0
- package/dist/login.d.ts +9 -0
- package/dist/login.d.ts.map +1 -0
- package/dist/login.js +112 -0
- package/dist/model-catalog.d.ts +42 -0
- package/dist/model-catalog.d.ts.map +1 -0
- package/dist/model-catalog.js +898 -0
- package/dist/models.d.ts +15 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +196 -0
- package/dist/open-browser.d.ts +2 -0
- package/dist/open-browser.d.ts.map +1 -0
- package/dist/open-browser.js +37 -0
- package/dist/subscription.d.ts +5 -0
- package/dist/subscription.d.ts.map +1 -0
- package/dist/subscription.js +216 -0
- package/dist/video-model-catalog.d.ts +52 -0
- package/dist/video-model-catalog.d.ts.map +1 -0
- package/dist/video-model-catalog.js +245 -0
- package/package.json +68 -5
- package/src/cli.ts +998 -0
- package/src/credentials.ts +126 -0
- package/src/login.ts +163 -0
- package/src/model-catalog.ts +968 -0
- package/src/models.ts +258 -0
- package/src/open-browser.ts +48 -0
- package/src/subscription.ts +298 -0
- package/src/video-model-catalog.ts +302 -0
- package/index.js +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
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
|
+
|
|
44
|
+
## 0.0.2
|
|
45
|
+
|
|
46
|
+
- Make subscribe messaging explicit about both auth modes.
|
|
47
|
+
- Clarify BYOK provider keys vs single Egaki subscription key in CLI + docs.
|
|
48
|
+
- Expand README with advanced usage and model-specific command examples.
|
|
49
|
+
|
|
50
|
+
## 0.0.1
|
|
51
|
+
|
|
52
|
+
- Initial public release of the `egaki` CLI.
|
|
53
|
+
- Image generation command with model selection and file/stdout output.
|
|
54
|
+
- Login, subscription, unsubscribe, usage, and models commands.
|
package/README.md
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# egaki
|
|
2
|
+
|
|
3
|
+
Generate AI images and videos from the terminal with one command.
|
|
4
|
+
|
|
5
|
+
`egaki` is a TypeScript CLI built on the Vercel AI SDK and goke. It supports
|
|
6
|
+
Google Imagen, Gemini image-capable models, video generation (Veo, Kling, Wan,
|
|
7
|
+
Bytedance Seedance, xAI Grok), and model discovery with pricing.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add -g egaki
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
egaki login
|
|
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
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## CLI examples
|
|
24
|
+
|
|
25
|
+
### Generate an image from text
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
egaki image "cinematic mountain village at sunrise" -o village.png
|
|
29
|
+
egaki image "isometric floating city, detailed, soft colors" -m imagen-4.0-generate-001
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Edit with an input image
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
egaki image "add a red scarf and make it winter" --input portrait.jpg -o portrait-winter.png
|
|
36
|
+
egaki image "turn this into a manga panel" --input https://example.com/photo.jpg -o manga.png
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Inpainting with a mask
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
egaki image "replace the sky with dramatic storm clouds" --input landscape.png --mask mask.png -o storm.png
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Generate multiple images
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
egaki image "minimal logo concepts for a cat cafe" -n 4 -o logo.png
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Control composition
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
egaki image "cyberpunk alley at night" --aspect-ratio 16:9
|
|
55
|
+
egaki image "polaroid-style travel photo" --aspect-ratio 4:5
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Pipe image output to other tools
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
egaki image "flat icon of a fox" --stdout | magick - -resize 512x512 fox-icon.png
|
|
62
|
+
```
|
|
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
|
+
|
|
113
|
+
### Discover models and pricing
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
egaki models
|
|
117
|
+
egaki models --type video
|
|
118
|
+
egaki models --type image
|
|
119
|
+
egaki models --provider google
|
|
120
|
+
egaki models --json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Advanced image examples
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Deterministic result (models that support seed)
|
|
129
|
+
egaki image "studio product shot of a ceramic mug" \
|
|
130
|
+
-m imagen-4.0-generate-001 \
|
|
131
|
+
--seed 42 \
|
|
132
|
+
-o mug-seed-42.png
|
|
133
|
+
|
|
134
|
+
# High quality Gemini image generation with 4K output
|
|
135
|
+
egaki image "architectural concept art, brutalist library interior" \
|
|
136
|
+
-m gemini-2.5-flash-image \
|
|
137
|
+
--image-size 4K \
|
|
138
|
+
--aspect-ratio 16:9 \
|
|
139
|
+
-o library-4k.png
|
|
140
|
+
|
|
141
|
+
# Multi-reference edit (pass --input multiple times)
|
|
142
|
+
egaki image "blend style from first image and color palette from second" \
|
|
143
|
+
--input style-reference.jpg \
|
|
144
|
+
--input palette-reference.jpg \
|
|
145
|
+
-m nano-banana-pro-preview \
|
|
146
|
+
-o hybrid-style.png
|
|
147
|
+
|
|
148
|
+
# JSON mode for automation/pipelines
|
|
149
|
+
egaki image "futuristic sneaker concept" \
|
|
150
|
+
-m gpt-image-1.5 \
|
|
151
|
+
--json \
|
|
152
|
+
-o sneaker.png
|
|
153
|
+
|
|
154
|
+
# Batch generation with indexed output names
|
|
155
|
+
egaki image "mascot variations, flat vector look" \
|
|
156
|
+
-m gpt-image-1-mini \
|
|
157
|
+
-n 6 \
|
|
158
|
+
-o mascot.png
|
|
159
|
+
# writes mascot-0.png ... mascot-5.png
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Model quick reference
|
|
163
|
+
|
|
164
|
+
### Image models
|
|
165
|
+
|
|
166
|
+
| Model ID | Best for | Example command |
|
|
167
|
+
| --- | --- | --- |
|
|
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` |
|
|
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` |
|
|
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` |
|
|
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` |
|
|
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` |
|
|
173
|
+
|
|
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` |
|
|
183
|
+
|
|
184
|
+
## Feature support by model family
|
|
185
|
+
|
|
186
|
+
- **Google Imagen (`imagen-*`)**: supports `--seed`, `--aspect-ratio`, `--input`, `--mask`, `-n`
|
|
187
|
+
- **Google Gemini image models**: supports `--input`, `--aspect-ratio`, `--image-size`; usually no `--seed`
|
|
188
|
+
- **OpenAI image models**: strong editing and inpainting; size controls are model-specific
|
|
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)
|
|
196
|
+
|
|
197
|
+
## Subscription and usage
|
|
198
|
+
|
|
199
|
+
egaki supports **both** authentication modes:
|
|
200
|
+
|
|
201
|
+
- **BYOK (bring your own keys):** add provider keys with `egaki login` per provider.
|
|
202
|
+
- **Egaki subscription:** use one `egaki_...` key to access all supported models without managing keys for each provider.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Subscribe and get a checkout URL
|
|
206
|
+
egaki subscribe --email user@example.com --plan pro
|
|
207
|
+
|
|
208
|
+
# Subscribe without email prefill
|
|
209
|
+
egaki subscribe --plan pro
|
|
210
|
+
|
|
211
|
+
# Save your Egaki key after checkout
|
|
212
|
+
egaki login --provider egaki --key egaki_...
|
|
213
|
+
|
|
214
|
+
# BYOK example (direct provider key)
|
|
215
|
+
egaki login --provider google --key AIza...
|
|
216
|
+
|
|
217
|
+
# Check subscription usage / cancel
|
|
218
|
+
egaki usage
|
|
219
|
+
egaki unsubscribe
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Help
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
egaki --help
|
|
226
|
+
egaki image --help
|
|
227
|
+
egaki video --help
|
|
228
|
+
egaki models --help
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Auth and billing
|
|
232
|
+
|
|
233
|
+
- `egaki login` stores provider keys in `~/.config/egaki/credentials.json`.
|
|
234
|
+
- `egaki subscribe`, `egaki usage`, and `egaki unsubscribe` manage Egaki plans.
|
|
235
|
+
- Video costs are tracked per-second based on model, resolution, and duration.
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT
|
|
@@ -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"}
|