
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
wavespeed-cli
Advanced tools
A powerful command-line interface for Wavespeed AI's image generation and editing APIs. Generate stunning images from text prompts, edit existing images, and create consistent image sequences—all from your terminal.
Get up and running in under 2 minutes:
# Install Bun (if not already installed)
curl -fsSL https://bun.sh/install | bash
# Clone and build
git clone https://github.com/aditzel/wavespeed-cli.git
cd wavespeed-cli
bun install && bun run build && bun link
# Set your API key
export WAVESPEED_API_KEY="your_api_key_here"
# Generate your first image
wavespeed generate --prompt "a photorealistic cat sitting on a windowsill"
| Feature | Description |
|---|---|
| Text-to-Image Generation | Create images from text prompts using state-of-the-art AI models |
| Image Editing | Modify existing images with natural language prompts |
| Sequential Generation | Generate consistent image sequences for animations or storyboards |
| Sequential Editing | Edit multiple images while maintaining visual consistency |
Before installing wavespeed-cli, ensure you have:
brew install oven-sh/bun/buncurl -fsSL https://bun.sh/install | bash# Clone the repository
git clone https://github.com/aditzel/wavespeed-cli.git
cd wavespeed-cli
# Install dependencies
bun install
# Build the CLI
bun run build
# Link the CLI globally (makes the 'wavespeed' command available)
bun link
The CLI requires a Wavespeed API key. Set it as an environment variable:
Bash/Zsh:
export WAVESPEED_API_KEY="your_api_key_here"
# Add to ~/.bashrc or ~/.zshrc for persistence
Fish:
set -Ux WAVESPEED_API_KEY "your_api_key_here"
By default, the CLI uses the built-in Wavespeed Seedream V4 configuration with WAVESPEED_API_KEY from your environment. No config file is required for basic usage.
If no config file is present, all commands:
https://api.wavespeed.aiWAVESPEED_API_KEYTo use multiple models/providers or override defaults, create a config file. On each run, the CLI looks for the first existing file (no merging):
Project-level (current directory):
.wavespeedrc.wavespeedrc.json.wavespeedrc.yaml.wavespeedrc.ymlwavespeed.config.jsonwavespeed.config.yamlwavespeed.config.ymlIf none found, fall back to home directory:
$HOME/.wavespeedrc$HOME/.wavespeedrc.json$HOME/.wavespeedrc.yaml$HOME/.wavespeedrc.ymlThe first match wins. Supported formats:
.wavespeedrc without extension: tries JSON, then YAML.Minimal JSON example:
{
"models": {
"seedream-v4": {
"provider": "wavespeed",
"apiBaseUrl": "https://api.wavespeed.ai",
"apiKeyEnv": "WAVESPEED_API_KEY",
"modelName": "bytedance/seedream-v4"
},
"my-alt-model": {
"provider": "openai-compatible",
"apiBaseUrl": "https://api.my-gateway.example",
"apiKeyEnv": "MY_GATEWAY_API_KEY",
"modelName": "bytedance/seedream-v4"
}
},
"defaults": {
"globalModel": "seedream-v4",
"commands": {
"generate": "seedream-v4",
"edit": "seedream-v4",
"generate-sequential": "seedream-v4",
"edit-sequential": "seedream-v4"
}
}
}
Key points:
models:
--model <id>.provider: "wavespeed" | "openai" | "openai-compatible" | "custom".apiBaseUrl:
wavespeed (defaults to https://api.wavespeed.ai).wavespeed providers.apiKeyEnv:
WAVESPEED_API_KEY for wavespeed if omitted.modelName:
"bytedance/seedream-v4")./edit or /sequential from this value."google/nano-banana-2/text-to-image", pass it directly with --model instead of storing it as an ergonomic cross-command alias.type, requestDefaults:
defaults:
globalModel:
commands:
generate, edit, generate-sequential, edit-sequential.Unknown fields are ignored by the loader to remain forward-compatible.
In the config, any string exactly matching one of:
${ENV:NAME}${NAME}is resolved as:
process.env.NAME if defined.Example:
{
"models": {
"gateway": {
"provider": "openai-compatible",
"apiBaseUrl": "${GATEWAY_BASE_URL}",
"apiKeyEnv": "GATEWAY_API_KEY"
}
}
}
If GATEWAY_BASE_URL or GATEWAY_API_KEY are missing at runtime when this model is selected, the CLI exits with a configuration/secret error as described below.
wavespeed generate --prompt "a photorealistic cat sitting on a windowsill"
# Specify custom size
wavespeed generate --prompt "mountain landscape" --size 1024*1024
# Custom output directory
wavespeed generate --prompt "sunset over ocean" --output-dir ./my-images/
# Request base64 output (auto-decoded and saved)
wavespeed generate --prompt "abstract art" --base64
wavespeed edit \
--prompt "make it cyberpunk style" \
--images "https://example.com/image1.jpg,https://example.com/image2.jpg"
# With custom size and output directory
wavespeed edit \
--prompt "add autumn colors" \
--images "https://example.com/photo.jpg" \
--size 2048*2048 \
--output-dir ./edited/
Generate a sequence of images with consistency:
wavespeed generate-sequential \
--prompt "spaceship launch sequence in 3 frames" \
--max-images 3
# Larger images
wavespeed generate-sequential \
--prompt "sunrise timelapse" \
--max-images 5 \
--size 3072*2048
Edit images while maintaining visual consistency:
wavespeed edit-sequential \
--prompt "comic strip style transformation" \
--images "https://example.com/base.jpg" \
--max-images 4
# Without reference images
wavespeed edit-sequential \
--prompt "character turnaround sheet" \
--max-images 8
-p, --prompt <text>: Text prompt (required)-s, --size <WIDTHxHEIGHT>: Image dimensions (default: 2048*2048)
* or x as separator-o, --output-dir <dir>: Directory to save images (default: ./output/)--base64: Request base64-encoded images (auto-decoded and saved as PNG)For edit commands:
-i, --images <urls>: Comma-separated image URLs (max 10)For sequential commands:
-m, --max-images <number>: Number of images to generate (1-15, default: 1){taskId}_1.png, {taskId}_2.png, etc../output/, configurable with --output-dir.Model selection for each command follows:
--model <id>:
modelsseedream-v4google/nano-banana-2/text-to-imagedefaults.commands[commandName] if present.defaults.globalModel if present.WAVESPEED_API_KEY.WAVESPEED_API_KEY is missing here: exit code 2.This behavior is implemented centrally and used by all commands.
Examples:
# Use default / configured resolution
wavespeed generate --prompt "A cat in space"
# Use a specific configured model for one run
wavespeed generate --model my-alt-model --prompt "A dragon in neon lights"
# Use a raw Wavespeed API model id directly
wavespeed generate --model google/nano-banana-2/text-to-image --prompt "A dragon in neon lights"
# Global model override via config only
wavespeed edit --prompt "style it" --images "https://example.com/img.png"
The CLI provides global flags:
wavespeed --list-models
wavespeed --list-models-json
Behavior:
Text output example:
Config source: /path/to/.wavespeedrc.json
seedream-v4 * [cmd=generate,edit] provider=wavespeed baseUrl=https://api.wavespeed.ai modelName=bytedance/seedream-v4 keyEnv=WAVESPEED_API_KEY
my-alt-model [cmd=generate] provider=openai-compatible baseUrl=https://api.my-gateway.example modelName=bytedance/seedream-v4 keyEnv=MY_GATEWAY_API_KEY
* marks the global default model.[cmd=...] lists commands for which this model is the default.JSON output example:
wavespeed --list-models-json
{
"source": "/path/to/.wavespeedrc.json",
"models": [
{
"id": "seedream-v4",
"provider": "wavespeed",
"apiBaseUrl": "https://api.wavespeed.ai",
"modelName": "bytedance/seedream-v4",
"apiKeyEnv": "WAVESPEED_API_KEY",
"isDefaultGlobal": true,
"defaultForCommands": ["generate", "edit"]
}
]
}
If no config file is present:
The CLI validates inputs and configuration and returns:
0: Success1: Command usage/validation/runtime/API error (e.g., invalid args, task failure)2: Missing required secrets (e.g., required API key env var not set for selected model)3: Configuration/model errors:
defaults or --modelapiBaseUrl/apiKeyEnv for chosen modelTypical messages include guidance such as:
# Run in development mode with hot reload
bun run dev
# Build for production
bun run build
# Lint the code
bun run lint
# Format the code
bun run format
# Run all tests
bun test
# Run tests in watch mode
bun test:watch
# Run tests with coverage
bun test:coverage
Test coverage includes:
"WAVESPEED_API_KEY is not set"
# Verify your API key is set
echo $WAVESPEED_API_KEY
# Set it if missing
export WAVESPEED_API_KEY="your_api_key_here"
"Command not found: wavespeed"
# Rebuild and relink the CLI
bun run build && bun link
# Or run directly with Bun
bun run src/index.ts generate --prompt "test"
"Unknown model 'X'"
wavespeed --list-models"Invalid size format"
WIDTHxHEIGHT or WIDTH*HEIGHTNetwork/API errors
For detailed API specifications, see:
From the API documentation:
max_imagesContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
CLI for Wavespeed AI Bytedance Seedream V4 API
We found that wavespeed-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.