kie-cli
v0.1.0
Published
CLI for Kie.AI - Generate images and videos with multiple AI models
Readme
kie-cli
CLI for Kie.AI - Generate images and videos with multiple AI models.
Supported Models
| Provider | Type | Models | | ----------------- | ----- | --------------------------------------------------- | | Kling | Video | 3.0 (text/image-to-video, multi-shot, 3-15s, sound) | | Veo 3 | Video | veo3 (quality), veo3_fast | | MidJourney | Image | v7, v6.1, v6, v5.2, niji-6, niji-7 | | Nano Banana 2 | Image | nano-banana-2 (up to 4K, Google Search grounding) |
Installation
npm install -g kie-cliSetup
# Set your API key (interactive, masked input)
kie auth
# Verify current key
kie auth --showThe key is stored in ~/.config/kie/config.json. The KIE_API_KEY environment variable can also be used and takes priority over the stored key.
Quick Start
# Generate a video (default: Kling 3.0, 9:16, 10s, std mode)
kie gen "a cat playing piano"
# Generate and wait for result
kie gen "a sunset over the ocean" --wait
# Generate with Veo 3
kie gen "a cinematic drone shot" --provider veo3
# Generate an image with MidJourney
kie gen "a watercolor cat" --provider midjourney
# MidJourney with style controls
kie gen "cyberpunk city" --provider midjourney --stylization 500 --weirdness 100
# Generate an image with Nano Banana
kie gen "a landscape photo" --provider nano-banana
# Image-to-video
kie gen "animate this scene" --image https://example.com/photo.jpg
# Check task status
kie status abc123
# Check credits
kie creditsCommands
kie gen <prompt>
Generate an image or video.
| Flag | Description | Default |
| -------------------- | -------------------------------------------- | ------------- |
| -p, --provider | kling, veo3, midjourney, nano-banana | kling |
| -m, --model | Model ID (see Model Reference below) | auto |
| -a, --aspect-ratio | Aspect ratio | 9:16 |
| -d, --duration | Video duration in seconds (kling) | 10 |
| -i, --image | Input image URL (image-to-video/img2img) | - |
| --sound | Enable sound (kling 3.0) | on |
| --mode | Quality: std, pro (kling 3.0) | std |
| --negative-prompt | Negative prompt (kling) | - |
| --cfg-scale | CFG scale 0-1 (kling) | 0.5 |
| --tail-image | End frame image URL (kling) | - |
| --seed | Random seed (veo3) | - |
| --stylization | Stylization 0-1000 (midjourney) | - |
| --weirdness | Weirdness 0-3000 (midjourney) | - |
| --variety | Variety 0-100 (midjourney) | - |
| --speed | Speed: relaxed, fast, turbo (midjourney) | fast |
| --version | MJ version: 7, 6.1, 6, 5.2, niji-6, niji-7 | 7 |
| --resolution | 1K, 2K, 4K (nano-banana) | 1K |
| --format | jpg, png (nano-banana) | jpg |
| --google-search | Google search grounding (nano-banana) | off |
| -o, --output | Download directory | ~/Downloads |
| --callback | Webhook callback URL | - |
| -w, --wait | Poll until generation completes | off |
kie auth
Set your API key interactively (masked input). Use --show to view current key status. Stored in ~/.config/kie/config.json.
kie status <taskId>
Check generation status. Provider is auto-detected from the task ID format.
kie credits
Display remaining API credits.
kie extend <taskId> <prompt>
Extend a Veo 3 video with additional content.
| Flag | Description | Default |
| ------------- | ------------------- | ------- |
| -m, --model | fast, quality | fast |
| --seed | Random seed | - |
| --callback | Webhook URL | - |
| -w, --wait | Poll until complete | off |
kie upscale <taskId>
Upscale a Veo 3 video to higher resolution.
| Flag | Description | Default |
| --------------- | ------------------------ | ------- |
| -q, --quality | 1080p, 4k | 1080p |
| --index | Video index | 0 |
| --callback | Webhook URL (4K only) | - |
| -w, --wait | Poll until complete (4K) | off |
Model Reference
Kling
| Model ID | Type |
| ----------------- | ---------------------------------------- |
| kling-3.0/video | Text/Image-to-video (latest, multi-shot) |
Veo 3
| Model ID | Description |
| ----------- | ------------------------- |
| veo3_fast | Fast generation (default) |
| veo3 | Higher quality |
MidJourney
| Version | Description |
| -------- | -------------------- |
| 7 | Latest (default) |
| 6.1 | Previous stable |
| 6 | V6 |
| 5.2 | V5.2 |
| niji-6 | Anime style (Niji 6) |
| niji-7 | Anime style (Niji 7) |
Nano Banana 2
| Model ID | Description |
| --------------- | ---------------- |
| nano-banana-2 | Image generation |
Defaults
| Setting | Default |
| ------------ | -------------------------------------------------- |
| Provider | kling |
| Aspect Ratio | 9:16 (video providers), 16:9 (image providers) |
| Duration | 10 seconds (kling) |
| Mode | std (kling) |
| MJ Speed | fast |
| MJ Version | 7 |
Development
# Install dependencies
npm install
# Run in dev mode
npm run dev -- gen "test prompt"
# Build
npm run build
# Link globally
npm linkLicense
MIT
