Install
openclaw skills install @sdk-team/alibabacloud-yike-cliUse when the user needs Yike CLI for local image/video upload or uploading media to the cloud (including Agent chat attachments exposed as local paths), standalone image/video generation, media info or quality inspection, async media/job wait and recovery, account/auth/config/update checks, listing or installing bundled skill packages, or help showing and choosing Yike CLI model, resolution, ratio, size, duration, and task type parameters for video generation.
openclaw skills install @sdk-team/alibabacloud-yike-cliThis skill is the Agent operation protocol for the yike command. Load the appropriate references/ sub-module based on the user's request, then execute the command. When commands conflict with documentation, treat the current CLI help as authoritative and report the inconsistency to the user; only modify documentation when the user explicitly requests skill maintenance.
Load this skill whenever the user raises any of the following needs:
jobId / resumeCommand.This skill orchestrates the Alibaba Cloud Yike CLI — a single-binary tool that manages media upload, image/video generation, job lifecycle, and account authentication against the Yike cloud API.
When a user request arrives, the agent selects the reference module(s) to load based on the primary intent:
references/account-and-setup.md
references/upload.md
references/generate.md (core), plus optionally:
references/generate-image.md — natural-language image generationreferences/generate-video.md — natural-language video generationreferences/video-model-capabilities.md
references/media-and-jobs.md
[Auth Check] → [Upload if local files] → [Generate with --dry-run] → [User confirms] → [Generate with --yes] → [Job Wait] → [Media Info / Doctor]
mediaId (status Normal) that feeds into Generate as --reference-image or --reference-video.jobId and resumeCommand consumed by Media & Jobs for polling.mediaId of the output, which can be inspected with media info or validated with media doctor.Load the relevant sub-module based on the request:
| Need | Command Family | Sub-module |
|---|---|---|
| Local image/video upload, Agent chat attachment → mediaId, upload status wait | yike media upload, yike media wait | references/upload.md |
| Standalone image/video generation, model/resolution/ratio/size/duration/taskType selection | yike generate image, yike generate video | references/generate.md; natural-language image gen: references/generate-image.md; natural-language video gen: references/generate-video.md |
| Video model accepted reference media types and counts | yike generate video | references/video-model-capabilities.md |
| Media info / quality gating, job polling and recovery | yike media info/doctor, yike job watch/recover | references/media-and-jobs.md |
| Authentication/context, account info, updates, skill installation | yike auth/config, yike whoami/account/update, yike self skill install | references/account-and-setup.md |
The following rules apply to all command families.
Before any operation that accesses the Yike API, run:
yike auth status --format json
yike config get --format json
If not logged in, complete browser authorization with yike auth login --format json; do not proceed with upload or generation tasks until authorization completes. Use yike auth logout --format json when logout is needed. Do not report internal authentication handling to the user during normal flow; only surface authentication failures and recover using details.reauthCommand. Full rules for login, configuration, and context overrides are in references/account-and-setup.md.
All commands that require parsing, decision-making, recovery, or delivery must explicitly append --format json. Only use the default text or --format text when the user explicitly requests human-readable terminal output.
When unsure about command usage, run the corresponding --help first. Never extract jobId, mediaId, mediaType, resumeCommand, URLs, error codes, or status from text output.
Execute generation in the following order:
--dry-run --format json first; do not pass --yes at the same time, nor pass --wait, --interval, or --timeout (which have no effect in dry-run); do not submit the task.estimation.credits from stdout JSON output; also check estimation.balance, estimation.insufficient, and estimation.warnings; explicitly display the estimated credits and any warnings to the user.--dry-run with --yes, and execute the real submission. Add --wait plus polling parameters when the user wants to wait for results; omit them when the user only wants a jobId. --yes only passes the user's already-given confirmation to the CLI — it cannot substitute for user confirmation.--dry-run, display the new estimate, and wait for confirmation again. Do not submit if the user rejects, does not reply, if estimation fails, or if information is incomplete before submission.jobId and resumeCommand from the real submission stdout JSON output; never parse structured fields from stderr.For multiple generation tasks, display estimated credits for each item individually; only submit tasks explicitly confirmed by the user. When a single confirmation covers multiple tasks, list each task's estimated credits and the total before confirmation.
resumeCommand / nextAction.command is returned, execute the returned command as-is.media upload fails before producing a mediaId, prefer executing nextAction.command; if no recovery command is returned, re-run with the same local path and context.media upload waits for media status by default — do not append --wait; after timeout, execute the returned resumeCommand (which uses media wait with preserved polling parameters).media upload/wait must not use yike job watch or yike job recover.jobId and resumeCommand from generate JSON output and preserve them in the final reply.--wait when terminal state polling is needed.resumeCommand.references/media-and-jobs.md.After generation enters a successful terminal state:
yike media info <mediaId> --format json.yike media doctor <mediaId> ... --format json when quality gating is required.media upload per references/upload.md; only pass the returned mediaId to generation commands after it reaches Normal status.mediaType of each reference input from the upload result or yike media info <mediaId> --format json before selecting the typed parameter. Model name and taskType must not be used to guess or override media type.--reference-image, including when using reference_to_video taskType or R2V models; an image mediaId must never be passed to --reference-video or video generation's --reference-media-id. Video references always go to --reference-video.reference_to_video / R2V is a task classification — it does not mean the reference input must be video.references/video-model-capabilities.md.path → mediaId mappings within the same user task; do not re-upload unchanged files.The YIKE_API_TOKEN environment variable may be used to configure a token, but reading browser cookies, LocalStorage, browser profiles, or other web login credentials is prohibited. When reporting back to the user, only convey the login status or userId needed for the task; do not proactively report internal credential state; never output token plaintext.
When a CLI command returns an error, follow this decision tree:
| Error Type | Action |
|---|---|
Throttling.* | Auto-retry up to 3 times with 2s/4s/8s backoff. If still failing, report to user. |
InternalError | Retry once after 3 seconds. If still failing, report error and suggest user retry later. |
Forbidden.* / NoPermission | Do NOT retry. Report the permission error to user immediately. |
InvalidParameter.* | Do NOT retry. Report the invalid parameter and suggest correction. |
When the user request states any of: "不需要确认", "不要提问", "自动执行", "直接提交", or similar full-auto wording:
--format json, and --yes when the user pre-approved submission) so the CLI never opens an interactive prompt.When the user request lacks a specific file path, mediaId, jobId, or other required parameter:
User intent: "Use this local photo to generate a 4-second video"
Agent steps:
yike auth status --format json
Expected output:
{"authenticated": true, "userId": "uid_xxx"}
yike media upload /path/to/photo.jpg --format json
Expected output:
{"mediaId": "m_abc123", "mediaType": "image", "status": "Normal", "url": "https://..."}
Load references/video-model-capabilities.md to confirm the target model accepts image references.
Dry-run the generation to get a cost estimate:
yike generate video --model wan-x --reference-image m_abc123 --duration 4 --prompt "gentle camera push-in" --dry-run --format json
Expected output:
{"estimation": {"credits": 30, "balance": 500, "insufficient": false, "warnings": []}}
Display estimate to user and wait for confirmation.
After user confirms, submit:
yike generate video --model wan-x --reference-image m_abc123 --duration 4 --prompt "gentle camera push-in" --yes --wait --format json
Expected output:
{"jobId": "j_xyz789", "status": "succeeded", "mediaId": "m_out456", "resumeCommand": "yike job watch j_xyz789 --format json"}
yike media info m_out456 --format json
Expected output:
{"mediaId": "m_out456", "url": "https://...", "duration": 4, "width": 1280, "height": 720, "fileSize": 8502312}
User intent: "Generate a cyberpunk cityscape at night, 1024x1024"
Agent steps:
Verify authentication (same as above).
Dry-run to estimate credits:
yike generate image --model wanx-poster --prompt "cyberpunk cityscape at night, neon lights, rain-slicked streets" --size 1024x1024 --dry-run --format json
Expected output:
{"estimation": {"credits": 10, "balance": 500, "insufficient": false, "warnings": []}}
Display estimate ("This will cost 10 credits") and wait for confirmation.
After confirmation, submit:
yike generate image --model wanx-poster --prompt "cyberpunk cityscape at night, neon lights, rain-slicked streets" --size 1024x1024 --yes --wait --format json
Expected output:
{"jobId": "j_img001", "status": "succeeded", "mediaId": "m_img002"}
yike media info m_img002 --format json
Expected output:
{"mediaId": "m_img002", "url": "https://...", "width": 1024, "height": 1024, "fileSize": 1245678}
User intent: "My video generation timed out, the jobId is j_xyz789"
Agent steps:
yike job watch j_xyz789 --format json
Expected output (still running):
{"jobId": "j_xyz789", "status": "running", "resumeCommand": "yike job watch j_xyz789 --timeout 300 --format json"}
yike job watch j_xyz789 --timeout 300 --format json
Expected output (succeeded):
{"jobId": "j_xyz789", "status": "succeeded", "mediaId": "m_out456"}
yike media info m_out456 --format json
Expected output:
{"mediaId": "m_out456", "url": "https://...", "duration": 4, "width": 1280, "height": 720, "fileSize": 8502312}
"status": "failed"), report the failure state, error details, and any resumeCommand — do not silently retry with different parameters.| Problem | Fix | Details |
|---|---|---|
| Proceeding with generation while not logged in | Complete yike auth login or set YIKE_API_TOKEN env var first | account-and-setup.md |
Reporting completion after only receiving jobId | Wait for job terminal state and verify with media info/doctor | media-and-jobs.md |
Losing resumeCommand | Record from JSON output and relay the recovery command | media-and-jobs.md |
| Receiving a local image/video path or Agent chat attachment | Run media upload first; only use the returned mediaId after status is Normal | upload.md |
| R2V model receives an image reference | Keep the image type and pass --reference-image; never pass --reference-video or video generation's --reference-media-id | generate-video.md |
Inferring "only accepts video" from r2v / reference_to_video | Stop inferring and read the model reference input capability table | video-model-capabilities.md |
| Upload wait timeout | Execute the returned media wait resumeCommand; do not use job watch/recover | upload.md |
| Treating CLI help taskType grouping as model reference input capabilities | Help is only for model code listings; read the capability table for input types and counts | video-model-capabilities.md |
| Silently retrying with smaller parameters after failure | Surface the error first, preserve logs and recovery keys | Per-module "Common Mistakes" sections |