compshare-cli 0.3.4__tar.gz → 0.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. compshare_cli-0.3.5/PKG-INFO +109 -0
  2. compshare_cli-0.3.5/README.md +84 -0
  3. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/__init__.py +1 -1
  4. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/location.py +2 -8
  5. compshare_cli-0.3.5/src/compshare_cli.egg-info/PKG-INFO +109 -0
  6. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_location.py +1 -3
  7. compshare_cli-0.3.4/PKG-INFO +0 -400
  8. compshare_cli-0.3.4/README.md +0 -375
  9. compshare_cli-0.3.4/src/compshare_cli.egg-info/PKG-INFO +0 -400
  10. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/LICENSE +0 -0
  11. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/pyproject.toml +0 -0
  12. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/setup.cfg +0 -0
  13. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/__main__.py +0 -0
  14. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/actions.py +0 -0
  15. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/api.py +0 -0
  16. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/cli.py +0 -0
  17. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/__init__.py +0 -0
  18. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/ask.py +0 -0
  19. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/common.py +0 -0
  20. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/doctor.py +0 -0
  21. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/feedback.py +0 -0
  22. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/image.py +0 -0
  23. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/instance.py +0 -0
  24. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/storage.py +0 -0
  25. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/commands/team.py +0 -0
  26. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/config.py +0 -0
  27. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/errors.py +0 -0
  28. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/i18n.py +0 -0
  29. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/insights.py +0 -0
  30. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/instance_templates.py +0 -0
  31. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/output.py +0 -0
  32. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/parsing.py +0 -0
  33. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/qa.py +0 -0
  34. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/remote_jobs.py +0 -0
  35. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/runtime.py +0 -0
  36. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/sdk.py +0 -0
  37. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/ssh.py +0 -0
  38. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli/ssh_cache.py +0 -0
  39. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli.egg-info/SOURCES.txt +0 -0
  40. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli.egg-info/dependency_links.txt +0 -0
  41. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli.egg-info/entry_points.txt +0 -0
  42. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli.egg-info/requires.txt +0 -0
  43. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/src/compshare_cli.egg-info/top_level.txt +0 -0
  44. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_actions.py +0 -0
  45. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_api.py +0 -0
  46. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_cli.py +0 -0
  47. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_config.py +0 -0
  48. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_feedback.py +0 -0
  49. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_instance_templates.py +0 -0
  50. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_output.py +0 -0
  51. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_parsing.py +0 -0
  52. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_qa.py +0 -0
  53. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_release_version.py +0 -0
  54. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_remote_jobs.py +0 -0
  55. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_sdk.py +0 -0
  56. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_ssh.py +0 -0
  57. {compshare_cli-0.3.4 → compshare_cli-0.3.5}/tests/test_ssh_cache.py +0 -0
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: compshare-cli
3
+ Version: 0.3.5
4
+ Summary: Command-line client for CompShare GPU compute
5
+ Author: CompShare
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/BennielAllan/compshare-cli
8
+ Project-URL: Repository, https://github.com/BennielAllan/compshare-cli
9
+ Project-URL: Changelog, https://github.com/BennielAllan/compshare-cli/blob/master/CHANGELOG.md
10
+ Project-URL: Issues, https://github.com/BennielAllan/compshare-cli/issues
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: click<9,>=8.1
15
+ Requires-Dist: pexpect<5,>=4.9; platform_system != "Windows"
16
+ Requires-Dist: rich<15,>=13
17
+ Requires-Dist: typer<1,>=0.12
18
+ Requires-Dist: ucloud-sdk-python3<0.12,>=0.11.103
19
+ Requires-Dist: urllib3<2,>=1.26.18; python_version < "3.10" and platform_system == "Darwin"
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest<10,>=8; extra == "dev"
22
+ Requires-Dist: pytest-cov<8,>=5; extra == "dev"
23
+ Requires-Dist: ruff<1,>=0.6; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ # CompShare CLI
27
+
28
+ 在终端管理优云智算 GPU 实例、镜像、云盘、US3 挂载和团队资源。
29
+
30
+ - 交互式创建实例,实时查询规格、库存和价格
31
+ - 支持批量生命周期操作、等待状态和跨地域查询
32
+ - 支持可断线恢复的远程任务、状态查询和增量日志读取
33
+ - 支持社区/自定义镜像、云盘、团队额度与账单
34
+ - 默认中文帮助,可切换英文;所有命令支持 JSON 输出
35
+ - 可通过 `compshare ask` 查询产品使用和计费知识
36
+ - 可通过 `compshare feedback` 反馈 CLI 问题和建议
37
+
38
+ ## 安装
39
+
40
+ ```bash
41
+ pip install compshare-cli
42
+ pip install --upgrade compshare-cli
43
+ ```
44
+
45
+ ## 配置
46
+
47
+ ```bash
48
+ compshare config --name default
49
+ ```
50
+
51
+ 凭证保存在 `~/.config/compshare/config.json`,支持多个配置:
52
+
53
+ ```bash
54
+ compshare config list
55
+ compshare config use production
56
+ compshare --profile production instance list
57
+ ```
58
+
59
+ 也可以使用环境变量:
60
+
61
+ ```bash
62
+ export COMPSHARE_PUBLIC_KEY='...'
63
+ export COMPSHARE_PRIVATE_KEY='...'
64
+ ```
65
+
66
+ ## 快速开始
67
+
68
+ ```bash
69
+ # 查询、创建和查看实例
70
+ compshare instance search --region cn-sh2 --zone cn-sh2-02
71
+ compshare instance create
72
+ compshare instance list --all
73
+
74
+ # 连接实例
75
+ compshare instance ssh INSTANCE_ID
76
+
77
+ # 查看帮助
78
+ compshare -h
79
+ compshare instance -h
80
+ ```
81
+
82
+ ## 命令概览
83
+
84
+ ```text
85
+ compshare config API 凭证配置
86
+ compshare feedback 反馈 CLI 问题或建议
87
+ compshare doctor 配置、鉴权、网络与 SSH 环境诊断
88
+ compshare ask 产品使用和计费问答
89
+ compshare instance GPU 实例、规格、库存、价格和生命周期
90
+ compshare image 平台、自定义、社区及共享镜像
91
+ compshare storage 云盘和 US3 挂载
92
+ compshare team 团队、邀请、成员额度、账单和审计
93
+ ```
94
+
95
+ ## Skill
96
+
97
+ 为 Codex、Claude Code、Cursor 等 AI Agent 安装 CompShare CLI Skill:
98
+
99
+ ```bash
100
+ npx skills add compshare-cn/compshare-cli --skill compshare-cli
101
+ ```
102
+
103
+ 完整说明见 [CompShare CLI Skill](skills/compshare-cli/SKILL.md)。
104
+
105
+ ## SDK
106
+
107
+ 如需通过 SDK 集成 CompShare API,可参考独立的
108
+ [CompShare Developer Examples](https://github.com/ucloud/compshare-developer-examples) 仓库。
109
+ 其中包含 Python、Go、Java、JavaScript 和 PHP 示例,覆盖 API 鉴权、GPU 实例创建、规格配置和状态查询。
@@ -0,0 +1,84 @@
1
+ # CompShare CLI
2
+
3
+ 在终端管理优云智算 GPU 实例、镜像、云盘、US3 挂载和团队资源。
4
+
5
+ - 交互式创建实例,实时查询规格、库存和价格
6
+ - 支持批量生命周期操作、等待状态和跨地域查询
7
+ - 支持可断线恢复的远程任务、状态查询和增量日志读取
8
+ - 支持社区/自定义镜像、云盘、团队额度与账单
9
+ - 默认中文帮助,可切换英文;所有命令支持 JSON 输出
10
+ - 可通过 `compshare ask` 查询产品使用和计费知识
11
+ - 可通过 `compshare feedback` 反馈 CLI 问题和建议
12
+
13
+ ## 安装
14
+
15
+ ```bash
16
+ pip install compshare-cli
17
+ pip install --upgrade compshare-cli
18
+ ```
19
+
20
+ ## 配置
21
+
22
+ ```bash
23
+ compshare config --name default
24
+ ```
25
+
26
+ 凭证保存在 `~/.config/compshare/config.json`,支持多个配置:
27
+
28
+ ```bash
29
+ compshare config list
30
+ compshare config use production
31
+ compshare --profile production instance list
32
+ ```
33
+
34
+ 也可以使用环境变量:
35
+
36
+ ```bash
37
+ export COMPSHARE_PUBLIC_KEY='...'
38
+ export COMPSHARE_PRIVATE_KEY='...'
39
+ ```
40
+
41
+ ## 快速开始
42
+
43
+ ```bash
44
+ # 查询、创建和查看实例
45
+ compshare instance search --region cn-sh2 --zone cn-sh2-02
46
+ compshare instance create
47
+ compshare instance list --all
48
+
49
+ # 连接实例
50
+ compshare instance ssh INSTANCE_ID
51
+
52
+ # 查看帮助
53
+ compshare -h
54
+ compshare instance -h
55
+ ```
56
+
57
+ ## 命令概览
58
+
59
+ ```text
60
+ compshare config API 凭证配置
61
+ compshare feedback 反馈 CLI 问题或建议
62
+ compshare doctor 配置、鉴权、网络与 SSH 环境诊断
63
+ compshare ask 产品使用和计费问答
64
+ compshare instance GPU 实例、规格、库存、价格和生命周期
65
+ compshare image 平台、自定义、社区及共享镜像
66
+ compshare storage 云盘和 US3 挂载
67
+ compshare team 团队、邀请、成员额度、账单和审计
68
+ ```
69
+
70
+ ## Skill
71
+
72
+ 为 Codex、Claude Code、Cursor 等 AI Agent 安装 CompShare CLI Skill:
73
+
74
+ ```bash
75
+ npx skills add compshare-cn/compshare-cli --skill compshare-cli
76
+ ```
77
+
78
+ 完整说明见 [CompShare CLI Skill](skills/compshare-cli/SKILL.md)。
79
+
80
+ ## SDK
81
+
82
+ 如需通过 SDK 集成 CompShare API,可参考独立的
83
+ [CompShare Developer Examples](https://github.com/ucloud/compshare-developer-examples) 仓库。
84
+ 其中包含 Python、Go、Java、JavaScript 和 PHP 示例,覆盖 API 鉴权、GPU 实例创建、规格配置和状态查询。
@@ -1,3 +1,3 @@
1
1
  """CompShare command-line client."""
2
2
 
3
- __version__ = "0.3.4"
3
+ __version__ = "0.3.5"
@@ -77,11 +77,7 @@ def locate_disk(
77
77
  zone = str(disk.get("Zone") or "")
78
78
  locations = supported_locations(state, request_region=request_region)
79
79
  location = next(
80
- (
81
- item
82
- for item in locations
83
- if str(item.get("Zone") or "") == zone and item.get("Region")
84
- ),
80
+ (item for item in locations if str(item.get("Zone") or "") == zone and item.get("Region")),
85
81
  None,
86
82
  )
87
83
  if location is None:
@@ -95,8 +91,6 @@ def locate_disk(
95
91
  region = str(location["Region"])
96
92
  mount_instance = disk.get("MountInstance")
97
93
  host = (
98
- {"UHostId": str(mount_instance), "Region": region, "Zone": zone}
99
- if mount_instance
100
- else None
94
+ {"UHostId": str(mount_instance), "Region": region, "Zone": zone} if mount_instance else None
101
95
  )
102
96
  return region, zone, host, disk
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: compshare-cli
3
+ Version: 0.3.5
4
+ Summary: Command-line client for CompShare GPU compute
5
+ Author: CompShare
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/BennielAllan/compshare-cli
8
+ Project-URL: Repository, https://github.com/BennielAllan/compshare-cli
9
+ Project-URL: Changelog, https://github.com/BennielAllan/compshare-cli/blob/master/CHANGELOG.md
10
+ Project-URL: Issues, https://github.com/BennielAllan/compshare-cli/issues
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: click<9,>=8.1
15
+ Requires-Dist: pexpect<5,>=4.9; platform_system != "Windows"
16
+ Requires-Dist: rich<15,>=13
17
+ Requires-Dist: typer<1,>=0.12
18
+ Requires-Dist: ucloud-sdk-python3<0.12,>=0.11.103
19
+ Requires-Dist: urllib3<2,>=1.26.18; python_version < "3.10" and platform_system == "Darwin"
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest<10,>=8; extra == "dev"
22
+ Requires-Dist: pytest-cov<8,>=5; extra == "dev"
23
+ Requires-Dist: ruff<1,>=0.6; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ # CompShare CLI
27
+
28
+ 在终端管理优云智算 GPU 实例、镜像、云盘、US3 挂载和团队资源。
29
+
30
+ - 交互式创建实例,实时查询规格、库存和价格
31
+ - 支持批量生命周期操作、等待状态和跨地域查询
32
+ - 支持可断线恢复的远程任务、状态查询和增量日志读取
33
+ - 支持社区/自定义镜像、云盘、团队额度与账单
34
+ - 默认中文帮助,可切换英文;所有命令支持 JSON 输出
35
+ - 可通过 `compshare ask` 查询产品使用和计费知识
36
+ - 可通过 `compshare feedback` 反馈 CLI 问题和建议
37
+
38
+ ## 安装
39
+
40
+ ```bash
41
+ pip install compshare-cli
42
+ pip install --upgrade compshare-cli
43
+ ```
44
+
45
+ ## 配置
46
+
47
+ ```bash
48
+ compshare config --name default
49
+ ```
50
+
51
+ 凭证保存在 `~/.config/compshare/config.json`,支持多个配置:
52
+
53
+ ```bash
54
+ compshare config list
55
+ compshare config use production
56
+ compshare --profile production instance list
57
+ ```
58
+
59
+ 也可以使用环境变量:
60
+
61
+ ```bash
62
+ export COMPSHARE_PUBLIC_KEY='...'
63
+ export COMPSHARE_PRIVATE_KEY='...'
64
+ ```
65
+
66
+ ## 快速开始
67
+
68
+ ```bash
69
+ # 查询、创建和查看实例
70
+ compshare instance search --region cn-sh2 --zone cn-sh2-02
71
+ compshare instance create
72
+ compshare instance list --all
73
+
74
+ # 连接实例
75
+ compshare instance ssh INSTANCE_ID
76
+
77
+ # 查看帮助
78
+ compshare -h
79
+ compshare instance -h
80
+ ```
81
+
82
+ ## 命令概览
83
+
84
+ ```text
85
+ compshare config API 凭证配置
86
+ compshare feedback 反馈 CLI 问题或建议
87
+ compshare doctor 配置、鉴权、网络与 SSH 环境诊断
88
+ compshare ask 产品使用和计费问答
89
+ compshare instance GPU 实例、规格、库存、价格和生命周期
90
+ compshare image 平台、自定义、社区及共享镜像
91
+ compshare storage 云盘和 US3 挂载
92
+ compshare team 团队、邀请、成员额度、账单和审计
93
+ ```
94
+
95
+ ## Skill
96
+
97
+ 为 Codex、Claude Code、Cursor 等 AI Agent 安装 CompShare CLI Skill:
98
+
99
+ ```bash
100
+ npx skills add compshare-cn/compshare-cli --skill compshare-cli
101
+ ```
102
+
103
+ 完整说明见 [CompShare CLI Skill](skills/compshare-cli/SKILL.md)。
104
+
105
+ ## SDK
106
+
107
+ 如需通过 SDK 集成 CompShare API,可参考独立的
108
+ [CompShare Developer Examples](https://github.com/ucloud/compshare-developer-examples) 仓库。
109
+ 其中包含 Python、Go、Java、JavaScript 和 PHP 示例,覆盖 API 鉴权、GPU 实例创建、规格配置和状态查询。
@@ -137,9 +137,7 @@ def test_locate_disk_supports_detached_disk(monkeypatch) -> None:
137
137
  def fake_call(state, action, params):
138
138
  if action == "DescribeCompshareDisk":
139
139
  return {
140
- "DiskSet": [
141
- {"ResourceId": "udisk-1", "Zone": "cn-sh2-02", "MountInstance": ""}
142
- ]
140
+ "DiskSet": [{"ResourceId": "udisk-1", "Zone": "cn-sh2-02", "MountInstance": ""}]
143
141
  }
144
142
  return {"ZoneInfo": [{"Region": "cn-sh2", "Zone": "cn-sh2-02"}]}
145
143