Wan CLI
A command-line tool for AI video generation using Tongyi Wansiang through the AceDataCloud API.
Generate AI videos directly from your terminal — no MCP client required.
Features
- Video Generation — Generate videos from text prompts with multiple models
- Image-to-Video — Create videos from reference images
- Multiple Models — wan2.6-t2v, wan2.6-i2v, wan2.6-i2v-flash, wan2.6-r2v, wan3.0-video
- Task Management — Query tasks, batch query, wait with polling
- Rich Output — Beautiful terminal tables and panels via Rich
- JSON Mode — Machine-readable output with
--jsonfor piping
Quick Start
1. Get API Token
Get your API token from AceDataCloud Platform:
- Sign up or log in
- Navigate to the Wan API page
- Click "Acquire" to get your token
2. Install
# Install with pip
pip install wan-cli
# Or with uv (recommended)
uv pip install wan-cli
# Or from source
git clone https://github.com/AceDataCloud/WanCli.git
cd WanCli
pip install -e .
3. Configure
# Set your API token
export ACEDATACLOUD_API_TOKEN=your_token_here
# Or use .env file
cp .env.example .env
# Edit .env with your token
4. Use
# Generate a video from text
wan generate "Astronauts shuttle from space to volcano"
# Generate from reference image
wan image-to-video "Animate this scene" -i https://example.com/photo.jpg
# Check task status
wan task <task-id>
# Wait for completion
wan wait <task-id> --interval 5
# List available models
wan models
Commands
| Command | Description |
|---|---|
wan generate <prompt> |
Generate a video from a text prompt |
wan image-to-video <prompt> -i <url> |
Generate a video from a reference image |
wan task <task_id> |
Query a single task status |
wan tasks <id1> <id2>... |
Query multiple tasks at once |
wan wait <task_id> |
Wait for task completion with polling |
wan models |
List available Wan models |
wan resolutions |
List available resolutions |
wan config |
Show current configuration |
Global Options
--token TEXT API token (or set ACEDATACLOUD_API_TOKEN env var)
--version Show version
--help Show help message
Most commands support:
--json Output raw JSON (for piping/scripting)
--model TEXT Wan model version (default: wan2.6-t2v)
--resolution TEXT Output resolution: 480P, 720P, 1080P
--duration TEXT Duration in seconds: 2-30, or -1 for auto
--shot-type TEXT Shot type: single, multi
--audio/--no-audio Whether the video has sound
--prompt-extend/--no-prompt-extend Enable prompt intelligent rewriting
--media TYPE=URL Media item (repeatable)
--ratio TEXT Aspect ratio: adaptive, 16:9, 4:3, 1:1, 3:4, 9:16
--seed INTEGER Random seed (0-2147483647)
--watermark/--no-watermark Whether to add a watermark
Available Models
| Model | Type | Notes |
|---|---|---|
wan2.6-t2v |
Text-to-Video | Text-to-video generation (default) |
wan2.6-i2v |
Image-to-Video | Image-to-video generation |
wan2.6-i2v-flash |
Image-to-Video Flash | Fast image-to-video generation |
wan2.6-r2v |
Reference-to-Video | Reference video-to-video generation |
wan3.0-video |
Video Generation | Wan 3.0 video generation |
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
ACEDATACLOUD_API_TOKEN |
API token from AceDataCloud | Required |
ACEDATACLOUD_API_BASE_URL |
API base URL | https://api.acedata.cloud |
WAN_DEFAULT_MODEL |
Default model | wan2.6-t2v |
WAN_REQUEST_TIMEOUT |
Timeout in seconds | 1800 |
Development
Setup Development Environment
git clone https://github.com/AceDataCloud/WanCli.git
cd WanCli
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,test]"
Run Tests
pytest
pytest --cov=wan_cli
pytest tests/test_integration.py -m integration
Code Quality
ruff format .
ruff check .
mypy wan_cli
Docker
docker pull ghcr.io/acedatacloud/wan-cli:latest
docker run --rm -e ACEDATACLOUD_API_TOKEN=your_token \
ghcr.io/acedatacloud/wan-cli generate "Astronauts shuttle from space to volcano"
Project Structure
WanCli/
├── wan_cli/ # Main package
│ ├── __init__.py
│ ├── __main__.py # python -m wan_cli entry point
│ ├── main.py # CLI entry point
│ ├── core/ # Core modules
│ │ ├── client.py # HTTP client for Wan API
│ │ ├── config.py # Configuration management
│ │ ├── exceptions.py # Custom exceptions
│ │ └── output.py # Rich terminal formatting
│ └── commands/ # CLI command groups
│ ├── video.py # Video generation commands
│ ├── task.py # Task management commands
│ └── info.py # Info & utility commands
├── tests/ # Test suite
├── Dockerfile # Container image
├── deploy/ # Kubernetes deployment configs
├── .env.example # Environment template
├── pyproject.toml # Project configuration
└── README.md
License
This project is licensed under the MIT License — see the LICENSE file for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wan_cli-2026.8.24.0.tar.gz
(14.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wan_cli-2026.8.24.0.tar.gz.
File metadata
- Download URL: wan_cli-2026.8.24.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3d49bbd4da3db5662696ddd4e0cf983aa163e67b40af4d0da3d47d903ad59a2
|
|
| MD5 |
d5a6be4fe84ec25e1231fc7bb92ec830
|
|
| BLAKE2b-256 |
5958af7544d9885395e391e1ca50ec2b5de66f6533cc55ef0d0136d53c9b9e9a
|
File details
Details for the file wan_cli-2026.8.24.0-py3-none-any.whl.
File metadata
- Download URL: wan_cli-2026.8.24.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e961e52898f7152367581c56d25948b5fbb90ecaf0f65df59d48e010f53f9000
|
|
| MD5 |
81de4c93be1dc46fa452947b8b80d47e
|
|
| BLAKE2b-256 |
7c2842f55c32e942481851dd2a375ff6180fef5440a9bd82071d1b1e9698f920
|