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
- Open Ace Data Cloud → Applications. Sign in, or register an account first.
- Find General application. If it has not been created, choose Initialize General Application. A general key can use the services available to your account; a dedicated application's key is limited to its service. Check the required service/model access and current pricing.
- Copy the API Key from the application card, or open Keys / Manage Keys → Create to create a separate key for this integration. Give it a recognizable name so you can revoke or rotate it independently.
- When creating a key, review Expiration Time, Set Usage Limitation, and Allowed APIs. Enable only the restrictions you need, allow the operations you will call, then click Create and copy the token from the key list. Task lookup does not grant permission to submit a generation. Confirm the application's balance can cover your first request; any trial allowance is whatever your account currently displays.
- Copy only the token value, without quotation marks, spaces, or
Bearer. An API Key / API Token field expects this raw value; only a manually configured HTTPAuthorizationheader needs theBearerprefix. Aplatform-...account-management token cannot replace a generation API key.
Save the key in the client's credential store or the environment variable shown below. Never put it in a prompt, shared workflow, screenshot, or Git commit. If authentication fails, check the full copied value, application/service access, expiration, usage limit, and balance before creating another key.
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.
Metadata
Release files for wan-cli 2026.10.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| wan_cli-2026.10.12.0.tar.gz | 15.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wan_cli-2026.10.12.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.8 kB
Release files / wan_cli-2026.10.12.0.tar.gz
| Download URL | wan_cli-2026.10.12.0.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f757e9e34cda7e8616f335d24b0375d92da08338a65157cbf9c9d927c755afc8
|
|
BLAKE2b-256 checksum How to use checksums |
eb15bf06623e69f545d8a451da0f40a7c72b77e299689fb64fed3ffbb93b6f14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / wan_cli-2026.10.12.0-py3-none-any.whl
| Download URL | wan_cli-2026.10.12.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42e334456ddc483bb9d9247beb0b97948177ad0f940c28677b58e6bb4f57d0ea
|
|
BLAKE2b-256 checksum How to use checksums |
fb78420f65ceda0d832a2d6325daf2b904d87bfab36bd965cbe9d2feca52dafc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for wan-cli 2026.10.12.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.