← 返回 Skills 市场
25
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install hik-cloud-open-device-channel-management
功能描述
调用海康云眸开放平台设备通道管理接口,包括查询设备下通道列表、同步设备下通道、修改通道名称和同步设备通道名称。用户提到通道列表、通道同步、通道重命名、channelNo、channelName 等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。
使用说明 (SKILL.md)
\r \r
海康云眸设备通道管理\r
\r
Overview\r
\r
按固定链路执行海康云眸开放平台设备通道管理接口,优先使用 {baseDir}/scripts/hik_open_device_channel_management.py,不要临时手写认证、URL 拼接和重试逻辑。\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-channel-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. 域名来源优先级:\r
- `--base-url`\r
- `HIK_OPEN_BASE_URL`\r
- 默认正式环境 `https://api2.hik-cloud.com`\r
4. 若业务接口返回 HTTP `401`,自动刷新 token 并重试一次。\r
5. 若接口返回非成功状态,直接返回真实错误,不臆造结果。\r
6. 修改通道名称时,若 `--sync-local 1`,设备需在线才能同步成功。\r
7. 通道列表中的 `channelStatus=-1` 一般表示该通道未关联设备。\r
8. 用户若要求“展示 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_channel_management.py list \\r
--device-serial E05426006 \\r
--page-no 1 \\r
--page-size 50\r
```\r
\r
同步设备下通道:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_channel_management.py sync \\r
--device-serial E05426006\r
```\r
\r
修改通道名称:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_channel_management.py rename \\r
--device-serial D20591677 \\r
--channel-no 1 \\r
--channel-name "修改xxx" \\r
--sync-local 0\r
```\r
\r
同步设备通道名称:\r
\r
```bash\r
python3 {baseDir}/scripts/hik_open_device_channel_management.py sync-names \\r
--device-serial E05426006\r
```\r
\r
## 子命令说明\r
\r
- `list`:查询设备下通道列表\r
- `sync`:同步设备下通道\r
- `rename`:修改通道名称\r
- `sync-names`:同步设备通道名称\r
\r
字段提示:\r
\r
- `channelType = 通道类型`,重点看 `list` 返回里的 `channelType`,常见值是 `10300` 视频通道、`10302` 报警输入\r
- `channelStatus = 通道状态`,重点看 `list` 返回里的 `channelStatus`,`0` 离线、`1` 在线、`-1` 未上报/未关联设备\r
- `syncLocal = 是否同步到设备本地`,重点看 `rename` 请求里的 `syncLocal`,`0` 不同步、`1` 同步到本地;`channelName` 普通情况下最多 50 个字符,`syncLocal=1` 时最多 32 个字符,且 `syncLocal=1` 时设备需在线\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_channel_management.py`:主脚本,负责认证、缓存和设备通道接口调用\r
- `{baseDir}/references/auth.md`:认证与 token 自动刷新规则\r
- `{baseDir}/references/device-channel-management.md`:设备通道管理接口摘要\r
安全使用建议
Install only if you trust the publisher and are comfortable giving this skill Hik-Cloud application credentials. Use least-privilege credentials where possible, keep the token cache protected, use only trusted base URLs, and review any sync or rename action before it changes device channel settings.
功能分析
Type: OpenClaw Skill
Name: hik-cloud-open-device-channel-management
Version: 1.0.0
The skill bundle is a legitimate integration for managing Hik-Cloud device channels. The primary script (hik_open_device_channel_management.py) implements standard OAuth2 authentication and interacts with official Hikvision API endpoints (api2.hik-cloud.com). It follows security best practices by handling token management internally and caching credentials in a standard local directory (~/.cache/hik_open/token.json) rather than exposing them to the user. No evidence of malicious intent, data exfiltration, or prompt injection was found.
能力标签
能力评估
Purpose & Capability
The stated purpose matches the documented commands and API paths, including list, sync, rename, and sync-names; the sync and rename commands are state-changing device/account operations.
Instruction Scope
Instructions are scoped to the Hik-Cloud channel-management helper script and do not ask for unrelated shell/API use, but users should confirm deviceSerial, channelNo, and channelName before state-changing commands.
Install Mechanism
There is no install script and only python3 is required, but the registry source is unknown and the main script content supplied for review is truncated, so provenance/review confidence is not complete.
Credentials
The required HIK_OPEN_CLIENT_ID and HIK_OPEN_CLIENT_SECRET are expected for this integration. The configurable base URL should only be pointed at trusted Hik-Cloud environments because the OAuth request follows that base URL.
Persistence & Privilege
The skill persistently caches OAuth access tokens under ~/.cache/hik_open/token.json. This is disclosed and purpose-aligned, with no evidence of background execution or self-persistence.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install hik-cloud-open-device-channel-management - 安装完成后,直接呼叫该 Skill 的名称或使用
/hik-cloud-open-device-channel-management触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: 设备通道查询、管理
元数据
常见问题
海康云眸设备通道管理 是什么?
调用海康云眸开放平台设备通道管理接口,包括查询设备下通道列表、同步设备下通道、修改通道名称和同步设备通道名称。用户提到通道列表、通道同步、通道重命名、channelNo、channelName 等场景时使用。本技能自动处理 access_token 获取与刷新,不向用户暴露 token 调用流程。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 25 次。
如何安装 海康云眸设备通道管理?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install hik-cloud-open-device-channel-management」即可一键安装,无需额外配置。
海康云眸设备通道管理 是免费的吗?
是的,海康云眸设备通道管理 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
海康云眸设备通道管理 支持哪些平台?
海康云眸设备通道管理 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 海康云眸设备通道管理?
由 hik-cloud(@hik-cloud-open)开发并维护,当前版本 v1.0.0。
推荐 Skills