Skip to main content

CompShare CLI

在终端管理优云智算 GPU 实例、镜像、云盘、US3 挂载、独享带宽、团队资源和 MiniMax H3 视频、图片、语音任务。

  • 交互式创建实例,实时查询规格、库存和价格
  • 支持批量生命周期操作、等待状态和跨地域查询
  • 支持可断线恢复的远程任务、状态查询和增量日志读取
  • 支持社区/自定义镜像、云盘、团队额度与账单
  • 支持独享带宽询价、购买、改配、退款预估及实例 EIP 切换
  • 支持 MiniMax H3 视频、Qwen-Image 图片和 IndexTTS 2.5 语音任务,以及素材上传、视频 Skill 和积分查询
  • 默认中文帮助,可切换英文;所有命令支持 JSON 输出
  • 可通过 compshare feedback 反馈 CLI 问题和建议

安装

pip install compshare-cli
pip install --upgrade compshare-cli

配置

compshare config --name default

凭证保存在 ~/.config/compshare/config.json,支持多个配置:

compshare config list
compshare config use production
compshare --profile production instance list

也可以使用环境变量:

export COMPSHARE_PUBLIC_KEY='...'
export COMPSHARE_PRIVATE_KEY='...'

# MiniMax H3 使用独立的模型 API Key
export COMPSHARE_MINIMAX_API_KEY='sk-ml-...'

CLI 使用统计和反馈与业务 API 一样,通过当前 profile 的凭证签名后发送到 https://api.compshare.cn/;开发环境可使用 COMPSHARE_INSIGHTS_URL 覆盖网关地址。

快速开始

# 查询、创建和查看实例
compshare instance search --region cn-sh2 --zone cn-sh2-02
compshare instance create
compshare instance list --all

# 连接实例
compshare instance ssh INSTANCE_ID

# MiniMax H3:先预演,再创建
compshare --json minimax create '一只猫在海边奔跑' --dry-run
compshare --json minimax create '一只猫在海边奔跑' --yes
compshare --json minimax points

# 图片:查看价格、创建任务、查询结果
compshare --json minimax image config
compshare --json minimax image create '一只戴着宇航头盔的猫' --resolution 1K --dry-run
compshare --json minimax image create '一只戴着宇航头盔的猫' --resolution 1K --yes
compshare --json minimax image show TASK_ID

# 语音:先查询可用音色,再创建任务
compshare --json minimax audio pricing
compshare --json minimax audio voices
compshare --json minimax audio create '你好,欢迎使用优云智算。' --voice-id VOICE_ID --dry-run
compshare --json minimax audio create '你好,欢迎使用优云智算。' --voice-id VOICE_ID --yes

# 查看帮助
compshare -h
compshare instance -h

命令概览

compshare config     API 凭证配置
compshare feedback   反馈 CLI 问题或建议
compshare doctor     配置、鉴权、网络与 SSH 环境诊断
compshare instance   GPU 实例、规格、库存、价格和生命周期
compshare image      平台、自定义、社区及共享镜像
compshare storage    云盘和 US3 挂载
compshare bandwidth  独享带宽和实例 EIP 带宽归属
compshare minimax    MiniMax H3 视频、图片、语音、Skill 和积分
compshare team       团队、邀请、成员额度、账单和审计

Skill

为 Codex、Claude Code、Cursor 等 AI Agent 安装 CompShare CLI Skill:

npx skills add compshare-cn/compshare-cli --skill compshare-cli

完整说明见 CompShare CLI Skill。

WorkBuddy Connector

仓库内置符合 WorkBuddy 规范的 MCP + Skill Token 连接器,提交目录为 connector/compshare。用户在 WorkBuddy 表单中填写 API 公钥和 私钥后,连接器通过本地 stdio MCP 注入凭证,不需要 OAuth,也不会修改已有 CLI 配置。

WorkBuddy 配置固定使用 Python 3.11;本地开发需 Python 3.10 或更高版本,可安装 MCP 可选 依赖并启动服务:

pip install -e '.[mcp]'
compshare-mcp

正式 Connector 使用 uvx 从 PyPI 安装固定版本,并将只读、预演和需要明确确认的写操作 分开暴露。MiniMax H3 使用表单中可选的独立模型 API Key。

SDK

如需通过 SDK 集成 CompShare API,可参考独立的 CompShare Developer Examples 仓库。 其中包含 Python、Go、Java、JavaScript 和 PHP 示例,覆盖 API 鉴权、GPU 实例创建、规格配置和状态查询。

Release files for compshare-cli 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compshare-cli 0.5.0
File Size Uploaded
compshare_cli-0.5.0.tar.gz 161.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for compshare-cli 0.5.0
File Interpreter ABI Platform
compshare_cli-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 280.4 kB

Release files / compshare_cli-0.5.0.tar.gz

Download URL compshare_cli-0.5.0.tar.gz
Size 161.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0460b83dc1d7adfca47ddccc00c84a06d73217593405465e2229bd7b48338e4f
BLAKE2b-256 checksum
How to use checksums
c9115c282fb77453ac5b7335333b147bf93aab94a4b4fe027601c32b48d5f6f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / compshare_cli-0.5.0-py3-none-any.whl

Download URL compshare_cli-0.5.0-py3-none-any.whl
Size 119.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e42f88d5d48f3db3bf44827b45d952640447f07d422f6253cca120bb9309465d
BLAKE2b-256 checksum
How to use checksums
6709f34893bbff09362eaea81f593afe958b5b204ba870f2d6ba53e13df90457
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page