{"id":"b730c5b2-4468-4e96-b1a1-c00af852aa3b","entityType":"agent","slug":"clawhub-sdk-team-alibabacloud-bailian-videoanalysis","name":"Alibabacloud Bailian Videoanalysis","canonicalUrl":"https://www.xpersona.co/agent/clawhub-sdk-team-alibabacloud-bailian-videoanalysis","canonicalPath":"/agent/clawhub-sdk-team-alibabacloud-bailian-videoanalysis","generatedAt":"2026-10-11T20:59:24.296Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T17:14:01.018Z","emptyReason":null},"description":"Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Produ... Skill: Alibabacloud Bailian Videoanalysis Owner: sdk-team Summary: Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Produ... Tags: latest:0.0.2 Version history: v0.0.2 | 2026-04-22T11:03:07.119Z | auto alibabacloud-bailian-videoanalysis v0.0.2 - Updated to use the Bailian (QuanMiaoLightApp) API product (version 2024","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s173swjet2yrebzqrp6hjkvmy583mxef:alibabacloud-bailian-videoanalysis","sourceUrl":"https://clawhub.ai/sdk-team/alibabacloud-bailian-videoanalysis","homepage":"https://clawhub.ai/sdk-team/skills/alibabacloud-bailian-videoanalysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/sdk-team/alibabacloud-bailian-videoanalysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/sdk-team/skills/alibabacloud-bailian-videoanalysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Produ..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T17:14:01.018Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T17:14:01.018Z","emptyReason":null},"stars":null,"forks":null,"downloads":1020,"packageName":null,"latestVersion":"0.0.2","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T17:14:00.952Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T17:14:01.018Z","lastCrawledAt":"2026-10-11T17:14:00.952Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T17:14:00.952Z","lastVerifiedAt":null,"highlights":[{"version":"0.0.2","createdAt":"2026-04-22T11:03:07.119Z","changelog":"alibabacloud-bailian-videoanalysis v0.0.2 - Updated to use the Bailian (QuanMiaoLightApp) API product (version 2024-08-01) exclusively for video analysis; removed references to videorecog/Mts APIs. - Added clear output language policy (default: Chinese) for all user-facing messages and prompts. - Added required steps to enable AI-Mode in aliyun CLI for usage tracking and plugin management. - Updated RAM and Bailian workspace permission grant instructions with explicit activation steps. - Removed legacy scripts (list_workspace.py, quanmiao_upload_file_to_oss_and_get_file_url.py); streamlined script set for core API flow only. - Refined parameter confirmation logic, CLI install guidance, and error handling instructions for improved reliability.","fileCount":12,"zipByteSize":24906},{"version":"0.0.1","createdAt":"2026-04-16T06:47:40.223Z","changelog":"Initial release of the Alibaba Cloud Bailian (Quanmiao) Video Analysis skill. - Provides intelligent video comprehension and analysis using the Bailian SDK. - Supports video summarization, shot breakdown, ASR transcription, title/caption extraction, and mind mapping. - Handles both local video files and downloadable URLs, with smart OSS upload and validation. - Securely manages authentication via the Alibaba Cloud credential chain; direct credential requests are forbidden. - Includes robust permission and parameter confirmation workflows, guiding users through errors and credential issues. - Designed for ease of setup with detailed instructions for requirements, environment checks, and workspace selection.","fileCount":13,"zipByteSize":25243}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s173swjet2yrebzqrp6hjkvmy583mxef:alibabacloud-bailian-videoanalysis","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T20:59:24.293Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-bailian-videoanalysis/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T17:14:01.018Z","emptyReason":null},"readme":"Skill: Alibabacloud Bailian Videoanalysis\n\nOwner: sdk-team\n\nSummary: Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Produ...\n\nTags: latest:0.0.2\n\nVersion history:\n\nv0.0.2 | 2026-04-22T11:03:07.119Z | auto\n\nalibabacloud-bailian-videoanalysis v0.0.2\n\n- Updated to use the Bailian (QuanMiaoLightApp) API product (version 2024-08-01) exclusively for video analysis; removed references to videorecog/Mts APIs.\n- Added clear output language policy (default: Chinese) for all user-facing messages and prompts.\n- Added required steps to enable AI-Mode in aliyun CLI for usage tracking and plugin management.\n- Updated RAM and Bailian workspace permission grant instructions with explicit activation steps.\n- Removed legacy scripts (list_workspace.py, quanmiao_upload_file_to_oss_and_get_file_url.py); streamlined script set for core API flow only.\n- Refined parameter confirmation logic, CLI install guidance, and error handling instructions for improved reliability.\n\nv0.0.1 | 2026-04-16T06:47:40.223Z | auto\n\nInitial release of the Alibaba Cloud Bailian (Quanmiao) Video Analysis skill.\n\n- Provides intelligent video comprehension and analysis using the Bailian SDK.\n- Supports video summarization, shot breakdown, ASR transcription, title/caption extraction, and mind mapping.\n- Handles both local video files and downloadable URLs, with smart OSS upload and validation.\n- Securely manages authentication via the Alibaba Cloud credential chain; direct credential requests are forbidden.\n- Includes robust permission and parameter confirmation workflows, guiding users through errors and credential issues.\n- Designed for ease of setup with detailed instructions for requirements, environment checks, and workspace selection.\n\nArchive index:\n\nArchive v0.0.2: 12 files, 24906 bytes\n\nFiles: references/acceptance-criteria.md (4922b), references/cli-installation-guide.md (12303b), references/ram-policies.md (3102b), references/related-commands.md (2919b), references/verification-method.md (5681b), scripts/check_env.py (2786b), scripts/quanmiao_get_videoAnalysis_task_result.py (5085b), scripts/quanmiao_submit_videoAnalysis_task.py (4070b), scripts/requirements.txt (172b), skill-card.md (2582b), SKILL.md (19730b), _meta.json (153b)\n\nFile v0.0.2:SKILL.md\n\n---\nname: alibabacloud-bailian-videoanalysis\ndescription: |\n  Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API.\n  **Required API Product**: QuanMiaoLightApp (version 2024-08-01)\n  **Required API Actions**: SubmitVideoAnalysisTask, GetVideoAnalysisTask\n  **DO NOT use**: videorecog, Mts, or any other product for video analysis\n  Triggers: \"analyze video\", \"understand video\", \"analyze the local video /temp/xxx.mp4\", \"analyze the local video https://xxx.com/temp/xxx.mp4\", \"what is this video about\", \"summarize this video\", \"split video into shots\", \"video comprehension\", \"extract video insights\", \"transcribe video\", \"extract video captions\", \"generate video title\", \"generate video outline\", \"video mindmap\".\n---\n\n# Bailian Video Analysis\n\nThis skill provides video analysis functionality based on Alibaba Cloud Bailian Video Analysis Light Application. It uses the Bailian (QuanMiaoLightApp) API for intelligent video comprehension, including shot analysis, ASR transcription, title generation, caption extraction, and mind mapping.\n\n**Architecture:** `CLI (Credential Chain) + OSS (File Storage) + Bailian Workspace + Quanmiao Video Analysis Service + Python SDK Scripts`\n\n---\n\n## Output Language Policy\n\n**Detection Priority:** User input language → Environment language → **Default: Chinese (中文)**\n\n**Apply to:** All user-facing messages, summaries, error explanations, and interactive prompts.\n\n**Keep original language:** Code snippets, API responses, file paths, technical identifiers, HTTP status codes.\n\n---\n\n## Installation\n\n### 1. Python Dependencies\n\n```bash\npython -m pip install -r scripts/requirements.txt\n# On some systems, use pyhon3 instead of python\n```\n\n### 2. Alibaba Cloud CLI\n\n> **Pre-check: Aliyun CLI >= 3.3.1 required**\n> Run `aliyun version` to verify >= 3.3.1. If not installed or version too low,\n> see `references/cli-installation-guide.md` for installation instructions.\n> Then **[MUST]** run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation.\n\n> **AI-Mode Configuration for aliyun CLI**\n>\n> When using the aliyun CLI in this skill, you MUST configure AI-Mode settings:\n>\n> ```bash\n> # Enable AI-Mode (required before using CLI commands)\n> aliyun configure ai-mode enable\n>\n> # Set User-Agent for tracking (required)\n> aliyun configure ai-mode set-user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n>\n> # Update plugins to latest versions (recommended)\n> aliyun plugin update\n> ```\n>\n> **Note:** After completing your tasks, you can disable AI-Mode:\n> ```bash\n> aliyun configure ai-mode disable\n> ```\n\n### 3. Important Prerequisite: Activate Bailian and Video Analysis Service\n\n**Before using this skill, you must first activate the Video Analysis service in the Alibaba Cloud Bailian console!**\n\n1. Visit [Bailian Video_Analysis page](https://bailian.console.aliyun.com/cn-beijing#/app/app-market/quanmiao/video-comprehend)\n2. Click the **\"Paid activation\"** button\n3. Confirm activation and wait for the service to take effect (usually 1-2 minutes)\n\n### 4. Important Prerequisite: Guide Users to Grant Permissions in Alibaba Cloud Access Control and Bailian\n\n**Before using this skill, you must grant the following permissions to the previously configured AK, otherwise calls will fail and may cause 403 errors**\n\n#### 1) RAM Permission Grant\nSee [references/ram-policies.md](references/ram-policies.md) for the full list of required RAM permissions and authorization instructions.\n\n> **[MUST] Permission Failure Handling:** When any command or API call fails due to permission errors at any point during execution, follow this process:\n> 1. Read `references/ram-policies.md` to get the full list of permissions required by this SKILL\n> 2. Use `ram-permission-diagnose` skill to guide the user through requesting the necessary permissions\n> 3. Pause and wait until the user confirms that the required permissions have been granted\n\n#### 2) Bailian Workspace Permission Grant\n1. Visit [Alibaba Cloud Bailian Permission Management](https://bailian.console.aliyun.com/cn-beijing?tab=app#/authority)\n2. If the RAM user corresponding to the AK does not exist, click **\"Add User\"** in the upper right corner of the page, select the corresponding RAM user and click confirm to add.\n3. There is a 30s effective time after configuration, please wait patiently for a while.\n\n---\n\n## Authentication\n\n> **Pre-check: Alibaba Cloud Credentials Required**\n>\n> **Security Rules:**\n> - **NEVER** read, echo, or print AK/SK values (e.g., `echo $ALIBABA_CLOUD_ACCESS_KEY_ID` is FORBIDDEN)\n> - **NEVER** ask the user to input AK/SK directly in the conversation or command line\n> - **NEVER** use `aliyun configure set` with literal credential values\n> - **ONLY** use `aliyun configure list` to check credential status\n>\n> ```bash\n> aliyun configure list\n> ```\n> Check the output for a valid profile (AK, STS, or OAuth identity).\n>\n> **If no valid profile exists, STOP here.**\n> 1. Obtain credentials from [Alibaba Cloud Console](https://ram.console.aliyun.com/manage/ak)\n> 2. Configure credentials **outside of this session** (via `aliyun configure` in terminal or environment variables in shell profile)\n> 3. Return and re-run after `aliyun configure list` shows a valid profile\n\n---\n\n## Parameter Confirmation\n\n> **IMPORTANT: Parameter Confirmation** — Before executing any command or API call,\n> confirm user-provided or customizable parameters (video source, OSS bucket, oss object key).\n> System-auto-resolved parameters (workspace_id, default OSS bucket) do NOT\n> require explicit confirmation unless the user wants to override them.\n\n| Parameter        | Type          | Description                               | Default / Resolution                                                                     |\n|------------------|---------------|-------------------------------------------|------------------------------------------------------------------------------------------|\n| `video_source`   | Required      | Local file path OR downloadable video URL | N/A (user must provide)                                                                  |\n| `workspace_id`   | Auto-resolved | Bailian workspace ID                      | Auto-detected(user may override)                                                         |\n| `ossBucket`      | Optional      | OSS bucket name for file upload           | Auto-detect from first available bucket; user may specify (e.g. `--ossBucket my-bucket`) |\n| `ossObjectKey`   | Optional      | OSS object key for the uploaded file      | `/temp/quanmiao/YYYYMMDD/filename`                                                       |\n| `expireSeconds`  | Optional      | Temporary URL expiration time (seconds)   | `14400` (4 hours)                                                                        |\n\n**Confirmation Workflow:**\n1. **Auto-detection first**: The skill will auto-detect `workspace_id` and `ossBucket` when possible\n2. **User override**: If user wants to specify custom values, confirm before using\n3. **Local vs URL**: Confirm whether user is providing a local file path or a public URL\n\n---\n\n## Core Workflow\n\n> **⚠️ CRITICAL: Cloud API Mandatory** — This skill MUST use Bailian (QuanMiaoLightApp) API for video analysis. Local tools (ffmpeg, whisper, OpenCV, ffprobe, mediainfo, etc.) are FORBIDDEN. If API calls fail due to credentials or permissions, follow Permission Failure Handling process — DO NOT fall back to local analysis.\n\n### Step 1: Environment Check\n\nRun `python scripts/check_env.py` to verify:\n- Python packages are installed\n- Credentials are configured via default credential chain\n\n**If check_env.py fails or returns {\"ready\": false}**:\n- Packages missing → Run `python -m pip install -r scripts/requirements.txt`\n- Credentials missing or invalid → **Follow Permission Failure Handling process**:\n  1. Read `references/ram-policies.md` to get required permissions\n  2. Use `ram-permission-diagnose` skill to guide user through permission request\n  3. Wait for user confirmation before proceeding\n  4. DO NOT proceed with local analysis tools\n\n**Expected output:** `{\"ready\": true}` indicates environment is properly configured.\n\n### Step 2: Get Workspace ID\n\n**Do not ask the user for workspace_id upfront.** Always auto-fetch available workspaces first:\n\n```bash\naliyun modelstudio list-workspaces --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n```\n\n**Workspace selection logic:**\n\n- **Single workspace returned** → use it directly, no need to prompt the user\n- **Multiple workspaces returned** → display a numbered list and proceed with the following:\n  1. **Default behavior**: Use the first workspace in the list automatically to avoid unnecessary interaction\n  2. **User explicitly requests selection**: If the user says \"let me choose workspace\", \"show me the workspace list\", or similar, present the full list and ask them to pick one\n- **No workspaces returned** → inform the user that no Bailian workspace is available, guide them to create one at the [Bailian Console](https://bailian.console.aliyun.com/)\n- **Record user selection** in the session to avoid repeated inquiries\n\n### Step 3: Upload File(video_source) to OSS\n\nBased on the input resource type from Input Resource Validation:\n\n**Case A: User provided a downloadable URL**\n→ Verify URL accessibility: Test if the URL is downloadable using appropriate method for your OS\n→ Skip this step. Use the video_source as `file_url` in Step 4.\n\n**Case B: User provided a local file path**\n→ Auto-detects OSS bucket、Upload local file to OSS and get a temporary URL(file_url) for Step 4:\n\n- **(1) Auto-detect or use user-specified OSS bucket**:\n  - If user specifies `--ossBucket <bucket_name>`, attempt to use that bucket\n  - **If the specified bucket returns 403 AccessDenied or BucketAlreadyExists**: DO NOT switch to another bucket automatically. Instead:\n    1. Inform the user that the specified bucket is not accessible\n    2. Follow the Permission Failure Handling process in RAM Policy section\n    3. Guide user to grant OSS bucket access permissions or specify an alternative bucket they own\n    4. Wait for user confirmation before proceeding\n  - If no bucket specified, auto-detect from first available bucket\n\n```bash\naliyun ossutil ls --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n```\n\n- **(2) Upload file to OSS**: Generate a unique key(oss_object_key) for the uploaded file.\n\n**IMPORTANT - Upload Path Restriction:**\n- **Default path**: MUST use `/temp/quanmiao/YYYYMMDD/filename` format (auto-generated with current date)\n- **Custom path**: ONLY if user explicitly specifies a custom oss_object_key, otherwise always use default path\n- **Security rule**: NEVER upload files outside `/temp/quanmiao/` prefix unless user explicitly requests it\n\n```bash\naliyun ossutil cp <video_source> oss://{oss_bucket}/{oss_object_key} --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region {oss_region}\n```\n\n- **(3) Generate temporary URL**: Generate a temporary URL for the uploaded file using the `ossutil sign` command.\n  - `--expireSeconds`: Default 14400s (4 hours), confirm if different value needed\n\n```bash\naliyun ossutil sign oss://{oss_bucket}/{oss_object_key} --expires-duration {expire_seconds} --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region {oss_region}\n```\n\n- **(4) Verify URL accessibility**: Test if the generated URL is downloadable using appropriate method for your OS\n    - **Note**: Prefer GET request over HEAD request for verification, as some OSS signature versions may reject HEAD requests.\n\n**Recommended validation URL downloadable methods:**\n- **macOS/Linux**: `curl -L --connect-timeout 10 --max-time 30 -o /dev/null -w \"%{http_code}\" <file_url>` (returns HTTP status code)\n- **Windows**: `Invoke-WebRequest -Uri <file_url> -Method Head -TimeoutSec 30` (PowerShell)\n\n**Validation criteria:**\n- **HTTP 200** → URL is valid and accessible, proceed to Step 4\n- **HTTP 403/404** → URL expired or invalid, regenerate with `ossutil sign`\n- **Other errors** → Check network or OSS permissions\n\n### Step 4: Submit Video Analysis Task\n\n> **⚠️ MANDATORY API CALL** — You MUST call SubmitVideoAnalysisTask on QuanMiaoLightApp product (version 2024-08-01). Do NOT use videorecog, Mts, or any other product. Do NOT attempt local analysis.\n\n> **API Selection Checklist** — Before calling, verify:\n> - ✅ Product: QuanMiaoLightApp (NOT videorecog, NOT Mts)\n> - ✅ Version: 2024-08-01\n> - ✅ Action: SubmitVideoAnalysisTask\n> - ✅ Parameters: workspace_id, file_url\n\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id <workspace_id> --file_url <file_url>\n```\n\n**Parameters requiring confirmation:**\n- `--workspace_id`: From Step 2 (confirm with user)\n- `--file_url`: From Step 3 upload result or user-provided URL (confirm validity)\n\n**Error Handling**:\n- If API returns 401 InvalidApiKey or 403 AccessDenied: **STOP** and follow Permission Failure Handling process\n- Do NOT attempt alternative APIs or local tools\n- Inform user: \"Video analysis requires Bailian service activation and proper RAM permissions. Please follow the permission grant guide.\"\n\nReturns `task_id` for polling.\n\n### Step 5: Poll for Task Result\n\n> **⚠️ MANDATORY API CALL** — You MUST poll GetVideoAnalysisTask on QuanMiaoLightApp product (version 2024-08-01) until status is SUCCESSED. Do NOT generate summary from local tools or filename inference.\n\nVideo analysis is asynchronous. Poll until completion:\n\n**Task Status:** `PENDING` → `RUNNING` → `SUCCESSED` | `FAILED` | `CANCELED`\n\n**Variables:**\n- `result_json_path`: `~/.quanmiao/videoanalysis/<video_filename_without_ext>_<task_id>.json`\n- `index_file`: `~/.quanmiao/videoanalysis/index.jsonl`\n\n**Polling Loop:**\n1. Wait 10 seconds after submission\n2. Run: `python scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id <workspace_id> --task_id <task_id> --save_path <result_json_path>`\n3. Check the returned `status` field:\n   - **`SUCCESSED`** → Script auto-saves JSON to `result_json_path`, append entry to `index_file`, display saved locations, then proceed to Step 6\n   - **`FAILED`** or **`CANCELED`** → check error message, inform user, stop\n   - **`PENDING`** or **`RUNNING`** → display any partial results available, wait 10s, repeat from step 2\n4. Max 180 retries (approximately 30 minutes)\n\n**When taskStatus = SUCCESSED:**\n\n1. **Append to index file** (`index_file`):\n    ```json\n    {\"task_id\": \"<task_id>\", \"video_source\": \"<original_path_or_url>\", \"workspace_id\": \"<workspace_id>\", \"result_file\": \"<result_json_path>\", \"timestamp\": \"<ISO8601>\"}\n    ```\n\n2. **Display saved locations:**\n```\n✅ Files saved successfully:\n- Raw JSON result: <result_json_path>\n- Index updated: <index_file>\n```\n\n**Parameters requiring confirmation:**\n- `--workspace_id`: Same as Step 4 (confirm consistency)\n- `--task_id`: From Step 4 submission result (verify before polling)\n\n### Step 6: Summarize Video Content\n\n**CRITICAL: Use the results from Step 5 directly. Do NOT call the API again. Do NOT re-execute any analysis.**\n\nExtract data from the SUCCESSED response obtained in Step 5 and summarize according to user requirements.\n\n**Case A: If the user has a specific analysis request** (e.g., \"analyze the speaker's body language\", \"extract key business insights\", \"compare two people in the video\"), base your answer primarily on:\n- **`payload.output.videoGenerateResults`** — scene-by-scene analysis, descriptions, interpretations\n- **`payload.output.videoAnalysisResult.text`** — visual shot analysis, object/person recognition, action detection\nCombine these fields to construct a targeted answer. Supplement with other fields (captions, mind map, title) as context if relevant.\n\n**Case B: If no specific request**, use the standard output format: Title → Outline → Summary → Captions → Shot Analysis → Timeline → Token Usage\n\n---\n\n## Important Constraints\n\n- **Cloud-only:** No local fallbacks (ffmpeg, whisper, etc.). If cloud API fails, follow Permission Failure Handling process.\n- **Violation Consequence:** Using local tools instead of QuanMiaoLightApp API will result in task failure.\n- **Security:** Never expose credentials in logs or prompts\n- **Permissions:** On auth errors, see `ram-policies.md`\n- **Caching:** Check `~/.quanmiao/videoanalysis/index.jsonl` before re-analyzing same video\n\n---\n\n## Success Verification\n\nSee [references/verification-method.md](references/verification-method.md) for step-by-step verification commands and expected outcomes.\n\n---\n\n## Cleanup\n\nTo clean up resources created by this skill:\n\n**Delete uploaded OSS objects:**\n```bash\naliyun ossutil rm oss://{oss_bucket}/{oss_object_key} --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n```\n\n**Cleanup best practices:**\n- Confirm bucket name and oss object key before deletion\n- Only delete objects with `/temp/quanmiao/` prefix to avoid accidental data loss\n- Cached results at `~/.quanmiao/videoanalysis/` can be kept for future reference or deleted manually\n\n---\n\n## Best Practices\n\n1. **Always verify environment first** — run `check_env.py` before any other operation to catch missing dependencies or credentials early.\n2. **Auto-detect workspace_id** — always fetch workspaces via `list-workspaces`; default to the first result, but present a selection list when the user explicitly asks to choose.\n3. **Use default OSS settings** — unless the user specifies a particular bucket, let the script auto-detect the bucket and generate the oss object key.\n4. **Display partial results during polling** — when task status is `RUNNING`, show available results (title, captions) to give the user real-time feedback.\n5. **Save complete result for summary** — when status becomes `SUCCESSED`, use the full result payload directly for Step 6 without re-calling the API.\n6. **Respect URL expiration** — temporary OSS URLs expire after `expireSeconds` (default 14400s); ensure the task is submitted before the URL expires.\n7. **Handle permission errors gracefully** — follow the Permission Failure Handling process in the RAM Policy section; never improvise credential fixes.\n\n---\n\n## Command Tables\n\nSee [references/related-commands.md](references/related-commands.md) for the full list of available scripts and their parameters.\n\n---\n\n## Reference Links\n\n| Reference                                | Purpose                                                  |\n|------------------------------------------|----------------------------------------------------------|\n| `references/cli-installation-guide.md`   | Installing and upgrading Aliyun CLI                      |\n| `references/ram-policies.md`             | RAM permission checklist and authorization guide         |\n| `references/acceptance-criteria.md`      | Acceptance criteria and correct/incorrect usage patterns |\n| `references/related-commands.md`         | Available scripts and CLI command reference              |\n| `references/verification-method.md`      | Step-by-step success verification commands               |\n\n---\n\n## Troubleshooting\n\n**Common scenarios:**\n- **Permission denied** → See [ram-policies.md](references/ram-policies.md)\n- **CLI not found** → See [cli-installation-guide.md](references/cli-installation-guide.md)\n- **Workspace not found** → Create at [Bailian Console](https://bailian.console.aliyun.com/)\n- **Upload failed** → Check OSS bucket permissions\n- **Task timeout** → Video too large or network issues\n\n---\n\nFile v0.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn74p5w8ywv6prh40g0s82gmqh83nw54\",\n  \"slug\": \"alibabacloud-bailian-videoanalysis\",\n  \"version\": \"0.0.2\",\n  \"publishedAt\": 1776855787119\n}\n\nFile v0.0.2:references/acceptance-criteria.md\n\n# Acceptance Criteria: alibabacloud-bailian-videoanalysis\n\n**Scenario**: Alibaba Cloud Bailian (Quanmiao) Video Analysis\n**Purpose**: Skill testing acceptance criteria\n\n---\n\n# Correct Python Script Usage Patterns\n\n## 1. Environment Check\n\n#### ✅ CORRECT\n```bash\npython scripts/check_env.py\n```\n- Returns JSON with `ready: true/false`\n- Checks Python packages and credentials via default credential chain\n- Does NOT read or print AK/SK values\n\n#### ❌ INCORRECT\n```bash\necho $ALIBABA_CLOUD_ACCESS_KEY_ID   # NEVER print credentials\npython scripts/check_env.py --ak xxx --sk xxx   # NEVER pass AK/SK as arguments\n```\n- Credentials are checked via the default credential chain only\n- The script uses `CredentialClient` internally; no manual credential passing\n\n## 2. Workspace Listing\n\n#### ✅ CORRECT\n```bash\naliyun modelstudio list-workspaces --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n```\n- Returns JSON array of available workspaces\n- Auto-detects workspace_id; does NOT require user to know it in advance\n- Uses `--user-agent` parameter for tracking\n\n#### ❌ INCORRECT\n```bash\naliyun modelstudio list-workspaces   # Missing --user-agent parameter\n```\n\n## 3. File Upload to OSS\n\n#### ✅ CORRECT\n```bash\n# List buckets first\naliyun ossutil ls --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n\n# Upload file\naliyun ossutil cp /path/to/video.mp4 oss://my-bucket/temp/quanmiao/20260409/video.mp4 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region cn-beijing\n\n# Generate temporary URL\naliyun ossutil sign oss://my-bucket/temp/quanmiao/20260409/video.mp4 --expires-duration 7200 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region cn-beijing\n```\n- Uses auto-detected bucket and generated object key by default\n- All commands include `--user-agent` parameter\n- Optionally specifies custom `--expires-duration` (default 7200s)\n\n#### ❌ INCORRECT\n```bash\naliyun ossutil cp /path/to/video.mp4 oss://my-bucket/key   # Missing --user-agent and --region\naliyun ossutil sign oss://my-bucket/key   # Missing required parameters\n```\n\n## 4. Submit Video Analysis Task\n\n#### ✅ CORRECT\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id llm-xxx --file_url \"https://...\"\n```\n- workspace_id must come from Step 2\n- file_url must come from Step 3 (upload script output tempUrl)\n\n#### ❌ INCORRECT\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id fake-id --file_url \"invalid-url\"   # Invalid workspace_id or URL\npython scripts/quanmiao_submit_videoAnalysis_task.py   # Missing required parameters\n```\n- Both `--workspace_id` and `--file_url` are required\n- file_url must be a valid temporary OSS URL\n\n## 5. Get Task Result\n\n#### ✅ CORRECT\n```bash\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id llm-xxx --task_id abc123\n```\n- Poll every 10-15 seconds until status is `SUCCESSED` or `FAILED`\n- Handle `RUNNING` status by displaying partial results\n\n#### ❌ INCORRECT\n```bash\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id llm-xxx --task_id abc123 --retry 1000   # No --retry parameter exists\n```\n- The script returns the current task status; polling logic is handled externally\n- Max retries should be 180 (approximately 30 minutes)\n\n## 6. Authentication\n\n#### ✅ CORRECT\n```bash\naliyun configure list   # Check credential status\n```\n- Uses `aliyun configure list` to verify credentials\n- Relies on Alibaba Cloud default credential chain\n\n#### ❌ INCORRECT\n```bash\naliyun configure set --mode AK --access-key-id LTAI... --access-key-secret abc...   # NEVER set credentials within the session\necho $ALIBABA_CLOUD_ACCESS_KEY_ID   # NEVER print credential values\n```\n- Credentials must be configured outside of the session\n- Never read, echo, or print AK/SK values\n\n# Common Anti-Patterns\n\n## Hardcoding User-Specific Parameters\n\n#### ❌ INCORRECT\n```bash\n# Assuming a specific workspace_id without checking\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id llm-known-good --file_url ...\n```\n- Always fetch workspaces via step 4 first; default to the first result or present a selection list if the user explicitly asks to choose\n\n## Skipping Environment Check\n\n#### ❌ INCORRECT\n```bash\n# Jumping directly to OSS upload without checking environment\naliyun ossutil cp /path/to/video.mp4 oss://my-bucket/key --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region cn-beijing\n```\n- Always run `check_env.py` first to ensure dependencies and credentials are ready\n\n## Re-calling API After Success\n\n#### ❌ INCORRECT\n```bash\n# Step 5 returned SUCCESSED, but calling get_result again in Step 6\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id llm-xxx --task_id abc123\n```\n- Use the result from Step 5 directly in Step 6; do NOT call the API again\n\nFile v0.0.2:references/cli-installation-guide.md\n\n# Aliyun CLI Installation & Configuration Guide\nComplete guide for installing and configuring Aliyun CLI.\n\n## Table of Contents\n- [Installation](#installation)\n    - [macOS](#macos)\n    - [Linux](#linux)\n    - [Windows](#windows)\n- [Configuration](#configuration)\n    - [Quick Start](#quick-start)\n    - [Configuration Modes](#configuration-modes)\n    - [Environment Variables](#environment-variables)\n    - [Managing Multiple Profiles](#managing-multiple-profiles)\n    - [Credential Priority](#credential-priority)\n- [Verification](#verification)\n- [Security Best Practices](#security-best-practices)\n- [Troubleshooting](#troubleshooting)\n- [Advanced Configuration](#advanced-configuration)\n- [Next Steps](#next-steps)\n- [References](#references)\n> **Aliyun CLI 3.3.1+**: Supports installing and using all published Alibaba Cloud product plugins. Make sure to upgrade to 3.3.1 or later for full plugin ecosystem coverage.\n>\n> **[IMPORTANT]** After installation, run the following command to enable automatic plugin installation:\n> ```bash\n> aliyun configure set --auto-plugin-install true\n> ```\n## Installation\n### macOS\n**Using Homebrew (Recommended)**\n```bash\nbrew install aliyun-cli\n# Upgrade to latest\nbrew upgrade aliyun-cli\n# Verify version (>= 3.3.1)\naliyun version\n```\n**Using Binary**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-amd64.tgz\n# Extract\ntar -xzf aliyun-cli-macosx-latest-amd64.tgz\n# Move to PATH\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n### Linux\n**Debian/Ubuntu**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-amd64.tgz\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n**CentOS/RHEL**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-amd64.tgz\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n**ARM64 Architecture**\n```bash\n# Download ARM64 version\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-arm64.tgz\nsudo mv aliyun /usr/local/bin/\n```\n### Windows\n**Using Binary**\n1. Download from: https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip\n2. Extract the ZIP file\n3. Add the directory to your PATH environment variable\n4. Open new Command Prompt or PowerShell\n5. Verify: `aliyun version`\n   **Using PowerShell**\n```powershell\n# Download\nInvoke-WebRequest -Uri \"https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip\" -OutFile \"aliyun-cli.zip\"\n# Extract\nExpand-Archive -Path aliyun-cli.zip -DestinationPath C:\\aliyun-cli\n# Add to PATH (requires admin privileges)\n$env:Path += \";C:\\aliyun-cli\"\n[Environment]::SetEnvironmentVariable(\"Path\", $env:Path, [System.EnvironmentVariableTarget]::Machine)\n# Verify\naliyun version\n```\n## Configuration\n### Quick Start\n```bash\naliyun configure set \\\n  --mode AK \\\n  --access-key-id <your-access-key-id> \\\n  --access-key-secret <your-access-key-secret> \\\n  --region cn-hangzhou\n```\nAll `aliyun configure` commands support non-interactive flags, which is the recommended approach —\nit works in scripts, CI/CD pipelines, and agent-driven automation without hanging on stdin prompts.\n**Where to Get Access Keys**\n1. Log in to Aliyun Console: https://ram.console.aliyun.com/\n2. Navigate to: AccessKey Management\n3. Create a new AccessKey pair\n4. Save the secret immediately — it's only shown once\n### Configuration Modes\nAliyun CLI supports 6 authentication modes. All examples below use non-interactive flags.\n#### 1. AK Mode (Access Key)\nMost common mode for personal accounts and scripts.\n```bash\naliyun configure set \\\n  --mode AK \\\n  --access-key-id LTAI5tXXXXXXXX \\\n  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \\\n  --region cn-hangzhou\n```\nConfiguration is stored in `~/.aliyun/config.json`:\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": [\n    {\n      \"name\": \"default\",\n      \"mode\": \"AK\",\n      \"access_key_id\": \"LTAI5tXXXXXXXX\",\n      \"access_key_secret\": \"8dXXXXXXXXXXXXXXXXXXXXXXXX\",\n      \"region_id\": \"cn-hangzhou\",\n      \"output_format\": \"json\",\n      \"language\": \"en\"\n    }\n  ]\n}\n```\n#### 2. StsToken Mode (Temporary Credentials)\nFor short-lived access (tokens expire in 1-12 hours).\n```bash\naliyun configure set \\\n  --mode StsToken \\\n  --access-key-id LTAI5tXXXXXXXX \\\n  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \\\n  --sts-token v1.0:XXXXXXXXXXXXXXXX \\\n  --region cn-hangzhou\n```\nUse cases: CI/CD pipelines, temporary access for external contractors, cross-account access.\n#### 3. RamRoleArn Mode (Assume RAM Role)\nAssume a RAM role for elevated or cross-account access.\n```bash\naliyun configure set \\\n  --mode RamRoleArn \\\n  --access-key-id LTAI5tXXXXXXXX \\\n  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \\\n  --ram-role-arn acs:ram::123456789012:role/AdminRole \\\n  --role-session-name my-session \\\n  --region cn-hangzhou\n```\nUse cases: cross-account resource access, temporary elevated privileges, role-based access control.\n#### 4. EcsRamRole Mode (ECS Instance RAM Role)\nUse the RAM role attached to an ECS instance — no credentials needed.\n```bash\naliyun configure set \\\n  --mode EcsRamRole \\\n  --ram-role-name MyEcsRole \\\n  --region cn-hangzhou\n```\nRequirements: must be running on an ECS instance with a RAM role attached.\nUse cases: scripts and automation running on ECS instances.\n#### 5. RsaKeyPair Mode (RSA Key Pair)\nUse RSA key pair for authentication (generate key pair in Aliyun Console first).\n```bash\naliyun configure set \\\n  --mode RsaKeyPair \\\n  --private-key /path/to/private-key.pem \\\n  --key-pair-name my-key-pair \\\n  --region cn-hangzhou\n```\n#### 6. RamRoleArnWithEcs Mode (ECS + RAM Role)\nCombine ECS instance role with RAM role assumption for cross-account access from ECS.\n```bash\naliyun configure set \\\n  --mode RamRoleArnWithEcs \\\n  --ram-role-name MyEcsRole \\\n  --ram-role-arn acs:ram::123456789012:role/TargetRole \\\n  --role-session-name my-session \\\n  --region cn-hangzhou\n```\n### Environment Variables\n**Highest priority** - overrides config file\n**Access Key Mode**\n```bash\nexport ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id\nexport ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret\nexport ALIBABA_CLOUD_REGION_ID=cn-hangzhou\n```\n**STS Token Mode**\n```bash\nexport ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id\nexport ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret\nexport ALIBABA_CLOUD_SECURITY_TOKEN=your_sts_token\nexport ALIBABA_CLOUD_REGION_ID=cn-hangzhou\n```\n**ECS RAM Role Mode**\n```bash\nexport ALIBABA_CLOUD_ECS_METADATA=role_name\n```\n**Use Case**:\n- CI/CD pipelines\n- Docker containers\n- Temporary credential override\n### Managing Multiple Profiles\n**Create Named Profiles**\n```bash\naliyun configure set --profile projectA \\\n  --mode AK \\\n  --access-key-id LTAI5tAAAAAAAA \\\n  --access-key-secret 8dAAAAAAAAAAAAAAAAAAAAAAAA \\\n  --region cn-hangzhou\naliyun configure set --profile projectB \\\n  --mode AK \\\n  --access-key-id LTAI5tBBBBBBBB \\\n  --access-key-secret 8dBBBBBBBBBBBBBBBBBBBBBBBB \\\n  --region cn-shanghai\n```\n**Use Specific Profile**\n```bash\naliyun ecs describe-instances --profile projectA\nexport ALIBABA_CLOUD_PROFILE=projectA\naliyun ecs describe-instances   # Uses projectA\n```\n**List and Switch Profiles**\n```bash\naliyun configure list                      # List all profiles\naliyun configure set --current projectA    # Switch default profile\n```\n### Credential Priority\nCredentials are loaded in this order (first found wins):\n1. **Command-line flag**: `--profile <name>`\n2. **Environment variable**: `ALIBABA_CLOUD_PROFILE`\n3. **Environment credentials**: `ALIBABA_CLOUD_ACCESS_KEY_ID`, etc.\n4. **Configuration file**: `~/.aliyun/config.json` (current profile)\n5. **ECS Instance RAM Role**: If running on ECS with attached role\n## Verification\n### Test Authentication\n```bash\n# Basic test - list regions\naliyun ecs describe-regions\n# Expected output: JSON array of regions\n```\n**If successful**, you'll see:\n```json\n{\n  \"Regions\": {\n    \"Region\": [\n      {\n        \"RegionId\": \"cn-hangzhou\",\n        \"RegionEndpoint\": \"ecs.cn-hangzhou.aliyuncs.com\",\n        \"LocalName\": \"China East 1 (Hangzhou)\"\n      },\n      ...\n    ]\n  },\n  \"RequestId\": \"...\"\n}\n```\n**If failed**, you'll see error messages:\n- `InvalidAccessKeyId.NotFound` - Wrong Access Key ID\n- `SignatureDoesNotMatch` - Wrong Access Key Secret\n- `InvalidSecurityToken.Expired` - STS token expired (for StsToken mode)\n- `Forbidden.RAM` - Insufficient permissions\n### Debug Configuration\n```bash\n# Show current configuration\naliyun configure get\n# Test with debug logging\naliyun ecs describe-regions --log-level=debug\n# Check credential provider\naliyun configure get mode\n```\n## Security Best Practices\n### 1. Use RAM Users (Not Root Account)\n- **Don't**: Use Aliyun root account credentials\n- **Do**: Create RAM users with specific permissions\n```bash\n# Create RAM user in console\n# Attach only necessary policies\n# Use RAM user's access keys\n```\n### 2. Principle of Least Privilege\nGrant only the minimum permissions needed:\n```bash\n# Example: Read-only ECS access\n# Attach policy: AliyunECSReadOnlyAccess\n```\n### 3. Rotate Access Keys Regularly\n```bash\n# Create new access key in RAM Console, then update configuration\naliyun configure set --access-key-id NEW_KEY --access-key-secret NEW_SECRET\n# Delete old access key from console\n```\n### 4. Use STS Tokens for Temporary Access\n```bash\naliyun configure set --mode StsToken \\\n  --access-key-id XXXX --access-key-secret XXXX \\\n  --sts-token XXXX --region cn-hangzhou\n```\n### 5. Use ECS RAM Roles When Possible\n```bash\naliyun configure set --mode EcsRamRole --ram-role-name MyRole --region cn-hangzhou\n```\n### 6. Never Commit Credentials\n```bash\n# Add to .gitignore\necho \"~/.aliyun/config.json\" >> .gitignore\n# Use environment variables in CI/CD instead\n```\n### 7. Secure Config File\n```bash\n# Restrict permissions\nchmod 600 ~/.aliyun/config.json\n```\n## Troubleshooting\n### Issue: Command Not Found\n```bash\n# Check installation\nwhich aliyun\n# Check PATH\necho $PATH\n# Reinstall or add to PATH\n```\n### Issue: Authentication Failed\n```bash\n# Verify configuration\naliyun configure get\n# Test with debug\naliyun ecs describe-regions --log-level=debug\n# Check credentials in console\n# Verify access key is active\n```\n### Issue: Permission Denied\n```bash\n# Error: Forbidden.RAM\n# Check RAM user permissions\n# Attach necessary policies in RAM console\n# Example: AliyunECSFullAccess for ECS operations\n```\n### Issue: STS Token Expired\n```bash\n# Error: InvalidSecurityToken.Expired\n# Reconfigure with new token\naliyun configure set --mode StsToken \\\n  --access-key-id XXXX --access-key-secret XXXX \\\n  --sts-token NEW_TOKEN --region cn-hangzhou\n```\n### Issue: Wrong Region\n```bash\n# Some resources may not exist in the specified region\n# Check available regions\naliyun ecs describe-regions\n# Update default region\naliyun configure set region cn-shanghai\n```\n## Advanced Configuration\n### Custom Endpoint\n```bash\n# Use custom or private endpoint\nexport ALIBABA_CLOUD_ECS_ENDPOINT=ecs-vpc.cn-hangzhou.aliyuncs.com\n```\n### Proxy Settings\n```bash\n# HTTP proxy\nexport HTTP_PROXY=http://proxy.example.com:8080\nexport HTTPS_PROXY=http://proxy.example.com:8080\n# No proxy for specific domains\nexport NO_PROXY=localhost,127.0.0.1,.aliyuncs.com\n```\n### Timeout Settings\n```bash\n# Connection timeout (default: 10s)\nexport ALIBABA_CLOUD_CONNECT_TIMEOUT=30\n# Read timeout (default: 10s)\nexport ALIBABA_CLOUD_READ_TIMEOUT=30\n```\n## Next Steps\nAfter installation and configuration:\n1. **Install plugins** for services you need (v3.3.1+ supports all published product plugins):\n   ```bash\n   aliyun plugin install --names ecs vpc rds\n   # List all available plugins\n   aliyun plugin list-remote\n   ```\n2. **Explore commands**:\n   ```bash\n   aliyun ecs --help\n   aliyun fc --help\n   ```\n3. **Read documentation**:\n    - [Command Syntax Guide](./command-syntax.md)\n    - [Global Flags Reference](./global-flags.md)\n    - [Common Scenarios](./common-scenarios.md)\n## References\n- Official Documentation: https://help.aliyun.com/zh/cli/\n- RAM Console: https://ram.console.aliyun.com/\n- Access Key Management: https://ram.console.aliyun.com/manage/ak\n- Plugin Repository: https://github.com/aliyun/aliyun-cli\n\nFile v0.0.2:references/ram-policies.md\n\n# RAM Permissions\n\nThis Skill requires the following Alibaba Cloud RAM permissions to function properly.\n\n## Required Permissions\n\n| Product          | Action                                     | Description                          |\n|------------------|--------------------------------------------|--------------------------------------|\n| ModelStudio      | `modelstudio:ListWorkspaces`               | List Bailian workspaces              |\n| OSS              | `ossutil:ls`                               | List buckets or objects              |\n| OSS              | `ossutil:cp`                               | Upload, Download or Copy Objects     |\n| OSS              | `ossutil:presign`                          | Generate a pre-signed URL for object |\n| QuanMiaoLightApp | `quanmiaolightapp:SubmitVideoAnalysisTask` | Submit video analysis task           |\n| QuanMiaoLightApp | `quanmiaolightapp:GetVideoAnalysisTask`    | Get video analysis task results      |\n\n## Permission Details\n\n### modelstudio:ListWorkspaces\n\nUsed to query the list of available Bailian workspaces.\n\n### ossutil:ls, ossutil:cp, ossutil:presign\n\nUsed to manage OSS buckets and objects, including listing buckets/objects, uploading/downloading files, and generating temporary access URLs.\n\n### quanmiaolightapp:SubmitVideoAnalysisTask\n\nUsed to submit video analysis tasks to Bailian service.\n\n### quanmiaolightapp:GetVideoAnalysisTask\nUsed to query video analysis task results.\n\n## Authorization Methods\n\n### Use System Policies (Recommended)\n\n1. Visit [Alibaba Cloud RAM Console](https://ram.console.aliyun.com/users)\n2. Select the target RAM user\n3. Click \"Add Permissions\" button\n4. Search and select the following system policies:\n   - `AliyunBailianFullAccess` (includes Bailian-related permissions)\n   - `AliyunModelStudioReadOnlyAccess` (includes ModelStudio-related permissions)\n   - `AliyunQuanMiaoLightAppFullAccess` (includes QuanMiao-related permissions)\n   - `AliyunOSSFullAccess` (includes OSS-related permissions, can be restricted to specific buckets)\n5. Confirm and add permissions\n\n\n## Notes\n\n- There may be a delay of approximately 30 seconds after authorization before permissions take effect\n- If you encounter `403` or `Index.NoWorkspacePermissions` errors, please check:\n  1. Whether the RAM user has been granted the above permissions\n  2. Whether workspace permissions have been granted to the user in the Bailian console\n\n---\n\n## Permission Failure Handling\n\nWhen any command or API call fails due to permission errors at any point during execution, follow this process:\n\n1. **Read this file** (`references/ram-policies.md`) to get the full list of permissions required by this SKILL\n2. **Use `ram-permission-diagnose` skill** to guide the user through requesting the necessary permissions\n3. **Pause and wait** until the user confirms that the required permissions have been granted\n4. **Retry the failed operation** after permissions are confirmed\n\n**Important:** Never proceed with operations that require permissions the user does not have. Always pause and wait for explicit confirmation.\n\nFile v0.0.2:references/related-commands.md\n\n# Related Commands: alibabacloud-bailian-videoanalysis\n\n## Available Python Scripts\n\nAll scripts are located in the `scripts/` directory:\n\n| Script                                            | Purpose                                                  | Required Parameters            | Optional Parameters                                |\n|---------------------------------------------------|----------------------------------------------------------|--------------------------------|----------------------------------------------------|\n| `check_env.py`                                    | Check environment configuration (packages + credentials) | None                           | None                                               |\n| `quanmiao_submit_videoAnalysis_task.py`           | Submit video analysis task to Bailian                    | `--workspace_id`, `--file_url` | None                                               |\n| `quanmiao_get_videoAnalysis_task_result.py`       | Get video analysis task result                           | `--workspace_id`, `--task_id`  | None                                               |\n\n## Aliyun CLI Commands\n\n**Important:** All `aliyun` CLI commands MUST include `--user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis`.\n\n| Command                                                           | Purpose                                     |\n|-------------------------------------------------------------------|---------------------------------------------|\n| `aliyun version`                                                  | Verify CLI version (>= 3.3.1)               |\n| `aliyun configure list`                                           | Check credential status (NEVER print AK/SK) |\n| `aliyun configure set --auto-plugin-install true`                 | Enable automatic plugin installation        |\n| `aliyun modelstudio list-workspaces`                              | List Bailian workspaces                     |\n| `aliyun ossutil ls`                                               | List OSS buckets                            |\n| `aliyun ossutil cp <local-file> oss://<bucket>/<key>`             | Upload file to OSS                          |\n| `aliyun ossutil sign oss://<bucket>/<key> --expires-duration 2h`  | Generate temporary URL                      |\n| `aliyun ossutil rm oss://<bucket>/<key>`                          | Delete uploaded OSS object (cleanup)        |\n\n## Execution Order\n\n```\n1. check_env.py (environment validation)\n       ↓\n2. aliyun modelstudio list-workspaces (get workspace_id)\n       ↓\n3a. [If local file] aliyun ossutil cp + sign (upload & get URL)\n3b. [If URL provided] Skip upload, use URL directly\n       ↓\n4. quanmiao_submit_videoAnalysis_task.py (submit task)\n       ↓\n5. quanmiao_get_videoAnalysis_task_result.py (poll loop)\n       ↓\n6. Summarize (no script call, use Step 5 result directly)\n```\n\nFile v0.0.2:references/verification-method.md\n\n# Verification Method: alibabacloud-bailian-videoanalysis\n\nStep-by-step verification commands to confirm successful execution at each workflow stage.\n\n---\n\n## Step 1: Environment Check Verification\n\n**Command:**\n```bash\npython scripts/check_env.py\n```\n\n**Expected Output (Success):**\n```json\n{\n  \"pythonPackagesInstalled\": {\n    \"alibabacloud-quanmiaolightapp20240801\": true,\n    \"alibabacloud-openapi-util\": true,\n    \"alibabacloud-credentials\": true,\n    \"alibabacloud-tea-openapi\": true,\n    \"alibabacloud-tea-util\": true\n  },\n  \"allPythonPackagesInstalled\": true,\n  \"credentialsConfigured\": true,\n  \"ready\": true,\n  \"errors\": []\n}\n```\n\n**Verification Criteria:**\n- `ready` field is `true`\n- `allPythonPackagesInstalled` field is `true`\n- `credentialsConfigured` field is `true`\n- `errors` array is empty\n\n**Failure Actions:**\n- If `allPythonPackagesInstalled` is `false` → Run `pip install -r scripts/requirements.txt`\n- If `credentialsConfigured` is `false` → Guide user to run `aliyun configure` outside session\n\n**Additional CLI Verification:**\n```bash\n# Verify Aliyun CLI version >= 3.3.1\naliyun version\n\n# Verify credentials are configured\naliyun configure list\n```\n\n---\n\n## Step 2: Workspace Listing Verification\n\n**Command:**\n```bash\naliyun modelstudio list-workspaces --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n```\n\n**Expected Output (Success):**\n```json\n{\n  \"RequestId\": \"...\",\n  \"Workspaces\": [\n    {\n      \"WorkspaceId\": \"llm-xxx\",\n      \"Name\": \"Default Workspace\"\n    }\n  ]\n}\n```\n\n**Verification Criteria:**\n- `Workspaces` array is non-empty\n- Each workspace has `WorkspaceId` and `Name` fields\n- `WorkspaceId` starts with `llm-` prefix\n\n**Failure Actions:**\n- If `Workspaces` is empty → User may not have activated Bailian service; guide to [Bailian console](https://bailian.console.aliyun.com/cn-beijing#/app/app-market/quanmiao/video-comprehend)\n- If error contains `No workspace permissions` → Check RAM permissions and Bailian workspace authorization\n\n---\n\n## Step 3: OSS Upload Verification\n\n**Commands:**\n```bash\n# List available buckets\naliyun ossutil ls --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n\n# Upload file to OSS\naliyun ossutil cp <local-file> oss://<bucket>/<key> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region <region>\n\n# Generate temporary URL\naliyun ossutil sign oss://<bucket>/<key> --expires-duration 7200 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region <region>\n```\n\n**Expected Output (Sign Command Success):**\n```\nhttps://my-bucket.oss-cn-beijing.aliyuncs.com/temp/quanmiao/20260409/video.mp4?Signature=xxx&Expires=xxx&OSSAccessKeyId=xxx\n```\n\n**Verification Criteria:**\n- Generated URL is a valid HTTPS URL containing OSS domain and signature parameters\n- URL includes `Signature`, `Expires`, and `OSSAccessKeyId` query parameters\n- Bucket name and object key match the uploaded file\n\n**Failure Actions:**\n- If upload fails with permission error → Follow Permission Failure Handling in RAM Policy section\n- If file not found → Verify local file path points to an existing file\n- If no buckets available → Create an OSS bucket first or use user-provided video URL directly\n\n---\n\n## Step 4: Task Submission Verification\n\n**Command:**\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id <workspace_id> --file_url <tempUrl>\n```\n\n**Expected Output (Success):**\n```json\n{\n  \"task_id\": \"xxxx\"\n}\n```\n\n**Verification Criteria:**\n- Response contains a non-empty `task_id` field\n- No error code or message in response\n\n**Failure Actions:**\n- If `task_id` is missing → Check that `workspace_id` exists and `file_url` is valid and not expired\n- If permission error → Follow Permission Failure Handling in RAM Policy section\n\n---\n\n## Step 5: Task Result Polling Verification\n\n**Command:**\n```bash\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id <workspace_id> --task_id <task_id>\n```\n\n**Expected Output (SUCCESSED):**\n```json\n{\n  \"header\": {\n    \"taskId\": \"...\",\n    \"event\": \"task-finished\",\n    \"sessionId\": \"...\",\n    \"eventInfo\": \"完成视频理解\"\n  },\n  \"payload\": {\n    \"output\": {\n      \"videoTitleGenerateResult\": { \"text\": \"...\" },\n      \"videoCaptionResult\": { \"videoCaptions\": [] },\n      \"videoAnalysisResult\": { \"text\": \"...\" },\n      \"videoGenerateResults\": [{ \"text\": \"...\" }],\n      \"videoMindMappingGenerateResult\": { \"text\": \"...\", \"videoMindMappings\": [] },\n      \"videoCalculatorResult\": { \"items\": [] }\n    },\n    \"usage\": {\n      \"inputTokens\": 1,\n      \"outputTokens\": 1,\n      \"totalTokens\": 2\n    }\n  },\n  \"requestId\": \"...\"\n}\n```\n\n**Verification Criteria:**\n- `header.event` equals `\"task-finished\"`\n- `payload.output` contains all expected result fields\n- `payload.usage` contains token counts\n\n**Status Handling:**\n\n| Status      | Action                                      |\n|-------------|---------------------------------------------|\n| `PENDING`   | Wait 10-15s, retry                          |\n| `RUNNING`   | Display partial results, wait 10-15s, retry |\n| `SUCCESSED` | Proceed to Step 6                           |\n| `FAILED`    | Check error message, inform user            |\n| `CANCELED`  | Inform user task was canceled               |\n\n**Maximum retries:** 180 (approximately 30 minutes)\n\n---\n\n## Step 6: Summary Verification\n\n**Verification Criteria:**\n- Summary uses data from Step 5 result directly (no additional API calls)\n- Output includes all sections: title, outline, overview, captions, shot analysis, timeline, summary, token usage\n- Token usage numbers match `payload.usage` from Step 5 result\n\n---\n\nFile v0.0.2:scripts/requirements.txt\n\nalibabacloud-openapi-util==0.2.4\nalibabacloud-credentials==1.0.8\nalibabacloud-tea-util==0.3.14\nalibabacloud-tea-openapi==0.4.4\nalibabacloud-quanmiaolightapp20240801>=2.13.8\n\nFile v0.0.2:skill-card.md\n\n## Description:\n\nAlibaba Cloud Bailian Video Analysis Skill for intelligent video comprehension and analysis via the Bailian QuanMiaoLightApp API.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sdk-team](https://clawhub.ai/user/sdk-team)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and cloud operators use this skill to submit videos to Alibaba Cloud Bailian for video comprehension, then retrieve summaries, captions, shot analysis, generated titles, outlines, mind maps, and token usage from the cloud result.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill may require broad Alibaba Cloud permissions during setup.\n\nMitigation: Use a dedicated least-privilege RAM user or role and restrict OSS permissions to one approved bucket and the /temp/quanmiao/ prefix.\n\nRisk: Credential exposure could occur if access keys are typed into agent-visible commands or logs.\n\nMitigation: Configure credentials outside the agent session, never print AK/SK values, and prefer short-lived credentials.\n\nRisk: Local videos are uploaded to Alibaba Cloud for processing.\n\nMitigation: Review data handling requirements before use and only submit videos approved for Alibaba Cloud processing.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/sdk-team/skills/alibabacloud-bailian-videoanalysis)\n- [Bailian Video Analysis Activation](https://bailian.console.aliyun.com/cn-beijing#/app/app-market/quanmiao/video-comprehend)\n- [Bailian Permission Management](https://bailian.console.aliyun.com/cn-beijing?tab=app#/authority)\n- [CLI Installation Guide](references/cli-installation-guide.md)\n- [RAM Permissions](references/ram-policies.md)\n- [Related Commands](references/related-commands.md)\n- [Verification Method](references/verification-method.md)\n- [Acceptance Criteria](references/acceptance-criteria.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with shell commands and JSON API results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save completed video-analysis responses as local JSON files and summarize cloud-returned analysis fields.]\n\n## Skill Version(s):\n\n0.0.2 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v0.0.1: 13 files, 25243 bytes\n\nFiles: references/acceptance-criteria.md (4561b), references/cli-installation-guide.md (12130b), references/ram-policies.md (1557b), references/related-commands.md (1585b), references/verification-method.md (4841b), scripts/check_env.py (2413b), scripts/list_workspace.py (1102b), scripts/quanmiao_get_videoAnalysis_task_result.py (3593b), scripts/quanmiao_submit_videoAnalysis_task.py (3990b), scripts/quanmiao_upload_file_to_oss_and_get_file_url.py (9700b), scripts/requirements.txt (208b), SKILL.md (15754b), _meta.json (153b)\n\nFile v0.0.1:SKILL.md\n\n---\nname: alibabacloud-bailian-videoanalysis\ndescription: |\n  Alibaba Cloud Bailian (Quanmiao) Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian Quanmiao SDK.\n  Triggers: \"analyze video\", \"understand this video\", \"what is this video about\", \"summarize this video\", \"split video into shots\", \"video analysis\", \"video comprehension\", \"video summary\", \"video breakdown\", \"extract video insights\", \"transcribe video\", \"extract video captions\", \"generate video title\", \"generate video outline\", \"video mindmap\", \"analyze this video\", \"breakdown this video\".\n---\n\n# Bailian (Quanmiao) Video Analysis\n\nThis skill provides video analysis functionality based on Alibaba Cloud Bailian (Quanmiao) Video Analysis Light Application. It uses the Bailian SDK for intelligent video comprehension, including shot analysis, ASR transcription, title generation, caption extraction, and mind mapping.\n\n**Architecture:** `CLI (Credential Chain) + OSS (File Storage) + Bailian Workspace + Quanmiao Video Analysis Service + Python SDK Scripts`\n\n---\n\n## Installation\n\n### Python Dependencies\n\n```bash\ncd scripts\npip install -r requirements.txt\n```\n\n### Alibaba Cloud CLI\n\n> **Pre-check: Aliyun CLI >= 3.3.1 required**\n> Run `aliyun version` to verify >= 3.3.1. If not installed or version too low,\n> see `references/cli-installation-guide.md` for installation instructions.\n> Then **[MUST]** run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation.\n\n---\n\n## Environment Variables\n\nThe Bailian SDK relies on the Alibaba Cloud default credential chain. No additional environment variables are required if credentials are configured via CLI.\n\nThe credential chain resolves in this priority order:\n\n1. **Environment variables:** `ALIBABA_CLOUD_ACCESS_KEY_ID`, `ALIBABA_CLOUD_ACCESS_KEY_SECRET`\n2. **CLI config file:** `~/.aliyun/config.json`\n3. **Credentials file:** `~/.acs/credentials`\n4. **ECS RAM Role** (if running on ECS)\n\n---\n\n## Authentication\n\n> **Pre-check: Alibaba Cloud Credentials Required**\n>\n> **Security Rules:**\n> - **NEVER** read, echo, or print AK/SK values (e.g., `echo $ALIBABA_CLOUD_ACCESS_KEY_ID` is FORBIDDEN)\n> - **NEVER** ask the user to input AK/SK directly in the conversation or command line\n> - **NEVER** use `aliyun configure set` with literal credential values\n> - **ONLY** use `aliyun configure list` to check credential status\n>\n> ```bash\n> aliyun configure list\n> ```\n> Check the output for a valid profile (AK, STS, or OAuth identity).\n>\n> **If no valid profile exists, STOP here.**\n> 1. Obtain credentials from [Alibaba Cloud Console](https://ram.console.aliyun.com/manage/ak)\n> 2. Configure credentials **outside of this session** (via `aliyun configure` in terminal or environment variables in shell profile)\n> 3. Return and re-run after `aliyun configure list` shows a valid profile\n\n---\n\n## RAM Policy\n\nSee [references/ram-policies.md](references/ram-policies.md) for the full list of required RAM permissions and authorization instructions.\n\n> **[MUST] Permission Failure Handling:** When any command or API call fails due to permission errors at any point during execution, follow this process:\n> 1. Read `references/ram-policies.md` to get the full list of permissions required by this SKILL\n> 2. Use `ram-permission-diagnose` skill to guide the user through requesting the necessary permissions\n> 3. Pause and wait until the user confirms that the required permissions have been granted\n\n---\n\n## Parameter Confirmation\n\n> **IMPORTANT: Parameter Confirmation** — Before executing any command or API call,\n> confirm user-provided or customizable parameters (video source, OSS bucket, object key).\n> System-auto-resolved parameters (workspace_id, default OSS bucket) do NOT\n> require explicit confirmation unless the user wants to override them.\n\n| Parameter        | Type | Description | Default / Resolution |\n|------------------|------|-------------|----------------------|\n| `video_source`   | Required | Local file path OR downloadable video URL | N/A (user must provide) |\n| `workspace_id`   | Auto-resolved | Bailian workspace ID | Auto-detected via `list_workspace.py` (user may override) |\n| `ossBucket`      | Optional | OSS bucket name for file upload | Auto-detect from first available bucket; user may specify (e.g. `--ossBucket my-bucket`) |\n| `ossObjectKey`   | Optional | OSS object key for the uploaded file | `temp/quanmiao/YYYYMMDD/filename` |\n| `expireSeconds`  | Optional | Temporary URL expiration time (seconds) | `7200` (2 hours) |\n\n---\n\n## Input Resource Validation\n\nThe user may provide either a **local file path** or a **downloadable URL**. Validate before proceeding:\n\n### Local File Path\n```bash\ntest -f \"<video_source>\" && echo \"exists\" || echo \"not found\"\n```\n- Must be a regular file (not a directory)\n- Supported video formats: `.mp4`, `.avi`, `.mov`, `.mkv`, `.flv`, `.wmv`, `.webm`, `.m4v`, `.3gp`\n- File size must be reasonable (check with `ls -lh`)\n\n### Downloadable URL\n```bash\n# Validate URL is accessible and returns a video content-type\ncurl -sI -L \"<video_source>\" | grep -iE '(content-type|content-length)'\n```\n- URL must be publicly accessible (not behind auth/proxy)\n- Response `Content-Type` should contain `video/`\n- Response `Content-Length` should be reasonable (not 0)\n\n### Validation Result\n- **Local file exists** → proceed to **Step 3 (OSS upload)**, then Step 4\n- **URL is valid** → **skip OSS upload**, use the URL directly in Step 4 (task submission)\n- **Neither valid path nor valid URL** → inform the user and ask for a correct resource\n\n---\n\n## Core Workflow\n\n> **IMPORTANT: Do NOT suggest local video analysis tools** — This skill relies entirely on the Bailian (Quanmiao) cloud API for video analysis. Do NOT suggest local fallbacks such as `ffmpeg`, `whisper`, or other local video/audio analysis tools. If the cloud API fails, follow the Permission Failure Handling process or inform the user of the error. Do NOT invent alternative local analysis methods.\n\n### Step 1: Environment Check\n\nRun `python scripts/check_env.py` to verify:\n- Python packages are installed\n- Credentials are configured via default credential chain\n\nIf not ready:\n- Packages missing → Run `pip install -r scripts/requirements.txt`\n- Credentials missing → Guide user to configure via `aliyun configure` (outside session)\n\n### Step 2: Get Workspace ID\n\n**Do not ask the user for workspace_id upfront.** Always auto-fetch available workspaces first:\n\n```bash\npython scripts/list_workspace.py\n```\n\nReturn format:\n```json\n{\n  \"workspaces\": [\n    { \"workspace_id\": \"llm-xxx\", \"name\": \"Workspace Name\" }\n  ]\n}\n```\n\n**Workspace selection logic:**\n\n- **Single workspace returned** → use it directly, no need to prompt the user\n- **Multiple workspaces returned** → display a numbered list and proceed with the following:\n  1. **Default behavior**: Use the first workspace in the list automatically to avoid unnecessary interaction\n  2. **User explicitly requests selection**: If the user says \"我自己选\", \"我要选择业务空间\", \"let me choose\", \"show me the list\", or similar, present the full list and ask them to pick one\n\n```\n可用的业务空间：\n  1. 默认业务空间 (llm-xxx)\n  2. 测试空间 (llm-yyy)\n  3. 生产空间 (llm-zzz)\n\n默认使用「默认业务空间」，如需切换请选择编号，或回复 \"auto\" 使用默认。\n```\n\n- **No workspaces returned** → inform the user that no Bailian workspace is available, guide them to create one at the [Bailian Console](https://bailian.console.aliyun.com/)\n- **Record user selection** in the session to avoid repeated inquiries\n\n### Step 3: Upload File(video_source) to OSS\n\nBased on the input resource type from Input Resource Validation:\n\n**Case A: User provided a downloadable URL**\n→ Skip this step. Use the video_source as `file_url` in Step 4.\n\n**Case B: User provided a local file path**\n→ Upload to OSS and get a temporary URL:\n\n```bash\n# Auto-detect OSS bucket (uses first available)\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py --localFilePath <video_source>\n\n# User-specified OSS bucket\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py --localFilePath <video_source> --ossBucket <bucket_name>\n\n# User-specified bucket, object key, and custom expiration\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py --localFilePath <video_source> --ossBucket <bucket_name> --ossObjectKey <custom_key> --expireSeconds <seconds>\n```\n\nReturn format:\n```json\n{\n  \"status\": \"success\",\n  \"ossBucket\": \"my-bucket\",\n  \"ossObjectKey\": \"temp/quanmiao/20260409/video.mp4\",\n  \"file_url\": \"https://xxx.oss-cn-beijing.aliyuncs.com/...\",\n  \"expireSeconds\": 7200\n}\n```\n\n### Step 4: Submit Video Analysis Task\n\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id <workspace_id> --file_url <file_url>\n```\n\nReturn format:\n```json\n{ \"task_id\": \"xxxx\" }\n```\n\n### Step 5: Poll for Task Result\n\nVideo analysis is asynchronous. Poll until completion:\n\n**Task Status:** `PENDING` → `RUNNING` → `SUCCESSED` | `FAILED` | `CANCELED`\n\n1. Wait 10 seconds after submission\n2. Run: `python scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id <workspace_id> --task_id <task_id>`\n3. Check the returned `status` field:\n   - **`SUCCESSED`** → proceed to Step 6 with the complete result\n   - **`FAILED`** or **`CANCELED`** → check error message, inform user, stop\n   - **`PENDING`** or **`RUNNING`** → display any partial results available, wait 10s, go to step 2\n4. Max 180 retries (approximately 30 minutes)\n\n### Step 5.1: Save Complete Result Locally\n\nWhen the task reaches `SUCCESSED` status, save the full JSON result to a local file associated with the original video. This enables secondary analysis without re-calling the API.\n\n**Save path convention:** `~/.quanmiao/results/<video_filename_without_ext>_<task_id>.json`\n\n```bash\n# Create results directory if it doesn't exist\nmkdir -p ~/.quanmiao/results\n\n# Derive filename from the original video source\n# e.g. \"xxxx.mp4\" → \"xxxx_52e52f93a17b46f1be0f14415aa07175.json\"\necho '<FULL_JSON_RESULT>' > ~/.quanmiao/results/<video_name>_<task_id>.json\n```\n\nAlso maintain a mapping file at `~/.quanmiao/results/index.jsonl` (append-only):\n```json\n{\"task_id\": \"<task_id>\", \"video_source\": \"<original_path_or_url>\", \"workspace_id\": \"<workspace_id>\", \"result_file\": \"<saved_path>\", \"timestamp\": \"<ISO8601>\"}\n```\n\n> **Before starting a new analysis**, check `~/.quanmiao/results/index.jsonl` for existing results matching the same video source. If found, offer the cached result to the user instead of re-running the analysis.\n\n---\n\nReturn format:\n```json\n{ \n   \"taskStatus\": \"SUCCESSED\",\n   \"header\": {\n      \"event\": \"task-finished\",\n      \"eventInfo\": \"完成视频理解\",\n      \"errorCode\": \"InvalidParam\",\n      \"errorMessage\": \"视频地址有误：Server returned HTTP response code: 403 for URL: https://xx.mp41\"\n    },\n   \"payload\": {\n      \"output\": {\n         \"videoAnalysisResult\": {},\n         \"videoGenerateResults\": {\n            \"text\": \"视频分镜头分析结果..\"\n         },\n         \"videoTitleGenerateResult\": {\n            \"text\": \"视频标题结果..\"\n         },\n         \"videoMindMappingGenerateResult\": {\n            \"text\": \"视频大纲结果..\",\n            \"videoMindMappings\": []\n         },\n         \"videoCalculatorResult\": {\n            \"items\":  []\n         },\n         \"videoCaptionResult\": {\n            \"videoCaptions\": []\n         }\n      },\n      \"usage\": {\n            \"inputTokens\": 607,\n            \"outputTokens\": 563,\n            \"totalTokens\": 1512\n        }\n   }\n}\n```\n\n\n### Step 6: Summarize Video Content\n\n**Use the results from Step 5 directly. Do NOT call the API again.**\n\nExtract data from the SUCCESSED response and summarize according to user requirements.\n\n**If the user has a specific analysis request** (e.g., \"analyze the speaker's body language\", \"extract key business insights\", \"compare two people in the video\"), base your answer primarily on:\n\n- **`payload.output.videoGenerateResults`** — scene-by-scene analysis, descriptions, interpretations\n- **`payload.output.videoAnalysisResult.text`** — visual shot analysis, object/person recognition, action detection\n\nCombine these two fields to construct a targeted answer. Supplement with other fields (captions, mind map, title) as context if relevant.\n\n**If no specific request**, use the standard output format:\n\n```markdown\n# 视频理解结果\n\n## 视频标题\n{payload.output.videoTitleGenerateResult.text}\n\n## 视频大纲\n{payload.output.videoMindMappingGenerateResult.videoMindMappings 结构化展示}\n\n## 视频总结\n{payload.output.videoGenerateResults[0].text}\n\n## 视频语音内容\n{payload.output.videoCaptionResult.videoCaptions 按时间顺序展示}\n\n## 视觉镜头分析\n{payload.output.videoAnalysisResult.text 按镜头总结}\n\n## 时间线总结\n[基于 payload.output.videoAnalysisResult.text 提取关键事件（可选）]\n\n## 总结\n[综合分析 payload.output.videoGenerateResults 和 payload.output.videoAnalysisResult]\n\n## Token消耗\n- 总输入Token: {payload.usage.inputTokens}\n- 总输出Token: {payload.usage.outputTokens}\n- 总计Token: {payload.usage.totalTokens}\n- 详细费用: {videoCalculatorResult.items 中各模型的费用明细}\n```\n\n---\n\n## Success Verification\n\nSee [references/verification-method.md](references/verification-method.md) for step-by-step verification commands and expected outcomes.\n\n---\n\n## Cleanup\n\nTo clean up resources created by this skill:\n\n1. **Delete uploaded OSS objects:**\n   ```bash\n   aliyun oss rm oss://<bucket>/<object-key> --user-agent AlibabaCloud-Agent-Skills\n   ```\n\n2. **Delete Bailian task records** (tasks are auto-cleaned by Bailian after retention period; no manual cleanup needed for task records)\n\n3. **No workspace cleanup needed** — workspaces are shared resources and should not be deleted unless explicitly requested by the user\n\n---\n\n## Best Practices\n\n1. **Always verify environment first** — run `check_env.py` before any other operation to catch missing dependencies or credentials early.\n2. **Auto-detect workspace_id** — always fetch workspaces via `list_workspace.py`; default to the first result, but present a selection list when the user explicitly asks to choose.\n3. **Use default OSS settings** — unless the user specifies a particular bucket, let the script auto-detect the bucket and generate the object key.\n4. **Display partial results during polling** — when task status is `RUNNING`, show available results (title, captions) to give the user real-time feedback.\n5. **Save complete result for summary** — when status becomes `SUCCESSED`, use the full result payload directly for Step 6 without re-calling the API.\n6. **Respect URL expiration** — temporary OSS URLs expire after `expireSeconds` (default 7200s); ensure the task is submitted before the URL expires.\n7. **Handle permission errors gracefully** — follow the Permission Failure Handling process in the RAM Policy section; never improvise credential fixes.\n\n---\n\n## Command Tables\n\nSee [references/related-commands.md](references/related-commands.md) for the full list of available scripts and their parameters.\n\n---\n\n## Reference Links\n\n| Reference | Purpose |\n|-----------|---------|\n| `references/cli-installation-guide.md` | Installing and upgrading Aliyun CLI |\n| `references/ram-policies.md` | RAM permission checklist and authorization guide |\n| `references/acceptance-criteria.md` | Acceptance criteria and correct/incorrect usage patterns |\n| `references/related-commands.md` | Available scripts and CLI command reference |\n| `references/verification-method.md` | Step-by-step success verification commands |\n\nFile v0.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn74p5w8ywv6prh40g0s82gmqh83nw54\",\n  \"slug\": \"alibabacloud-bailian-videoanalysis\",\n  \"version\": \"0.0.1\",\n  \"publishedAt\": 1776322060223\n}\n\nFile v0.0.1:references/acceptance-criteria.md\n\n# Acceptance Criteria: alibabacloud-bailian-videoanalysis\n\n**Scenario**: Alibaba Cloud Bailian (Quanmiao) Video Analysis\n**Purpose**: Skill testing acceptance criteria\n\n---\n\n# Correct Python Script Usage Patterns\n\n## 1. Environment Check\n\n#### ✅ CORRECT\n```bash\npython scripts/check_env.py\n```\n- Returns JSON with `ready: true/false`\n- Checks Python packages and credentials via default credential chain\n- Does NOT read or print AK/SK values\n\n#### ❌ INCORRECT\n```bash\necho $ALIBABA_CLOUD_ACCESS_KEY_ID   # NEVER print credentials\npython scripts/check_env.py --ak xxx --sk xxx   # NEVER pass AK/SK as arguments\n```\n- Credentials are checked via the default credential chain only\n- The script uses `CredentialClient` internally; no manual credential passing\n\n## 2. Workspace Listing\n\n#### ✅ CORRECT\n```bash\npython scripts/list_workspace.py\n```\n- Returns JSON array of available workspaces\n- Auto-detects workspace_id; does NOT require user to know it in advance\n\n#### ❌ INCORRECT\n```bash\npython scripts/list_workspace.py --workspace_id llm-xxx   # workspace_id is not an input parameter\n```\n- The script lists all workspaces; workspace_id is an output, not an input\n\n## 3. File Upload to OSS\n\n#### ✅ CORRECT\n```bash\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py --localFilePath /path/to/video.mp4\n```\n- Uses auto-detected bucket and generated object key by default\n- Optionally specifies `--ossBucket`, `--ossObjectKey`, `--expireSeconds`\n\n#### ❌ INCORRECT\n```bash\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py   # Missing --localFilePath (required)\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py --localFilePath /path/to/video.mp4 --ossBucket \"\"   # Empty bucket name\n```\n- `--localFilePath` is required and must point to an existing file\n\n## 4. Submit Video Analysis Task\n\n#### ✅ CORRECT\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id llm-xxx --file_url \"https://...\"\n```\n- workspace_id must come from Step 2 (list_workspace.py output)\n- file_url must come from Step 3 (upload script output tempUrl)\n\n#### ❌ INCORRECT\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id fake-id --file_url \"invalid-url\"   # Invalid workspace_id or URL\npython scripts/quanmiao_submit_videoAnalysis_task.py   # Missing required parameters\n```\n- Both `--workspace_id` and `--file_url` are required\n- file_url must be a valid temporary OSS URL\n\n## 5. Get Task Result\n\n#### ✅ CORRECT\n```bash\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id llm-xxx --task_id abc123\n```\n- Poll every 10-15 seconds until status is `SUCCESSED` or `FAILED`\n- Handle `RUNNING` status by displaying partial results\n\n#### ❌ INCORRECT\n```bash\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id llm-xxx --task_id abc123 --retry 1000   # No --retry parameter exists\n```\n- The script returns the current task status; polling logic is handled externally\n- Max retries should be 180 (approximately 30 minutes)\n\n## 6. Authentication\n\n#### ✅ CORRECT\n```bash\naliyun configure list   # Check credential status\n```\n- Uses `aliyun configure list` to verify credentials\n- Relies on Alibaba Cloud default credential chain\n\n#### ❌ INCORRECT\n```bash\naliyun configure set --mode AK --access-key-id LTAI... --access-key-secret abc...   # NEVER set credentials within the session\necho $ALIBABA_CLOUD_ACCESS_KEY_ID   # NEVER print credential values\n```\n- Credentials must be configured outside of the session\n- Never read, echo, or print AK/SK values\n\n# Common Anti-Patterns\n\n## Hardcoding User-Specific Parameters\n\n#### ❌ INCORRECT\n```bash\n# Assuming a specific workspace_id without checking\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id llm-known-good --file_url ...\n```\n- Always fetch workspaces via `list_workspace.py` first; default to the first result or present a selection list if the user explicitly asks to choose\n\n## Skipping Environment Check\n\n#### ❌ INCORRECT\n```bash\n# Jumping directly to upload without checking environment\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py --localFilePath /path/to/video.mp4\n```\n- Always run `check_env.py` first to ensure dependencies and credentials are ready\n\n## Re-calling API After Success\n\n#### ❌ INCORRECT\n```bash\n# Step 5 returned SUCCESSED, but calling get_result again in Step 6\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id llm-xxx --task_id abc123\n```\n- Use the result from Step 5 directly in Step 6; do NOT call the API again\n\nFile v0.0.1:references/cli-installation-guide.md\n\n# Aliyun CLI Installation & Configuration Guide\nComplete guide for installing and configuring Aliyun CLI.\n\n## Table of Contents\n- [Installation](#installation)\n    - [macOS](#macos)\n    - [Linux](#linux)\n    - [Windows](#windows)\n- [Configuration](#configuration)\n    - [Quick Start](#quick-start)\n    - [Configuration Modes](#configuration-modes)\n    - [Environment Variables](#environment-variables)\n    - [Managing Multiple Profiles](#managing-multiple-profiles)\n    - [Credential Priority](#credential-priority)\n- [Verification](#verification)\n- [Security Best Practices](#security-best-practices)\n- [Troubleshooting](#troubleshooting)\n- [Advanced Configuration](#advanced-configuration)\n- [Next Steps](#next-steps)\n- [References](#references)\n> **Aliyun CLI 3.3.1+**: Supports installing and using all published Alibaba Cloud product plugins. Make sure to upgrade to 3.3.1 or later for full plugin ecosystem coverage.\n## Installation\n### macOS\n**Using Homebrew (Recommended)**\n```bash\nbrew install aliyun-cli\n# Upgrade to latest\nbrew upgrade aliyun-cli\n# Verify version (>= 3.3.1)\naliyun version\n```\n**Using Binary**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-amd64.tgz\n# Extract\ntar -xzf aliyun-cli-macosx-latest-amd64.tgz\n# Move to PATH\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n### Linux\n**Debian/Ubuntu**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-amd64.tgz\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n**CentOS/RHEL**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-amd64.tgz\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n**ARM64 Architecture**\n```bash\n# Download ARM64 version\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-arm64.tgz\nsudo mv aliyun /usr/local/bin/\n```\n### Windows\n**Using Binary**\n1. Download from: https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip\n2. Extract the ZIP file\n3. Add the directory to your PATH environment variable\n4. Open new Command Prompt or PowerShell\n5. Verify: `aliyun version`\n   **Using PowerShell**\n```powershell\n# Download\nInvoke-WebRequest -Uri \"https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip\" -OutFile \"aliyun-cli.zip\"\n# Extract\nExpand-Archive -Path aliyun-cli.zip -DestinationPath C:\\aliyun-cli\n# Add to PATH (requires admin privileges)\n$env:Path += \";C:\\aliyun-cli\"\n[Environment]::SetEnvironmentVariable(\"Path\", $env:Path, [System.EnvironmentVariableTarget]::Machine)\n# Verify\naliyun version\n```\n## Configuration\n### Quick Start\n```bash\naliyun configure set \\\n  --mode AK \\\n  --access-key-id <your-access-key-id> \\\n  --access-key-secret <your-access-key-secret> \\\n  --region cn-hangzhou\n```\nAll `aliyun configure` commands support non-interactive flags, which is the recommended approach —\nit works in scripts, CI/CD pipelines, and agent-driven automation without hanging on stdin prompts.\n**Where to Get Access Keys**\n1. Log in to Aliyun Console: https://ram.console.aliyun.com/\n2. Navigate to: AccessKey Management\n3. Create a new AccessKey pair\n4. Save the secret immediately — it's only shown once\n### Configuration Modes\nAliyun CLI supports 6 authentication modes. All examples below use non-interactive flags.\n#### 1. AK Mode (Access Key)\nMost common mode for personal accounts and scripts.\n```bash\naliyun configure set \\\n  --mode AK \\\n  --access-key-id LTAI5tXXXXXXXX \\\n  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \\\n  --region cn-hangzhou\n```\nConfiguration is stored in `~/.aliyun/config.json`:\n```json\n{\n  \"current\": \"default\",\n  \"profiles\": [\n    {\n      \"name\": \"default\",\n      \"mode\": \"AK\",\n      \"access_key_id\": \"LTAI5tXXXXXXXX\",\n      \"access_key_secret\": \"8dXXXXXXXXXXXXXXXXXXXXXXXX\",\n      \"region_id\": \"cn-hangzhou\",\n      \"output_format\": \"json\",\n      \"language\": \"en\"\n    }\n  ]\n}\n```\n#### 2. StsToken Mode (Temporary Credentials)\nFor short-lived access (tokens expire in 1-12 hours).\n```bash\naliyun configure set \\\n  --mode StsToken \\\n  --access-key-id LTAI5tXXXXXXXX \\\n  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \\\n  --sts-token v1.0:XXXXXXXXXXXXXXXX \\\n  --region cn-hangzhou\n```\nUse cases: CI/CD pipelines, temporary access for external contractors, cross-account access.\n#### 3. RamRoleArn Mode (Assume RAM Role)\nAssume a RAM role for elevated or cross-account access.\n```bash\naliyun configure set \\\n  --mode RamRoleArn \\\n  --access-key-id LTAI5tXXXXXXXX \\\n  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \\\n  --ram-role-arn acs:ram::123456789012:role/AdminRole \\\n  --role-session-name my-session \\\n  --region cn-hangzhou\n```\nUse cases: cross-account resource access, temporary elevated privileges, role-based access control.\n#### 4. EcsRamRole Mode (ECS Instance RAM Role)\nUse the RAM role attached to an ECS instance — no credentials needed.\n```bash\naliyun configure set \\\n  --mode EcsRamRole \\\n  --ram-role-name MyEcsRole \\\n  --region cn-hangzhou\n```\nRequirements: must be running on an ECS instance with a RAM role attached.\nUse cases: scripts and automation running on ECS instances.\n#### 5. RsaKeyPair Mode (RSA Key Pair)\nUse RSA key pair for authentication (generate key pair in Aliyun Console first).\n```bash\naliyun configure set \\\n  --mode RsaKeyPair \\\n  --private-key /path/to/private-key.pem \\\n  --key-pair-name my-key-pair \\\n  --region cn-hangzhou\n```\n#### 6. RamRoleArnWithEcs Mode (ECS + RAM Role)\nCombine ECS instance role with RAM role assumption for cross-account access from ECS.\n```bash\naliyun configure set \\\n  --mode RamRoleArnWithEcs \\\n  --ram-role-name MyEcsRole \\\n  --ram-role-arn acs:ram::123456789012:role/TargetRole \\\n  --role-session-name my-session \\\n  --region cn-hangzhou\n```\n### Environment Variables\n**Highest priority** - overrides config file\n**Access Key Mode**\n```bash\nexport ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id\nexport ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret\nexport ALIBABA_CLOUD_REGION_ID=cn-hangzhou\n```\n**STS Token Mode**\n```bash\nexport ALIBABA_CLOUD_ACCESS_KEY_ID=your_access_key_id\nexport ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_access_key_secret\nexport ALIBABA_CLOUD_SECURITY_TOKEN=your_sts_token\nexport ALIBABA_CLOUD_REGION_ID=cn-hangzhou\n```\n**ECS RAM Role Mode**\n```bash\nexport ALIBABA_CLOUD_ECS_METADATA=role_name\n```\n**Use Case**:\n- CI/CD pipelines\n- Docker containers\n- Temporary credential override\n### Managing Multiple Profiles\n**Create Named Profiles**\n```bash\naliyun configure set --profile projectA \\\n  --mode AK \\\n  --access-key-id LTAI5tAAAAAAAA \\\n  --access-key-secret 8dAAAAAAAAAAAAAAAAAAAAAAAA \\\n  --region cn-hangzhou\naliyun configure set --profile projectB \\\n  --mode AK \\\n  --access-key-id LTAI5tBBBBBBBB \\\n  --access-key-secret 8dBBBBBBBBBBBBBBBBBBBBBBBB \\\n  --region cn-shanghai\n```\n**Use Specific Profile**\n```bash\naliyun ecs describe-instances --profile projectA\nexport ALIBABA_CLOUD_PROFILE=projectA\naliyun ecs describe-instances   # Uses projectA\n```\n**List and Switch Profiles**\n```bash\naliyun configure list                      # List all profiles\naliyun configure set --current projectA    # Switch default profile\n```\n### Credential Priority\nCredentials are loaded in this order (first found wins):\n1. **Command-line flag**: `--profile <name>`\n2. **Environment variable**: `ALIBABA_CLOUD_PROFILE`\n3. **Environment credentials**: `ALIBABA_CLOUD_ACCESS_KEY_ID`, etc.\n4. **Configuration file**: `~/.aliyun/config.json` (current profile)\n5. **ECS Instance RAM Role**: If running on ECS with attached role\n## Verification\n### Test Authentication\n```bash\n# Basic test - list regions\naliyun ecs describe-regions\n# Expected output: JSON array of regions\n```\n**If successful**, you'll see:\n```json\n{\n  \"Regions\": {\n    \"Region\": [\n      {\n        \"RegionId\": \"cn-hangzhou\",\n        \"RegionEndpoint\": \"ecs.cn-hangzhou.aliyuncs.com\",\n        \"LocalName\": \"China East 1 (Hangzhou)\"\n      },\n      ...\n    ]\n  },\n  \"RequestId\": \"...\"\n}\n```\n**If failed**, you'll see error messages:\n- `InvalidAccessKeyId.NotFound` - Wrong Access Key ID\n- `SignatureDoesNotMatch` - Wrong Access Key Secret\n- `InvalidSecurityToken.Expired` - STS token expired (for StsToken mode)\n- `Forbidden.RAM` - Insufficient permissions\n### Debug Configuration\n```bash\n# Show current configuration\naliyun configure get\n# Test with debug logging\naliyun ecs describe-regions --log-level=debug\n# Check credential provider\naliyun configure get mode\n```\n## Security Best Practices\n### 1. Use RAM Users (Not Root Account)\n- **Don't**: Use Aliyun root account credentials\n- **Do**: Create RAM users with specific permissions\n```bash\n# Create RAM user in console\n# Attach only necessary policies\n# Use RAM user's access keys\n```\n### 2. Principle of Least Privilege\nGrant only the minimum permissions needed:\n```bash\n# Example: Read-only ECS access\n# Attach policy: AliyunECSReadOnlyAccess\n```\n### 3. Rotate Access Keys Regularly\n```bash\n# Create new access key in RAM Console, then update configuration\naliyun configure set --access-key-id NEW_KEY --access-key-secret NEW_SECRET\n# Delete old access key from console\n```\n### 4. Use STS Tokens for Temporary Access\n```bash\naliyun configure set --mode StsToken \\\n  --access-key-id XXXX --access-key-secret XXXX \\\n  --sts-token XXXX --region cn-hangzhou\n```\n### 5. Use ECS RAM Roles When Possible\n```bash\naliyun configure set --mode EcsRamRole --ram-role-name MyRole --region cn-hangzhou\n```\n### 6. Never Commit Credentials\n```bash\n# Add to .gitignore\necho \"~/.aliyun/config.json\" >> .gitignore\n# Use environment variables in CI/CD instead\n```\n### 7. Secure Config File\n```bash\n# Restrict permissions\nchmod 600 ~/.aliyun/config.json\n```\n## Troubleshooting\n### Issue: Command Not Found\n```bash\n# Check installation\nwhich aliyun\n# Check PATH\necho $PATH\n# Reinstall or add to PATH\n```\n### Issue: Authentication Failed\n```bash\n# Verify configuration\naliyun configure get\n# Test with debug\naliyun ecs describe-regions --log-level=debug\n# Check credentials in console\n# Verify access key is active\n```\n### Issue: Permission Denied\n```bash\n# Error: Forbidden.RAM\n# Check RAM user permissions\n# Attach necessary policies in RAM console\n# Example: AliyunECSFullAccess for ECS operations\n```\n### Issue: STS Token Expired\n```bash\n# Error: InvalidSecurityToken.Expired\n# Reconfigure with new token\naliyun configure set --mode StsToken \\\n  --access-key-id XXXX --access-key-secret XXXX \\\n  --sts-token NEW_TOKEN --region cn-hangzhou\n```\n### Issue: Wrong Region\n```bash\n# Some resources may not exist in the specified region\n# Check available regions\naliyun ecs describe-regions\n# Update default region\naliyun configure set region cn-shanghai\n```\n## Advanced Configuration\n### Custom Endpoint\n```bash\n# Use custom or private endpoint\nexport ALIBABA_CLOUD_ECS_ENDPOINT=ecs-vpc.cn-hangzhou.aliyuncs.com\n```\n### Proxy Settings\n```bash\n# HTTP proxy\nexport HTTP_PROXY=http://proxy.example.com:8080\nexport HTTPS_PROXY=http://proxy.example.com:8080\n# No proxy for specific domains\nexport NO_PROXY=localhost,127.0.0.1,.aliyuncs.com\n```\n### Timeout Settings\n```bash\n# Connection timeout (default: 10s)\nexport ALIBABA_CLOUD_CONNECT_TIMEOUT=30\n# Read timeout (default: 10s)\nexport ALIBABA_CLOUD_READ_TIMEOUT=30\n```\n## Next Steps\nAfter installation and configuration:\n1. **Install plugins** for services you need (v3.3.1+ supports all published product plugins):\n   ```bash\n   aliyun plugin install --names ecs vpc rds\n   # List all available plugins\n   aliyun plugin list-remote\n   ```\n2. **Explore commands**:\n   ```bash\n   aliyun ecs --help\n   aliyun fc --help\n   ```\n3. **Read documentation**:\n    - [Command Syntax Guide](./command-syntax.md)\n    - [Global Flags Reference](./global-flags.md)\n    - [Common Scenarios](./common-scenarios.md)\n## References\n- Official Documentation: https://help.aliyun.com/zh/cli/\n- RAM Console: https://ram.console.aliyun.com/\n- Access Key Management: https://ram.console.aliyun.com/manage/ak\n- Plugin Repository: https://github.com/aliyun/aliyun-cli\n\nFile v0.0.1:references/ram-policies.md\n\n# RAM 权限声明\n\n本 Skill 需要以下阿里云 RAM 权限才能正常运行。\n\n## 所需权限清单\n\n| 产品   | Action                | 说明                                    |\n|------|-----------------------|---------------------------------------|\n| modelstudio | `modelstudio:ListWorkspaces` | 查询工作空间列表                              |\n| oss  | `ossutil:ls`          | List buckets or objects               |\n| oss  | `ossutil:cp`          | Upload, Download or Copy Objects      |\n| oss  | `ossutil:presign`     | Generate a pre-signed URL for object  |\n\n## 权限详情\n\n### modelstudio:ListWorkspaces\n\n用于查询可用的 ModelStudio 工作空间列表。\n\n\n## 授权方式\n\n### 方式一：使用系统策略（推荐）\n\n1. 访问 [阿里云 RAM 访问控制](https://ram.console.aliyun.com/users)\n2. 选择对应的 RAM 用户\n3. 点击「新增授权」按钮\n4. 在权限策略中搜索并选择以下系统策略：\n   - `AliyunBailianFullAccess`（包含 bailian 相关权限）\n   - `AliyunModelStudioReadOnlyAccess`（包含 modelstudio 相关权限）\n   - `AliyunQuanMiaoLightAppFullAccess`（包含 quanmiao 相关权限）\n   - `AliyunOSSFullAccess`（包含 oss 相关权限，可按需授予指定bucket的读写权限）\n5. 确认新增授权\n\n\n## 注意事项\n\n- 授权后权限生效可能存在 30 秒左右的延迟\n- 如遇到 `403` 或 `Index.NoWorkspacePermissions` 错误，请检查：\n  1. RAM 用户是否已授予上述权限\n  2. 百炼控制台中是否已为该用户授予工作空间权限\n\nFile v0.0.1:references/related-commands.md\n\n# Related Commands: alibabacloud-bailian-videoanalysis\n\n## Available Python Scripts\n\nAll scripts are located in the `scripts/` directory:\n\n| Script | Purpose | Required Parameters | Optional Parameters |\n|--------|---------|--------------------|--------------------|\n| `check_env.py` | Check environment configuration (packages + credentials) | None | None |\n| `list_workspace.py` | Query available Bailian workspaces | None | None |\n| `quanmiao_upload_file_to_oss_and_get_file_url.py` | Upload file to OSS and get temporary URL | `--localFilePath` | `--ossBucket`, `--ossObjectKey`, `--expireSeconds` |\n| `quanmiao_submit_videoAnalysis_task.py` | Submit video analysis task to Bailian | `--workspace_id`, `--file_url` | None |\n| `quanmiao_get_videoAnalysis_task_result.py` | Get video analysis task result | `--workspace_id`, `--task_id` | None |\n\n## Aliyun CLI Commands\n\n| Command | Purpose |\n|---------|---------|\n| `aliyun version` | Verify CLI version (>= 3.3.1) |\n| `aliyun configure list` | Check credential status (NEVER print AK/SK) |\n| `aliyun configure set --auto-plugin-install true` | Enable automatic plugin installation |\n| `aliyun oss rm oss://<bucket>/<key> --user-agent AlibabaCloud-Agent-Skills` | Delete uploaded OSS object (cleanup) |\n\n## Execution Order\n\n```\n1. check_env.py\n       ↓\n2. list_workspace.py\n       ↓\n3. quanmiao_upload_file_to_oss_and_get_file_url.py\n       ↓\n4. quanmiao_submit_videoAnalysis_task.py\n       ↓\n5. quanmiao_get_videoAnalysis_task_result.py  (poll loop)\n       ↓\n6. Summarize (no script call, use Step 5 result directly)\n```\n\nFile v0.0.1:references/verification-method.md\n\n# Verification Method: alibabacloud-bailian-videoanalysis\n\nStep-by-step verification commands to confirm successful execution at each workflow stage.\n\n---\n\n## Step 1: Environment Check Verification\n\n**Command:**\n```bash\npython scripts/check_env.py\n```\n\n**Expected Output (Success):**\n```json\n{\n  \"pythonPackagesInstalled\": {\n    \"alibabacloud-bailian20231229\": true,\n    \"alibabacloud-quanmiaolightapp20240801\": true,\n    \"alibabacloud-openapi-util\": true,\n    \"alibabacloud-credentials\": true,\n    \"alibabacloud-tea-openapi\": true,\n    \"alibabacloud-tea-util\": true\n  },\n  \"allPythonPackagesInstalled\": true,\n  \"credentialsConfigured\": true,\n  \"ready\": true,\n  \"errors\": []\n}\n```\n\n**Verification Criteria:**\n- `ready` field is `true`\n- `allPythonPackagesInstalled` field is `true`\n- `credentialsConfigured` field is `true`\n- `errors` array is empty\n\n**Failure Actions:**\n- If `allPythonPackagesInstalled` is `false` → Run `pip install -r scripts/requirements.txt`\n- If `credentialsConfigured` is `false` → Guide user to run `aliyun configure` outside session\n\n---\n\n## Step 2: Workspace Listing Verification\n\n**Command:**\n```bash\npython scripts/list_workspace.py\n```\n\n**Expected Output (Success):**\n```json\n{\n  \"workspaces\": [\n    { \"workspace_id\": \"llm-xxx\", \"name\": \"Default Workspace\" }\n  ]\n}\n```\n\n**Verification Criteria:**\n- `workspaces` array is non-empty\n- Each workspace has `workspace_id` and `name` fields\n- `workspace_id` starts with `llm-` prefix\n\n**Failure Actions:**\n- If `workspaces` is empty → User may not have activated Bailian service; guide to [Bailian console](https://bailian.console.aliyun.com/cn-beijing#/app/app-market/quanmiao/video-comprehend)\n- If error contains `No workspace permissions` → Check RAM permissions and Bailian workspace authorization\n\n---\n\n## Step 3: OSS Upload Verification\n\n**Command:**\n```bash\npython scripts/quanmiao_upload_file_to_oss_and_get_file_url.py --localFilePath <localFilePath>\n```\n\n**Expected Output (Success):**\n```json\n{\n  \"status\": \"success\",\n  \"ossBucket\": \"my-bucket\",\n  \"ossObjectKey\": \"temp/quanmiao/20260409/video.mp4\",\n  \"tempUrl\": \"https://xxx.oss-cn-beijing.aliyuncs.com/...?Signature=xxx\",\n  \"expireSeconds\": 7200\n}\n```\n\n**Verification Criteria:**\n- `status` field equals `\"success\"`\n- `tempUrl` is a valid HTTPS URL containing OSS domain and signature\n- `ossBucket` and `ossObjectKey` are non-empty strings\n\n**Failure Actions:**\n- If upload fails with permission error → Follow Permission Failure Handling in RAM Policy section\n- If file not found → Verify `localFilePath` points to an existing file\n\n---\n\n## Step 4: Task Submission Verification\n\n**Command:**\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id <workspace_id> --file_url <tempUrl>\n```\n\n**Expected Output (Success):**\n```json\n{\n  \"task_id\": \"xxxx\"\n}\n```\n\n**Verification Criteria:**\n- Response contains a non-empty `task_id` field\n- No error code or message in response\n\n**Failure Actions:**\n- If `task_id` is missing → Check that `workspace_id` exists and `file_url` is valid and not expired\n- If permission error → Follow Permission Failure Handling in RAM Policy section\n\n---\n\n## Step 5: Task Result Polling Verification\n\n**Command:**\n```bash\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id <workspace_id> --task_id <task_id>\n```\n\n**Expected Output (SUCCESSED):**\n```json\n{\n  \"header\": {\n    \"taskId\": \"...\",\n    \"event\": \"task-finished\",\n    \"sessionId\": \"...\",\n    \"eventInfo\": \"完成视频理解\"\n  },\n  \"payload\": {\n    \"output\": {\n      \"videoTitleGenerateResult\": { \"text\": \"...\" },\n      \"videoCaptionResult\": { \"videoCaptions\": [...] },\n      \"videoAnalysisResult\": { \"text\": \"...\" },\n      \"videoGenerateResults\": [{ \"text\": \"...\" }],\n      \"videoMindMappingGenerateResult\": { \"text\": \"...\", \"videoMindMappings\": [...] },\n      \"videoCalculatorResult\": { \"items\": [...] }\n    },\n    \"usage\": {\n      \"inputTokens\": N,\n      \"outputTokens\": N,\n      \"totalTokens\": N\n    }\n  },\n  \"requestId\": \"...\"\n}\n```\n\n**Verification Criteria:**\n- `header.event` equals `\"task-finished\"`\n- `payload.output` contains all expected result fields\n- `payload.usage` contains token counts\n\n**Status Handling:**\n| Status | Action |\n|--------|--------|\n| `PENDING` | Wait 10-15s, retry |\n| `RUNNING` | Display partial results, wait 10-15s, retry |\n| `SUCCESSED` | Proceed to Step 6 |\n| `FAILED` | Check error message, inform user |\n| `CANCELED` | Inform user task was canceled |\n\n**Maximum retries:** 180 (approximately 30 minutes)\n\n---\n\n## Step 6: Summary Verification\n\n**Verification Criteria:**\n- Summary uses data from Step 5 result directly (no additional API calls)\n- Output includes all sections: title, outline, overview, captions, shot analysis, timeline, summary, token usage\n- Token usage numbers match `payload.usage` from Step 5 result\n\nFile v0.0.1:scripts/requirements.txt\n\nalibabacloud-bailian20231229==2.8.4\nalibabacloud-openapi-util==0.2.4\nalibabacloud-credentials==1.0.8\nalibabacloud-tea-util==0.3.14\nalibabacloud-tea-openapi==0.4.4\nalibabacloud-quanmiaolightapp20240801==2.13.8","readmeExcerpt":"Skill: Alibabacloud Bailian Videoanalysis Owner: sdk-team Summary: Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Produ... Tags: latest:0.0.2 Version history: v0.0.2 | 2026-04-22T11:03:07.119Z | auto alibabacloud-bailian-videoanalysis v0.0.2 - Updated to use the Bailian (QuanMiaoLightApp) API product (version 2024","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m pip install -r scripts/requirements.txt\n# On some systems, use pyhon3 instead of python"},{"language":"bash","snippet":"> # Enable AI-Mode (required before using CLI commands)\n> aliyun configure ai-mode enable\n>\n> # Set User-Agent for tracking (required)\n> aliyun configure ai-mode set-user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n>\n> # Update plugins to latest versions (recommended)\n> aliyun plugin update\n>"},{"language":"bash","snippet":"> aliyun configure ai-mode disable\n>"},{"language":"bash","snippet":"> aliyun configure list\n>"},{"language":"bash","snippet":"aliyun modelstudio list-workspaces --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis"},{"language":"bash","snippet":"aliyun ossutil ls --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: alibabacloud-bailian-videoanalysis\ndescription: |\n  Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API.\n  **Required API Product**: QuanMiaoLightApp (version 2024-08-01)\n  **Required API Actions**: SubmitVideoAnalysisTask, GetVideoAnalysisTask\n  **DO NOT use**: videorecog, Mts, or any other product for video analysis\n  Triggers: \"analyze video\", \"understand video\", \"analyze the local video /temp/xxx.mp4\", \"analyze the local video https://xxx.com/temp/xxx.mp4\", \"what is this video about\", \"summarize this video\", \"split video into shots\", \"video comprehension\", \"extract video insights\", \"transcribe video\", \"extract video captions\", \"generate video title\", \"generate video outline\", \"video mindmap\".\n---\n\n# Bailian Video Analysis\n\nThis skill provides video analysis functionality based on Alibaba Cloud Bailian Video Analysis Light Application. It uses the Bailian (QuanMiaoLightApp) API for intelligent video comprehension, including shot analysis, ASR transcription, title generation, caption extraction, and mind mapping.\n\n**Architecture:** `CLI (Credential Chain) + OSS (File Storage) + Bailian Workspace + Quanmiao Video Analysis Service + Python SDK Scripts`\n\n---\n\n## Output Language Policy\n\n**Detection Priority:** User input language → Environment language → **Default: Chinese (中文)**\n\n**Apply to:** All user-facing messages, summaries, error explanations, and interactive prompts.\n\n**Keep original language:** Code snippets, API responses, file paths, technical identifiers, HTTP status codes.\n\n---\n\n## Installation\n\n### 1. Python Dependencies\n\n```bash\npython -m pip install -r scripts/requirements.txt\n# On some systems, use pyhon3 instead of python\n```\n\n### 2. Alibaba Cloud CLI\n\n> **Pre-check: Aliyun CLI >= 3.3.1 required**\n> Run `aliyun version` to verify >= 3.3.1. If not installed or version too low,\n> see `references/cli-installation-guide.md` for installation instructions.\n> Then **[MUST]** run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation.\n\n> **AI-Mode Configuration for aliyun CLI**\n>\n> When using the aliyun CLI in this skill, you MUST configure AI-Mode settings:\n>\n> ```bash\n> # Enable AI-Mode (required before using CLI commands)\n> aliyun configure ai-mode enable\n>\n> # Set User-Agent for tracking (required)\n> aliyun configure ai-mode set-user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n>\n> # Update plugins to latest versions (recommended)\n> aliyun plugin update\n> ```\n>\n> **Note:** After completing your tasks, you can disable AI-Mode:\n> ```bash\n> aliyun configure ai-mode disable\n> ```\n\n### 3. Important Prerequisite: Activate Bailian and Video Analysis Service\n\n**Before using this skill, you must first activate the Video Analysis service in the Alibaba Cloud Bailian console!**\n\n1. Visit [Bailian Video_Analysis page](https://bailian.console.aliyun.com/cn-beijing#/app/app-market/quanmiao/video-comp"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn74p5w8ywv6prh40g0s82gmqh83nw54\",\n  \"slug\": \"alibabacloud-bailian-videoanalysis\",\n  \"version\": \"0.0.2\",\n  \"publishedAt\": 1776855787119\n}"},{"path":"references/acceptance-criteria.md","content":"# Acceptance Criteria: alibabacloud-bailian-videoanalysis\n\n**Scenario**: Alibaba Cloud Bailian (Quanmiao) Video Analysis\n**Purpose**: Skill testing acceptance criteria\n\n---\n\n# Correct Python Script Usage Patterns\n\n## 1. Environment Check\n\n#### ✅ CORRECT\n```bash\npython scripts/check_env.py\n```\n- Returns JSON with `ready: true/false`\n- Checks Python packages and credentials via default credential chain\n- Does NOT read or print AK/SK values\n\n#### ❌ INCORRECT\n```bash\necho $ALIBABA_CLOUD_ACCESS_KEY_ID   # NEVER print credentials\npython scripts/check_env.py --ak xxx --sk xxx   # NEVER pass AK/SK as arguments\n```\n- Credentials are checked via the default credential chain only\n- The script uses `CredentialClient` internally; no manual credential passing\n\n## 2. Workspace Listing\n\n#### ✅ CORRECT\n```bash\naliyun modelstudio list-workspaces --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n```\n- Returns JSON array of available workspaces\n- Auto-detects workspace_id; does NOT require user to know it in advance\n- Uses `--user-agent` parameter for tracking\n\n#### ❌ INCORRECT\n```bash\naliyun modelstudio list-workspaces   # Missing --user-agent parameter\n```\n\n## 3. File Upload to OSS\n\n#### ✅ CORRECT\n```bash\n# List buckets first\naliyun ossutil ls --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis\n\n# Upload file\naliyun ossutil cp /path/to/video.mp4 oss://my-bucket/temp/quanmiao/20260409/video.mp4 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region cn-beijing\n\n# Generate temporary URL\naliyun ossutil sign oss://my-bucket/temp/quanmiao/20260409/video.mp4 --expires-duration 7200 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-bailian-videoanalysis --region cn-beijing\n```\n- Uses auto-detected bucket and generated object key by default\n- All commands include `--user-agent` parameter\n- Optionally specifies custom `--expires-duration` (default 7200s)\n\n#### ❌ INCORRECT\n```bash\naliyun ossutil cp /path/to/video.mp4 oss://my-bucket/key   # Missing --user-agent and --region\naliyun ossutil sign oss://my-bucket/key   # Missing required parameters\n```\n\n## 4. Submit Video Analysis Task\n\n#### ✅ CORRECT\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id llm-xxx --file_url \"https://...\"\n```\n- workspace_id must come from Step 2\n- file_url must come from Step 3 (upload script output tempUrl)\n\n#### ❌ INCORRECT\n```bash\npython scripts/quanmiao_submit_videoAnalysis_task.py --workspace_id fake-id --file_url \"invalid-url\"   # Invalid workspace_id or URL\npython scripts/quanmiao_submit_videoAnalysis_task.py   # Missing required parameters\n```\n- Both `--workspace_id` and `--file_url` are required\n- file_url must be a valid temporary OSS URL\n\n## 5. Get Task Result\n\n#### ✅ CORRECT\n```bash\npython scripts/quanmiao_get_videoAnalysis_task_result.py --workspace_id llm-xxx --task_id abc123\n```\n- Poll every 10-15 seconds until status is `SUCCESSED` or `FAILED`\n- Handle `RUNNING` status by displaying pa"},{"path":"references/cli-installation-guide.md","content":"# Aliyun CLI Installation & Configuration Guide\nComplete guide for installing and configuring Aliyun CLI.\n\n## Table of Contents\n- [Installation](#installation)\n    - [macOS](#macos)\n    - [Linux](#linux)\n    - [Windows](#windows)\n- [Configuration](#configuration)\n    - [Quick Start](#quick-start)\n    - [Configuration Modes](#configuration-modes)\n    - [Environment Variables](#environment-variables)\n    - [Managing Multiple Profiles](#managing-multiple-profiles)\n    - [Credential Priority](#credential-priority)\n- [Verification](#verification)\n- [Security Best Practices](#security-best-practices)\n- [Troubleshooting](#troubleshooting)\n- [Advanced Configuration](#advanced-configuration)\n- [Next Steps](#next-steps)\n- [References](#references)\n> **Aliyun CLI 3.3.1+**: Supports installing and using all published Alibaba Cloud product plugins. Make sure to upgrade to 3.3.1 or later for full plugin ecosystem coverage.\n>\n> **[IMPORTANT]** After installation, run the following command to enable automatic plugin installation:\n> ```bash\n> aliyun configure set --auto-plugin-install true\n> ```\n## Installation\n### macOS\n**Using Homebrew (Recommended)**\n```bash\nbrew install aliyun-cli\n# Upgrade to latest\nbrew upgrade aliyun-cli\n# Verify version (>= 3.3.1)\naliyun version\n```\n**Using Binary**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-amd64.tgz\n# Extract\ntar -xzf aliyun-cli-macosx-latest-amd64.tgz\n# Move to PATH\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n### Linux\n**Debian/Ubuntu**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-amd64.tgz\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n**CentOS/RHEL**\n```bash\n# Download\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-amd64.tgz\nsudo mv aliyun /usr/local/bin/\n# Verify\naliyun version\n```\n**ARM64 Architecture**\n```bash\n# Download ARM64 version\nwget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz\n# Extract and install\ntar -xzf aliyun-cli-linux-latest-arm64.tgz\nsudo mv aliyun /usr/local/bin/\n```\n### Windows\n**Using Binary**\n1. Download from: https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip\n2. Extract the ZIP file\n3. Add the directory to your PATH environment variable\n4. Open new Command Prompt or PowerShell\n5. Verify: `aliyun version`\n   **Using PowerShell**\n```powershell\n# Download\nInvoke-WebRequest -Uri \"https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip\" -OutFile \"aliyun-cli.zip\"\n# Extract\nExpand-Archive -Path aliyun-cli.zip -DestinationPath C:\\aliyun-cli\n# Add to PATH (requires admin privileges)\n$env:Path += \";C:\\aliyun-cli\"\n[Environment]::SetEnvironmentVariable(\"Path\", $env:Path, [System.EnvironmentVariableTarget]::Machine)\n# Verify\naliyun version\n```\n## Configuration\n### Quick Start\n```bash\naliyun configure set \\\n  --mode AK \\\n  --access-key-id"},{"path":"references/ram-policies.md","content":"# RAM Permissions\n\nThis Skill requires the following Alibaba Cloud RAM permissions to function properly.\n\n## Required Permissions\n\n| Product          | Action                                     | Description                          |\n|------------------|--------------------------------------------|--------------------------------------|\n| ModelStudio      | `modelstudio:ListWorkspaces`               | List Bailian workspaces              |\n| OSS              | `ossutil:ls`                               | List buckets or objects              |\n| OSS              | `ossutil:cp`                               | Upload, Download or Copy Objects     |\n| OSS              | `ossutil:presign`                          | Generate a pre-signed URL for object |\n| QuanMiaoLightApp | `quanmiaolightapp:SubmitVideoAnalysisTask` | Submit video analysis task           |\n| QuanMiaoLightApp | `quanmiaolightapp:GetVideoAnalysisTask`    | Get video analysis task results      |\n\n## Permission Details\n\n### modelstudio:ListWorkspaces\n\nUsed to query the list of available Bailian workspaces.\n\n### ossutil:ls, ossutil:cp, ossutil:presign\n\nUsed to manage OSS buckets and objects, including listing buckets/objects, uploading/downloading files, and generating temporary access URLs.\n\n### quanmiaolightapp:SubmitVideoAnalysisTask\n\nUsed to submit video analysis tasks to Bailian service.\n\n### quanmiaolightapp:GetVideoAnalysisTask\nUsed to query video analysis task results.\n\n## Authorization Methods\n\n### Use System Policies (Recommended)\n\n1. Visit [Alibaba Cloud RAM Console](https://ram.console.aliyun.com/users)\n2. Select the target RAM user\n3. Click \"Add Permissions\" button\n4. Search and select the following system policies:\n   - `AliyunBailianFullAccess` (includes Bailian-related permissions)\n   - `AliyunModelStudioReadOnlyAccess` (includes ModelStudio-related permissions)\n   - `AliyunQuanMiaoLightAppFullAccess` (includes QuanMiao-related permissions)\n   - `AliyunOSSFullAccess` (includes OSS-related permissions, can be restricted to specific buckets)\n5. Confirm and add permissions\n\n\n## Notes\n\n- There may be a delay of approximately 30 seconds after authorization before permissions take effect\n- If you encounter `403` or `Index.NoWorkspacePermissions` errors, please check:\n  1. Whether the RAM user has been granted the above permissions\n  2. Whether workspace permissions have been granted to the user in the Bailian console\n\n---\n\n## Permission Failure Handling\n\nWhen any command or API call fails due to permission errors at any point during execution, follow this process:\n\n1. **Read this file** (`references/ram-policies.md`) to get the full list of permissions required by this SKILL\n2. **Use `ram-permission-diagnose` skill** to guide the user through requesting the necessary permissions\n3. **Pause and wait** until the user confirms that the required permissions have been granted\n4. **Retry the failed operation** after permissions are confirmed\n\n**Important:** Never proceed with operati"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Produ... Skill: Alibabacloud Bailian Videoanalysis Owner: sdk-team Summary: Alibaba Cloud Bailian Video Analysis Skill. Use for intelligent video comprehension and analysis via the Bailian (QuanMiaoLightApp) API. **Required API Produ... Tags: latest:0.0.2 Version history: v0.0.2 | 2026-04-22T11:03:07.119Z | auto alibabacloud-bailian-videoanalysis v0.0.2 - Updated to use the Bailian (QuanMiaoLightApp) API product (version 2024","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1514,"uniquenessScore":46,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T17:14:01.018Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T17:14:01.018Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T20:59:24.296Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}