阿里云 CLI 分发的 CloudMonitor (CMS) 入口技能。当用户提及 aliyun cms2、CloudMonitor、CMS 命令或任何 CMS 模块操作时使用。
aliyun cms2#Once per session: perform this prerequisite check only on the first invocation of this skill in a conversation. If all checks already passed earlier in the same session, skip directly to the relevant module.
Check aliyun exists — which aliyun (macOS/Linux) or where aliyun (Windows).
Check CLI version — run aliyun version. Minimum required: 3.3.15 (see compatibility in frontmatter).
⚠️ Compare version segments as integers (semver): 3.3.4 < 3.3.15 because 4 < 15. Shell verification:
printf '%s\n' "3.3.15" "$(aliyun version)" | sort -V | head -1If the output equals the current version, the requirement is NOT met.
Run aliyun upgrade --help to test whether the upgrade subcommand exists.
aliyun upgrade -y to update to the latest version automatically, then re-check aliyun version.If upgrade not available → ask the user to upgrade manually following the official guide: https://help.aliyun.com/zh/cli/update-cli. Wait for the user to confirm the upgrade is complete, then re-check aliyun version.
If upgrade succeeded → go to step 3.
If upgrade failed → ask the user to upgrade manually: https://help.aliyun.com/zh/cli/update-cli. Stop and exit.
Check cms2 plugin — run aliyun cms2 --help.
unknown command / missing → stop immediately, output the error report below (append CLI version, OS, and error message), and make no further CLI calls.aliyun cms2 reuses the aliyun CLI credential system ( aliyun configure).
Use --profile <name> to switch profiles.
Upon loading this skill, generate a random session ID (32-char lowercase hex string) once per session...
For every aliyun cms2 command, append: --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-cms-manage/{session-id}"
Local utility commands (e.g. version, configure, plugin, --help) do not support this flag and are excluded.
Hard constraint: fallback to aliyun cms, other API versions, or any workaround is strictly prohibited.
Run
aliyun cms2 <command> [subcommand] --helpbefore first use of a subcommand in a session to get the full flag list and examples. Once the help for the same subcommand has been read in the current session and the command shape has not changed, reuse that knowledge instead of repeating the help call. A named subcommand's--help/--show-schema/--show-example-bodyis the authority for that command's flags, body envelope, response fields, and environment behaviour — do not search other skill files for a copy of those fields.
-o text (default) to reduce token consumption for list/get; use -o json only when the output is parsed field by field rather than read.values: expand each field's fieldPath into nested JSON as specified in Addon Values Defaults. Do not write a dotted fieldPath as one literal key. How to pick --env-type, where child fields sit on create vs update, and when a subset is (or is not) a valid body, are in that section.create, update, delete, and single-resource get/detail commands MUST include the --region parameter so the request is routed to the correct backend OpenAPI endpoint. Omitting --region on these commands may cause routing failures or operate against an unintended region, and the error can name something else entirely — integration policy create returns status 400: The workspace can not be created even when the workspace exists and the body is valid. This does not apply to list/query commands that intentionally span multiple regions (e.g. entity query --source CloudResource all-region queries). Requiring the flag is not permission to choose its value — resolve it per Region Confirmation Gate.(续)... continuation, and never drop the ones that do not fit — a split turns one choice into two answers that can conflict or be left incomplete, and a truncated list hides valid choices entirely. When the structured input form cannot render every option, ask as plain text and spell out every option with its explanation in the question body. A mutually exclusive choice stays single-select; only a genuinely multi-valued one (several regions) is multi-select. A prompt may carry several distinct choices, each its own question. Put any recommended value directly in the option label (for example (Recommended)); recommendations are advisory only and do not permit cloud-side writes unless another rule permits defaulting or the user confirms.create, update, delete, patch, start, stop, etc.), show a concise confirmation summary and the exact command, ask whether the user confirms execution, and wait for a clear affirmative answer. The summary must include the operation, target resource identifiers, expected impact, and notable risks or irreversible effects when applicable. Do not require an exact phrase or long confirmation text; a clear affirmative answer such as "yes", "confirm", "proceed", or "确认" is sufficient approval. Skip confirmation only for dry-run, preview-only, or read-equivalent creates with no cloud-side impact; if uncertain, require confirmation.region/ regionId, workspace, policy, resourceGroup, tag, resource scope, addon/ addonName, resource type, cloud product/service name, onboarding configuration options, etc.), ask the user for a clear answer before proceeding. Never fabricate, guess, infer from defaults/history, or arbitrarily choose one value. A module-specific reference may define narrow exceptions — for the integration module they are listed in references/integration-common.md. Changing an existing addon release's settings is an unrehearsable write: follow Addon Release Config Update.workspace list, entity query, policy list, sts get-caller-identity, etc.) only builds the candidate set you present, and its output never becomes the user's answer — not when it returns a single candidate, not when a naming convention makes the value derivable, and not when an earlier turn of the session used one. "Reliably determined" means the user's own words or the resource they named pinned the value, not that the query happened to be unambiguous.Applies to every module and to every command that takes --region or a region/ regionId body field. Settle the region before the workspace, since workspace verification is region-scoped.
List/query commands omit --region only when a module rule says the call is all-region. Omitting the flag is not all-region: the CLI supplies the profile default. Mutating and detail commands must carry it per Region parameter required.
There are exactly three legitimate sources for the value:
Anything else is a violation, including: a CLI profile / aliyun configure / ALIYUN_REGION default, or an omitted required --region; the cn-hangzhou of docs and examples, or a region only stated in narration; splitting default-cms-{userId}-{regionId} (or any workspace name); passing controlRegionId.
A module may bind --region to the regionId of a resource the user already confirmed (named cluster, workspace that already passed this gate, instance). That is still Source 1 or 2. Module references do not loosen this.
If Source 1 and 2 are absent, present the region as a choice per One choice, one question and stop. Gather candidates with aliyun cms2 meta regions and offer every regionId (never showName or controlRegionId); only consuming that output is wrong. Source 3, when present, is a recommended option only — it routes the call and does not decide scope. Onboarding region scope is collected by Resource Scope Selection Gate; do not ask a second region question here.
controlRegionId is the control-plane region and may differ for dedicated / exclusive locations — never pass it as --region.
Applies to every module and to every command that takes --workspace or a workspace body field. There are exactly three legitimate sources for the value:
workspaceName match; no exact match → report and ask, never substitute a near match.Anything else is a violation: adopting the single row aliyun cms2 workspace list returned, picking the default-cms-{userId}-{regionId} entry because it looks like the account default, assembling that name from aliyun sts get-caller-identity plus a region, or reusing a workspace from an earlier unrelated request in the same session.
So aliyun cms2 workspace list remains the right way to gather candidates — only consuming its output instead of presenting it is wrong. Mark the best candidate (Recommended) inside the option per One choice, one question, then stop and wait.
Module references do not loosen this. Where one gives default-cms-{userId}-{regionId} as the workspace's "default format" or builds it from an account ID and a region, that describes how the account's default workspace is named — it is the candidate to recommend, never permission to skip the question.
list command that supports --next-token, keep querying until no nextToken remains or accumulated count ≥ totalCount. Do not trust the first page as complete when pagination metadata indicates more data.list: when the command accepts --max-results, pass 100 and then paginate to completion. This document wins over --help: do not rely on the omitted-flag default. policy list --help says 30 (max 100) but omitting it can return maxResults: 100; prometheus instance list omitted default is 30. 20 pages × 30 can truncate a large list.nextToken is non-empty or truncated=true; totalCount is the stronger signal.nextToken is present.--search, --query, --policy-name, etc.) or paginate fully.DEADLINE_EXCEEDED, timeout); if it still fails, mark as Unknown/ QueryFailed — do not treat as healthy or unhealthy.Error codes and actions are listed in aliyun cms2 --help. Additional tips:
InvalidJSON usually means malformed --body; validate with jq . <<<'<value>' before passing to the CLI.--body and stdin are mutually exclusive; specify only one — means both --body (or --file) and stdin data were provided. Fix: keep only one input source. In agent/CI environments where stdin may be a pipe, append < /dev/null to the command to ensure stdin is empty.中文(English) on first mention only when it disambiguates, then the Chinese term alone. Before sending, scan for mapped English terms and replace them, except inside code, commands, JSON fields, IDs, or quoted CLI output.Examples (Chinese answers):
接入配置(AddonRelease,CLI 命令为 addon-release)查询接入配置状态:aliyun cms2 integration addon-release list ...all releases are Ready所有接入配置均 ReadyEnglish中文Cloud Monitor / CMS云监控Workspace工作空间Application Monitoring / APM应用监控RUM用户体验监控Synthetic Monitoring / Synthetic云拨测CloudResource云资源EntityStore实体仓库Entity实体Integration Policy / policy接入策略Addon / addon组件Addon Catalog组件目录AddonRelease / addon release / release接入配置Collector采集器Prometheus ViewPrometheus 聚合视图AggTaskGroup聚合任务Delivery Task数据投递任务Alert Rule告警规则Alert Template告警模板Alert History告警历史Notification Channel通知渠道Contact联系人Event Hub事件中心Metric Meta指标元数据ClusterCollector集群采集器NodeCollector节点采集器Cluster probe集群探针Metric drop指标废弃CMS resource tagCMS 资源标签Grafana workspaceGrafana工作区
What You NeedHow to Get ItMetric business metadata (namespaces & product codes via meta namespaces; metric name, type, unit, dimensions via meta metrics)meta namespaces / meta metricsPrometheus labels, values & series inspectionmetric promql labels / label-values / series
Integration-module lookups (resource metadata, onboarding status, policy-scoped Kubernetes resources, Prometheus instance by policy) live in references/integration-common.md.
User Intent KeywordsCommandsModuleonboarding, monitoring addon, policy, integration, addon release, integration resource, Kubernetes resource list, Namespace resources under policy, resources managed by policy, teardown, offboarding — common rules, load for every onboarding operationintegration integration resourcereferences/integration-common.mdcontainer onboarding, ACK/ACS/ASI cluster onboarding, cluster fleet audit, which clusters are not onboardedintegration entity queryreferences/cs-onboarding.md (+ integration-common.md)ECS host onboarding, ECS fleet audit, NodeCollectorintegration entity queryreferences/ecs-onboarding.md (+ integration-common.md)cloud service onboarding, RDS/SLB/ALB/Redis/MongoDB/PolarDB onboarding, cloud resource fleet auditintegration entity queryreferences/cloud-onboarding.md (+ integration-common.md)batch cloud service metric onboarding, batch onboarding, cloud-batch-metricsintegration meta entity queryreferences/batch-onboarding-workflow.md (+ integration-common.md)integration policy diagnosis, health-check, troubleshoot policy, scrape config, ServiceMonitor/PodMonitor/custom collection diagnosis, custom-discover-<id> (a release name — read discoverType before treating it as a custom-job), job targetintegration check-scrape-config integration job-target integration check-collector-target integration resource integration dashboardreferences/integration-diagnosis.mdmetric drop, drop metrics, dropMetrics, 指标废弃, 丢弃指标, 废弃指标, cluster probe metric-agentintegration collector integration addon-releasereferences/integration-management.md (+ integration-common.md)add / change / remove CMS resource tags, 打标签, 修改标签, 删除标签, CMS resource tags, application service (APM/RUM) tagstagreferences/integration-management.md (+ integration-common.md)Prometheus view, Prometheus aggregation view, create Prometheus aggregation view, Prometheus view create, Prometheus aggregation view diagnosis, Prometheus aggregation view health check, sub-instance statusprometheus viewreferences/prometheus-management.mdworkspace, workspace create, workspace get, workspace list, workspace update, workspace deleteworkspace``aliyun cms2 workspace --helpentity, entity query, CloudResource, EntityStore, cloud resource query, entity store query, resource metadata, instance detailsentity query``aliyun cms2 entity --helpPrometheus instance, recordingRule, recording rule, AggTaskGroupprometheus instance prometheus recording-rule``aliyun cms2 prometheus --helpmeta, metric metadata, product code, meta-formatmeta metrics meta namespaces``aliyun cms2 meta --helpmetric, metric query, basic metrics, PromQL, promql query, label values, seriesmetric basic metric promql``aliyun cms2 metric --helpalert, rule, alert rule, alert template, alert history, patch, create rule, manage rulealert rule alert template alert historyreferences/alerting.mdAPM measureCode, group/filter/groupBy, baseUnit/displayUnitalert rule (APM type)references/apm-metrics.mdUModel metricSet, K8s pod metric, entity-based alertalert rule (UModel type)references/umodel-metrics.mdnotification, contact, robot, webhook, notification recipients, dingTalk, bots, lark, weChat worknotification-channel contact notification-channel robot notification-channel webhookreferences/alerting.mdevent, event-hub, alert event, SLS event, incidentevent-hubreferences/event-hub.mdGrafana, Grafana workspace, managed Grafana instance, create/query/update/delete Grafana workspacegrafana workspace``aliyun cms2 grafana workspace --helpGrafana dashboard authoring, dashboard JSON, panel, PromQL panel, dashboard variables, data source placeholdermeta metrics metric promql integration storagereferences/grafana-dashboard-rules.mdAPM, application monitoring, agent install, Java agent, Golang agent, Python agent, Node.js agent, PHP agent, .NET agent, ack-onepilot, OpenTelemetry onboarding, K8s/ACK/ACS container onboarding, ECS host application onboarding, LicenseKey, proprietary agent, instgo, aliyun-bootstrap, probe setup, apm onboardingapm service apm configurationreferences/apm.mdAI observability, Dify, LangChain, LangGraph, DashScope, AgentScope, OpenAI, Coze, OpenClaw, CoPaw, Hermes, LLM monitoring, AI tracing, AI agent monitoring, custom instrumentationapm service apm configuration integration addonreferences/ai.mdRUM, Real User Monitoring, User Experience Monitoring, frontend monitoring, web monitoring, H5, mobile app monitoring, Android crash, iOS crash, JS error, page performance, miniapp monitoring, create RUM app, RUM SDK, pid, serviceId, endpointrum service rum configurationreferences/rum.mdresource group queryresource-group``aliyun cms2 resource-group --help
Commands not listed above — see aliyun cms2 --help.