Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

huawei-cloud-ecs-export-markdown

БесплатноЗапускает вложенные скриптыНе проверен

1. List the Huawei Cloud ECS (Elastic Cloud Server) instances of a tenant region through KooCLI (`hcloud ECS ListServersDetails`, the official read-only GET…

wlc-devот wlc-dev200 установок в других каталогах

Об этом скилле

Huawei Cloud ECS Instance List → Markdown Export

Overview

Query the ECS instance list of a tenant region through KooCLI hcloud ECS ListServersDetails (official read-only GET /v1/{project_id}/cloudservers/detail, verified against both hcloud ECS ListServersDetails --help — Method: GET — and the huaweicloudsdkecs v2 client _list_servers_details_http_info metadata), with a fallback to the official huaweicloudsdkecs v2 SDK, and export the result into a local Markdown report. The skill is aimed at cloud resource inventory, daily operations patrol, and Markdown-report style deliverables.

Architecture:

agent → python3 scripts/list_ecs_export_markdown.py → skill-quality-cli run ─▶ hcloud ECS ListServersDetails --cli-region=<region> --limit=N --offset=O
      → Huawei Cloud ECS OpenAPI (regional endpoint) → parsed JSON servers → export_markdown → .md / table / json

(hcloud binary missing) → fallback: huaweicloudsdkecs v2 EcsClient.list_servers_details
(missing SDK)           → run scripts/ensure_env.py  (auto pip install)

Key properties:

  • Read-only by design — the only API ever invoked is ListServersDetails (GET). A write-intent guard scans the user arguments and validates the operation name; mutating intents (create / delete / update / rebuild / resize / reboot / start / stop / attach / detach ...) are rejected with an explicit message before any command runs. The Markdown file is generated on the local filesystem only — no ECS write happens.
  • CLI first, SDK fallback — KooCLI is the primary execution path (wrapped with skill-quality-cli for telemetry); when the hcloud binary is absent, the script falls back to the official huaweicloudsdkecs v2 SDK (list_servers_details). Credentials are read from the hcloud profile or the SDK environment — never handled by the script.
  • Well-formed Markdown — a fixed header row (名称 / ID / 状态 / 规格 / vCPU / 内存 / 可用区 / 私网IP / 公网IP) plus one data row per instance, with a - fallback for missing fields and an optional summary line (--summary). Pipe and newline characters inside a cell are escaped so the table never breaks. The report is saved via a temporary file + atomic rename, so an interrupted write never leaves a corrupt/partial .md behind.
  • No broken files — an empty instance list, missing credentials or a permission failure print an explicit hint on stdout/stderr and do not produce a .md file.
  • Offline-testable — every code path (paging, filters, output modes, Markdown format, error classification, guard, SDK fallback, quality wrapper) is covered by unit tests that mock the hcloud subprocess.

Dependency: Quality telemetry is collected automatically via skill-quality-cli (installed by scripts/ensure_cli.sh if absent).

Capability boundary: this skill lists instances only. It does not manage instance lifecycle (create/delete/start/stop/reboot/resize/rebuild), does not export flavors/images/keypairs, and does not write the report back to any cloud service. Those require a separate skill and explicit user confirmation.

Prerequisites

  1. Python 3.8+ with the Huawei Cloud SDK — run python3 scripts/ensure_env.py to install huaweicloudsdkcore and huaweicloudsdkecs automatically. The Markdown export itself needs no third-party package. See references/cli-installation-guide.md.
  2. KooCLI (hcloud) installed — the optional primary execution path; see references/cli-installation-guide.md. When absent, the SDK fallback is used.
  3. Credentials configured out-of-band — the CLI reads the active hcloud profile; the SDK fallback reads AK/SK from the whitelisted environment variables (HUAWEI_ACCESS_KEY / HUAWEI_SECRET_KEY, HUAWEICLOUD_SDK_AK / HUAWEICLOUD_SDK_SK, HW_*, ...). Never paste AK/SK into chat; the script never reads, echoes or stores secrets itself.
  4. IAM permission — read-only ecs:servers:list (or the ECSReadOnlyPolicy system policy); least-privilege policy in references/iam-policies.md.
  5. Outbound HTTPS access to ecs.<region>.myhuaweicloud.com.
  6. skill-quality-cli — ensured by bash scripts/ensure_cli.sh (idempotent, skips if present). Upgrade with skill-quality-cli upgrade (no auto-upgrade). Disable telemetry with SKILL_QUALITY_REPORT=0.

Workflow

  1. (Optional) prepare the environment — python3 scripts/ensure_env.py installs any missing SDK dependency.
  2. Confirm the target region (default cn-north-4).
  3. (Optional) confirm KooCLI readiness (read-only) — see the Core Commands block for the wrapped credential check.
  4. Run the script with the desired output mode (--format md for the report, table / json otherwise).
  5. Read the result — for md, the printed path is the generated report;
Полный SKILL.md на ClawHub

Установить huawei-cloud-ecs-export-markdown в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл huawei-cloud-ecs-export-markdown?

1. List the Huawei Cloud ECS (Elastic Cloud Server) instances of a tenant region through KooCLI (`hcloud ECS ListServersDetails`, the official read-only GET /v1/{project_id}/cloudservers/detail), with an automatic fallback to the official huaweicloudsdkecs v2 SDK (EcsClient.list_servers_details) when hcloud is not installed. 2. Export the instance list into a well-formed local Markdown table (headers 名称 / ID / 状态 / 规格 / vCPU / 内存 / 可用区 / 私网IP / 公网IP, missing fields render `-`, optional summary line) — strictly local file generation, nothing is ever written back to the cloud. `--output` sets the path (default `ecs_instances_<region>_<timestamp>.md`); the parent directory is created automatically and the file is written via a temp file + atomic rename. 3. Three output modes: `--format md` (default) / `table` / `json`. Region aware: `--region` (default cn-north-4). Optional `--status` / `--name` server-side filters and `--page-size` (default 100); paging follows the reported `count`. 4. Explicit error classification: missing AK/SK credentials (「缺少 AK/SK 凭证」), hcloud not installed (falls back to SDK, else a clear hint), invalid/insufficient credentials (403 / 401 → IAM hint), KooCLI usage errors, and generic API/network failures. Empty instance lists produce a friendly hint and never a corrupt Markdown file. 5. Built-in write-intent guard: any mutating intent (create / delete / update / reboot / resize / attach / detach / start / stop …) or any operation other than the read-only ListServersDetails is rejected before execution — this skill is strictly read-only. 6. Triggers include: "查询 ECS 生成 Markdown", "ECS 实例列表导出 Markdown", "ecs markdown", "导出 ECS 实例为 Markdown 文件", "ECS 实例报表", "云服务器清单 Markdown", "ECS instance list markdown", "export ECS instances to markdown", "ecs 报表". 7. Offline unit tests (mocked hcloud subprocess) cover output modes, paging, Markdown format correctness, filters, empty lists, error classification, the SDK fallback, the extra-args injection position

Как установить скилл huawei-cloud-ecs-export-markdown?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл huawei-cloud-ecs-export-markdown запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить huawei-cloud-ecs-export-markdown с