← Back to Skills Marketplace
hik-cloud-open

海康云眸设备分组管理

by hik-cloud · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
27
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install hik-cloud-open-device-group-management
Description
调用海康云眸开放平台设备分组管理接口,包括新增组、删除组、更新组、查询组织详情、查询所有组织、查询下级组和设备转移分组。用户提到设备组织、设备分组、groupNo、groupId、parentNo、设备转组等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。
README (SKILL.md)

\r \r

海康云眸设备分组管理\r

\r

Overview\r

\r 按固定链路执行海康云眸开放平台设备分组管理接口,优先使用 {baseDir}/scripts/hik_open_device_group_management.py,不要临时手写认证、URL 拼接和重试逻辑。\r \r 本技能只处理以下能力:\r \r

  • 新增组\r
  • 删除组\r
  • 更新组\r
  • 查询单个组详情\r
  • 查询所有组织\r
  • 查询下级组\r
  • 设备转移分组\r \r 本技能不对外暴露 “获取 access_token” 操作。鉴权属于内部基础设施:脚本会自动读取凭证、获取 token、缓存 token,并在 401 时自动刷新后重试一次。\r \r

OpenClaw 配置\r

\r 当 OpenClaw 通过 ~/.openclaw/openclaw.json 管理本技能时,使用 metadata.openclaw.skillKey 作为配置键:\r \r

{\r
  skills: {\r
    entries: {\r
      "hik-cloud-device-group-management": {\r
        enabled: true,\r
        env: {\r
          HIK_OPEN_CLIENT_ID: "...",\r
          HIK_OPEN_CLIENT_SECRET: "...",\r
          HIK_OPEN_BASE_URL: "https://your-custom-base-url"\r
        }\r
      }\r
    }\r
  }\r
}\r
```\r
\r
若 Session 运行在 sandbox 中,宿主环境变量不会自动继承。此时应通过 OpenClaw 的 sandbox env 配置注入凭证,而不是依赖本机 shell 的 `process.env`。\r
\r
域名切换优先级:\r
\r
1. `--base-url`\r
2. `HIK_OPEN_BASE_URL`\r
3. 默认正式环境:`https://api2.hik-cloud.com`\r
\r
## 执行规则\r
\r
1. 认证固定使用 `Authorization: Bearer \x3Caccess_token>`。\r
2. token 来源优先级:\r
   - `--access-token`\r
   - `HIK_OPEN_ACCESS_TOKEN`\r
   - token cache\r
   - `HIK_OPEN_CLIENT_ID + HIK_OPEN_CLIENT_SECRET` 自动换取\r
3. 若业务接口返回 HTTP `401`,自动刷新 token 并重试一次。\r
4. 若接口返回非成功状态,直接返回真实错误,不臆造结果。\r
5. 组详情和删除操作使用 `groupNo`;设备转组使用 `targetGroupId`,不要混用。\r
6. `parentNo` 为空表示根组织;若用户未明确提供父组信息,不要擅自假设要挂到某个已有组织下。\r
7. 用户若要求“展示 token / 返回 token 原文”,说明这不属于本技能的主要职责;仅在明确要求调试认证链路时再解释。\r
\r
## 快速开始\r
\r
先准备环境变量:\r
\r
```bash\r
export HIK_OPEN_CLIENT_ID="\x3CYOUR_CLIENT_ID>"\r
export HIK_OPEN_CLIENT_SECRET="\x3CYOUR_CLIENT_SECRET>"\r
```\r
\r
新增组:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_group_management.py create \\r
  --group-name "华东一区" \\r
  --group-no "east-001" \\r
  --parent-no "root-01"\r
```\r
\r
删除组:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_group_management.py delete \\r
  --group-no "east-001"\r
```\r
\r
更新组:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_group_management.py update \\r
  --group-no "east-001" \\r
  --group-name "华东一区-新"\r
```\r
\r
查询单个组:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_group_management.py get \\r
  --group-no "east-001"\r
```\r
\r
查询所有组织:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_group_management.py list-all\r
```\r
\r
查询下级组:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_group_management.py list-children \\r
  --parent-no "root-01"\r
```\r
\r
设备转移分组:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_group_management.py device-transfer \\r
  --device-serial ABC1234567 \\r
  --target-group-id bc441199bec54f5a8d09b1b1c88c413d\r
```\r
\r
## 子命令说明\r
\r
- `create`:新增组\r
- `delete`:删除组\r
- `update`:更新组名称\r
- `get`:查询单个组详情\r
- `list-all`:查询所有组织\r
- `list-children`:查询下级组\r
- `device-transfer`:将设备转移到目标组\r
\r
通用参数:\r
\r
- `--base-url`:显式指定接口域名,优先级高于环境变量\r
- `--access-token`:显式指定 access token\r
- `--timeout`:请求超时秒数,默认 `20`\r
- `--token-cache-file`:token 缓存文件,默认 `~/.cache/hik_open/token.json`\r
- `--format`:`text` 或 `json`\r
\r
通用环境变量:\r
\r
- `HIK_OPEN_CLIENT_ID`\r
- `HIK_OPEN_CLIENT_SECRET`\r
- `HIK_OPEN_ACCESS_TOKEN`\r
- `HIK_OPEN_BASE_URL`\r
\r
## 输出约定\r
\r
- `--format text`:输出简要结果摘要和关键字段\r
- `--format json`:输出结构化结果,包含请求上下文和原始响应数据\r
\r
## 资源说明\r
\r
- `{baseDir}/scripts/hik_open_device_group_management.py`:主脚本,负责认证、缓存、组织接口调用\r
- `{baseDir}/references/auth.md`:认证与 token 自动刷新规则\r
- `{baseDir}/references/device-group-management.md`:设备分组管理接口摘要\r
Usage Guidance
Install only if you intend to let the agent manage Hik-Cloud device groups. Keep HIK_OPEN_CLIENT_SECRET private, avoid custom base URLs unless you fully trust them, review commands that delete or move devices before execution, and clear the token cache if you no longer need the skill.
Capability Analysis
Type: OpenClaw Skill Name: hik-cloud-open-device-group-management Version: 1.0.0 The skill bundle is a legitimate implementation for managing Hik-Cloud device groups via the Hikvision OpenAPI. The Python script `scripts/hik_open_device_group_management.py` follows security best practices by handling OAuth2 authentication internally, caching tokens in a standard local directory (`~/.cache/hik_open/`), and explicitly sanitizing error messages to prevent credential leakage. No evidence of data exfiltration, unauthorized network calls, or malicious prompt injection was found.
Capability Tags
requires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
The stated purpose matches the included Hik-Cloud group-management script, but the capabilities include deleting groups, updating groups, and transferring devices, which are high-impact account mutations.
Instruction Scope
The skill lists mutating operations and fixed execution paths, but the artifacts do not show an explicit confirmation, dry-run, rollback, or approval requirement before destructive or account-changing actions.
Install Mechanism
There is no install spec or remote installer; the skill uses a bundled Python script and the static dynamic-code signal is from a unit test importing that local script.
Credentials
The required Hik-Cloud client secret is purpose-aligned, but the script also allows an arbitrary --base-url/HIK_OPEN_BASE_URL and uses that base URL for token exchange, which could expose credentials if misconfigured or manipulated.
Persistence & Privilege
The skill persistently caches access tokens in ~/.cache/hik_open/token.json. This is disclosed and purpose-aligned, but users should understand a reusable token is stored on disk.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hik-cloud-open-device-group-management
  3. After installation, invoke the skill by name or use /hik-cloud-open-device-group-management
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: 设备分组创建、管理、查询
Metadata
Slug hik-cloud-open-device-group-management
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 海康云眸设备分组管理?

调用海康云眸开放平台设备分组管理接口,包括新增组、删除组、更新组、查询组织详情、查询所有组织、查询下级组和设备转移分组。用户提到设备组织、设备分组、groupNo、groupId、parentNo、设备转组等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。 It is an AI Agent Skill for Claude Code / OpenClaw, with 27 downloads so far.

How do I install 海康云眸设备分组管理?

Run "/install hik-cloud-open-device-group-management" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 海康云眸设备分组管理 free?

Yes, 海康云眸设备分组管理 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 海康云眸设备分组管理 support?

海康云眸设备分组管理 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 海康云眸设备分组管理?

It is built and maintained by hik-cloud (@hik-cloud-open); the current version is v1.0.0.

💬 Comments