← 返回 Skills 市场
153
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install compshare-api
功能描述
管理优云智算CompShare平台的GPU实例全生命周期,包括创建、查询、启动、停止、重启、重置密码和删除实例;当用户需要创建GPU云服务器、查询实例状态、管理实例启停、重置实例密码或删除实例时使用
使用说明 (SKILL.md)
CompShare API 技能
任务目标
- 本技能用于:管理优云智算CompShare平台的GPU实例资源
- 能力包含:创建GPU实例、查询实例列表、启动/停止/重启实例、重置密码、删除实例
- 触发条件:用户需要创建或管理CompShare平台的GPU云服务器实例
前置准备
依赖安装
pip install ucloud-sdk-python3 PyYAML paramiko
配置文件
在使用前,需要在Skill目录下创建配置文件 assets/config.yaml:
- 编辑配置文件,填入API凭证:
compshare:
public_key: "your-public-key"
private_key: "your-private-key"
region: "cn-wlcb"
zone: "cn-wlcb-01"
base_url: "https://api.compshare.cn"
-
获取API凭证:
- 登录 CompShare 控制台:https://console.compshare.cn/
- 进入「API管理」页面:https://console.compshare.cn/uaccount/api_manage
- 创建并获取
public_key和private_key
-
配置文件查找优先级:
- 命令行参数
--config指定的路径 - 默认路径
assets/config.yaml(Skill目录下)
- 命令行参数
操作步骤
1. 创建GPU实例(默认创建抢占式)
调用 scripts/compshare_client.py 脚本,使用 create 命令:
python scripts/compshare_client.py create \
--gpu-type 4090 \
--gpu-count 1 \
--cpu 16 \
--memory 64 \
--disk-size 200 \
--image-id 500WHhII1fnz \
--name "ComfyUI-4090" \
--charge-type Spot
2. 查询实例列表
调用脚本使用 list 命令:
python scripts/compshare_client.py list
# 或查询特定实例
python scripts/compshare_client.py list --instance-ids "instance-id-1,instance-id-2"
3. 启动实例
正常开机(带GPU):
python scripts/compshare_client.py start --instance-id \x3CUHostId>
无卡开机(不带GPU,节省费用):
python scripts/compshare_client.py start --instance-id \x3CUHostId> --without-gpu
4. 停止实例
调用脚本使用 stop 命令:
python scripts/compshare_client.py stop --instance-id \x3CUHostId>
5. 重启实例
调用脚本使用 reboot 命令:
python scripts/compshare_client.py reboot --instance-id \x3CUHostId>
6. 重置实例密码
调用脚本使用 reset-password 命令:
python scripts/compshare_client.py reset-password --instance-id \x3CUHostId> --password \x3Cnew-password>
7. 删除实例
调用脚本使用 delete 命令:
python scripts/compshare_client.py delete --instance-id \x3CUHostId>
8. SSH连接实例
通过实例的 SshLoginCommand 和 Password 连接实例:
- 先查询实例获取 SSH 登录信息:
python scripts/compshare_client.py list
# 返回结果中包含 SshLoginCommand 和 Password
- 使用 SSH 客户端连接:
python scripts/ssh_client.py connect \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password"
9. SSH远程执行命令
python scripts/ssh_client.py exec \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--cmd "ls -la /home"
10. SSH文件操作
列出目录:
python scripts/ssh_client.py ls \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--path "/home"
上传文件:
python scripts/ssh_client.py upload \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--local ./local_file.txt \
--remote /home/remote_file.txt
下载文件:
python scripts/ssh_client.py download \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--remote /home/remote_file.txt \
--local ./local_file.txt
上传整个目录:
python scripts/ssh_client.py upload-dir \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--local ./my_project \
--remote /home/my_project
下载整个目录:
python scripts/ssh_client.py download-dir \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--remote /home/data \
--local ./data_backup
查看文件内容:
python scripts/ssh_client.py cat \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--path /etc/hosts
创建目录:
python scripts/ssh_client.py mkdir \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--path /home/new_dir
删除文件:
python scripts/ssh_client.py rm \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--path /home/old_file.txt
重命名文件/目录:
python scripts/ssh_client.py rename \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--old /home/old_name \
--new /home/new_name
修改权限:
python scripts/ssh_client.py chmod \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--path /home/script.sh \
--mode 755
交互式Shell:
python scripts/ssh_client.py shell \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password"
资源索引
- API客户端脚本:scripts/compshare_client.py - 封装所有API调用逻辑
- SSH客户端脚本:scripts/ssh_client.py - SSH连接和文件传输
- API详细参考:references/api_reference.md - 完整的API参数说明和示例
注意事项
- 删除实例前必须先停止实例,否则会报错
- 密码需要符合平台规范,并通过 base64 编码传输
- GPU类型支持:4090、3080Ti、3090、A800、A100、H20等
- 地域和可用区固定为 cn-wlcb 和 cn-wlcb-01
- 所有API响应中的 RetCode=0 表示操作成功
- 配置文件包含敏感信息,请勿提交到版本控制系统
- SSH密码可通过查询实例列表获取(Password字段)
- SSH登录命令可通过查询实例列表获取(SshLoginCommand字段)
安全使用建议
要点建议:
- 在安装/使用前确认你打算操作的是哪个 CompShare 账户,并使用一个最小权限的 API 密钥(如果平台支持权限细分)。
- assets/config.yaml 会包含敏感信息,切勿将其提交到公共版本库;考虑把配置文件放在受限目录并使用文件系统权限保护。
- ssh_client.py 能够在远端执行任意命令并上/下载文件:仅在完全信任要连接的实例时才运行这些操作,避免把本地敏感文件上传到云主机。
- 从官方 PyPI 安装依赖(ucloud-sdk-python3、paramiko、PyYAML),并在隔离的虚拟环境(venv)中运行来减少对宿主系统的影响。
- 如果你希望更严格的控制,先在测试账号或受限项目中试运行,确认行为符合预期后再在生产账号使用;必要时定期轮换 API 密钥。
功能分析
Type: OpenClaw Skill
Name: compshare-api
Version: 1.0.3
The skill provides comprehensive management of CompShare GPU instances, including API-based lifecycle control and full SSH/SFTP capabilities. While these features are aligned with the stated purpose of managing cloud resources, the inclusion of unrestricted remote command execution, file manipulation, and an interactive shell via `scripts/ssh_client.py` (using `paramiko`) represents high-risk functionality. No explicit evidence of malicious intent, hardcoded backdoors, or data exfiltration was found; however, the broad remote access capabilities and the use of `AutoAddPolicy()` for SSH host keys warrant a suspicious classification. Primary IOCs include the CompShare API endpoint: api.compshare.cn.
能力评估
Purpose & Capability
技能名称/描述、SKILL.md、以及包含的 scripts/compshare_client.py 与 scripts/ssh_client.py 一致地实现了管理 CompShare GPU 实例(创建/查询/启动/停止/重置密码/删除)与通过 SSH 管理实例的功能,没有请求与此用途无关的权限或凭证。
Instruction Scope
运行说明限定为:安装 Python 依赖、在 assets/config.yaml 中填写 public_key/private_key、调用脚本执行实例管理或通过脚本取得 SshLoginCommand/Password 并用 ssh_client.py 做 SSH 操作。需要用户注意:ssh_client 支持在远端执行任意命令与上传/下载文件——这是该技能功能的一部分,但也意味着在运行时会对远端主机有完全的文件与命令访问。
Install Mechanism
这是一个 instruction-only 技能(无 install spec),SKILL.md 建议通过 pip 安装 ucloud-sdk-python3、PyYAML、paramiko,这与包含的 Python 脚本相符;没有从不明 URL 下载或写入可执行文件的高风险安装步骤。
Credentials
技能不要求任何非该服务所需的环境变量或系统路径。它以本地配置文件 assets/config.yaml 保存 public_key/private_key(文档也指导用户如何从 CompShare 控制台获取这些密钥),这与其对 API 访问的需求相称。
Persistence & Privilege
技能没有设置 always:true,也没有请求修改其他技能或系统范围设置;允许模型自主调用是平台默认行为(disable-model-invocation: false),单独并不构成额外风险。
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install compshare-api - 安装完成后,直接呼叫该 Skill 的名称或使用
/compshare-api触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
- 新增 _meta.json 文件。
- 更新文档示例,创建实例默认描述为抢占式(Spot),并更新默认参数。
- 移除无实际存在的配置文件模板及相关文档引用。
- 其余功能和使用方式保持不变。
v1.0.2
- 配置说明优化:明确要求在 Skill 目录下新建 assets/config.yaml 配置文件,提升指引清晰度。
- 删除了冗余“配置文件”章节描述,统一至依赖安装步骤后。
- 其余功能和指令无变化,仅文档细节说明收敛和优化。
- 添加抢占模式类型
v1.0.1
- Updated configuration instructions in SKILL.md for improved clarity and conciseness.
- Removed step-by-step commands for copying the config file; now instructs users to create and edit the config directly.
- No changes to code or functionality; documentation only.
v1.0.0
Initial release of compshare-api skill:
- Provides full lifecycle management for CompShare GPU cloud instances, including create, query, start, stop, reboot, reset password, and delete.
- Offers command-line utilities for resource management and SSH operations (connect, execute commands, file transfer, directory operations).
- Supports common GPU instance types and fixed region/zone (cn-wlcb, cn-wlcb-01).
- Includes configuration and setup instructions, usage examples, and reference resources.
- Emphasizes security with password handling and configuration file precautions.
元数据
常见问题
优云智算GPU管家 是什么?
管理优云智算CompShare平台的GPU实例全生命周期,包括创建、查询、启动、停止、重启、重置密码和删除实例;当用户需要创建GPU云服务器、查询实例状态、管理实例启停、重置实例密码或删除实例时使用. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 153 次。
如何安装 优云智算GPU管家?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install compshare-api」即可一键安装,无需额外配置。
优云智算GPU管家 是免费的吗?
是的,优云智算GPU管家 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
优云智算GPU管家 支持哪些平台?
优云智算GPU管家 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 优云智算GPU管家?
由 Chsengni(@chsengni)开发并维护,当前版本 v1.0.3。
推荐 Skills