📦 Hope — 希望
v1.0.0ClientHope Server Max API 客户端技能,用于向 Hope Server Max 服务端发起 API 请求。
详细分析 ▾
运行时依赖
版本
hope-client 初始版本发布。 - 提供与 Hope Server Max API 交互的 client skill。 - 支持频道、上传、下载、账户及引擎管理等核心 API。 - 包含详尽的认证与服务器连接环境变量配置。 - 提供即用 bash 函数,便于常见查询与自动化。 - 附带清晰使用场景及标准化状态码说明。 - 专为内网(SSH)环境设计,所有请求须携带 API key。
安装命令
点击复制技能文档
Hope Server Max API 客户端技能。用于发起对 Hope Server Max 服务端的 API 请求。
环境变量配置
OpenClaw 自动加载~/.openclaw/.env 文件中的环境变量:
``bash
# ~/.openclaw/.env
HOPE_API_KEY=hope-openclaw-apikey-2026-0411
HOPE_HOST=hope05
HOPE_PORT=8088
`
加载优先级(官方文档):
- 进程已存在的环境变量(不会被覆盖)
CWD.env文件~/.openclaw/.env文件
技能脚本通过环境变量读取配置:
| 环境变量 | 说明 | 默认值 |
|----------|------|--------|
| HOPE_API_KEY | Hope Server Max API Key | - |
| HOPE_HOST | 服务器地址 | hope05 |
| HOPE_PORT | 服务端口 | 8088 |
认证方式
所有请求必须携带 X-OpenClaw-Key 请求头:
`bash
# 使用环境变量
curl -H "X-OpenClaw-Key: $HOPE_API_KEY" \
http://$HOPE_HOST:$HOPE_PORT/system/channel/list
`
从本地通过 SSH 调用:
`bash
sshpass -p 'hope' ssh $HOPE_HOST \
"curl -s -H 'X-OpenClaw-Key: $HOPE_API_KEY' http://127.0.0.1:$HOPE_PORT/system/channel/list"
` ---
API 接口文档
1. 频道管理 (Channel)
1.1 查询频道列表
`
GET /system/channel/list
`
查询参数:
channelName- 频道名称(可选)channelType- 频道类型:bili、youtube、xigua(可选)channelOffOn- 启用状态:on、off(可选)pageNum- 页码(默认 1)pageSize- 每页数量(默认 10)
响应示例:
`json
{
"total": 88,
"rows": [
{
"channelId": 267,
"channelName": "CopyCat-bili",
"channelType": "bili",
"channelOffOn": "on",
"cookieEnable": "true",
"engineId": 3,
"engineName": "hope03"
}
],
"code": 200,
"msg": "查询成功"
}
`
1.2 获取所有频道名称
`
GET /system/channel/listAllNames
` 1.3 搜索频道名称
`
GET /system/channel/searchNames?channelName=Copy
` 1.4 获取频道详情
`
GET /system/channel/{channelId}
` 1.5 频道统计信息
`
GET /system/channel/statistics
` 1.6 刷新频道 Cookie
`
POST /system/channel/refresh/{channelId}
` ---
2. 上传实例 (Upload Instance)
2.1 查询上传实例列表
`
GET /system/instance/list
` 2.2 获取上传实例详情
`
GET /system/instance/{instanceId}
` 2.3 查询上传趋势数据
`
GET /system/instance/queryTrend
` 2.4 查询失败排行列表
`
GET /system/instance/failList
` 2.5 查询失败日志
`
POST /system/instance/queryFailLog
` ---
3. 下载实例 (Download Instance)
3.1 查询下载实例列表
`
GET /system/downloadInstance/list
` 3.2 获取下载实例详情
`
GET /system/downloadInstance/{pkInstanceId}
` 3.3 查询待上传视频列表
`
GET /system/downloadInstance/pending
` 3.4 统计待上传视频数量
`
GET /system/downloadInstance/pending/count
` 3.5 查询下载趋势数据
`
GET /system/downloadInstance/trend
` 3.6 更新清理状态
`
PUT /system/downloadInstance/clean/{pkInstanceIds}
` ---
4. 账户管理 (Account)
4.1 查询账户列表
`
GET /system/account/list
` 4.2 获取账户详情
`
GET /system/account/{accId}
` ---
5. 引擎管理 (Engine)
5.1 查询引擎列表
`
GET /system/engineInfo/list
` 5.2 获取所有引擎信息
`
GET /system/engineInfo/listAll
` 5.3 获取引擎详情
`
GET /system/engineInfo/{engineId}
` ---
快速调用函数
技能提供以下快捷调用函数(写入 scripts/api_client.sh):
基础调用
`bash
hope_api() {
local endpoint="$1"
local params="${2:-}"
sshpass -p 'hope' ssh hope@hope05 \
"curl -s -H
``