gitcode-cli 0.10.3__py3-none-any.whl → 0.11.0__py3-none-any.whl
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.
- gc_cli/__init__.py +1 -1
- gc_cli/bin/gc-darwin-amd64 +0 -0
- gc_cli/bin/gc-darwin-arm64 +0 -0
- gc_cli/bin/gc-linux-amd64 +0 -0
- gc_cli/bin/gc-linux-arm64 +0 -0
- gc_cli/bin/gc-windows-amd64.exe +0 -0
- gc_cli/wrapper.py +10 -2
- {gitcode_cli-0.10.3.dist-info → gitcode_cli-0.11.0.dist-info}/METADATA +61 -16
- gitcode_cli-0.11.0.dist-info/RECORD +15 -0
- gitcode_cli-0.10.3.dist-info/RECORD +0 -15
- {gitcode_cli-0.10.3.dist-info → gitcode_cli-0.11.0.dist-info}/WHEEL +0 -0
- {gitcode_cli-0.10.3.dist-info → gitcode_cli-0.11.0.dist-info}/entry_points.txt +0 -0
- {gitcode_cli-0.10.3.dist-info → gitcode_cli-0.11.0.dist-info}/licenses/LICENSE +0 -0
- {gitcode_cli-0.10.3.dist-info → gitcode_cli-0.11.0.dist-info}/top_level.txt +0 -0
gc_cli/__init__.py
CHANGED
gc_cli/bin/gc-darwin-amd64
CHANGED
|
Binary file
|
gc_cli/bin/gc-darwin-arm64
CHANGED
|
Binary file
|
gc_cli/bin/gc-linux-amd64
CHANGED
|
Binary file
|
gc_cli/bin/gc-linux-arm64
CHANGED
|
Binary file
|
gc_cli/bin/gc-windows-amd64.exe
CHANGED
|
Binary file
|
gc_cli/wrapper.py
CHANGED
|
@@ -12,6 +12,9 @@ import sys
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
14
|
COMMAND_NAME_ENV = "GITCODE_CLI_COMMAND_NAME"
|
|
15
|
+
DISTRIBUTION_ENV = "GITCODE_CLI_DISTRIBUTION"
|
|
16
|
+
ENTRYPOINT_ENV = "GITCODE_CLI_ENTRYPOINT"
|
|
17
|
+
BINARY_ENV = "GITCODE_CLI_BINARY"
|
|
15
18
|
|
|
16
19
|
|
|
17
20
|
def get_binary_name() -> str:
|
|
@@ -26,14 +29,16 @@ def get_binary_name() -> str:
|
|
|
26
29
|
"aarch64": "arm64",
|
|
27
30
|
"arm64": "arm64",
|
|
28
31
|
}
|
|
29
|
-
arch = arch_map.get(machine
|
|
32
|
+
arch = arch_map.get(machine)
|
|
33
|
+
if arch is None:
|
|
34
|
+
raise RuntimeError(f"Unsupported platform: {system} {machine}")
|
|
30
35
|
|
|
31
36
|
# Map system to binary name
|
|
32
37
|
if system == "linux":
|
|
33
38
|
return f"gc-linux-{arch}"
|
|
34
39
|
elif system == "darwin":
|
|
35
40
|
return f"gc-darwin-{arch}"
|
|
36
|
-
elif system == "windows":
|
|
41
|
+
elif system == "windows" and arch == "amd64":
|
|
37
42
|
return "gc-windows-amd64.exe"
|
|
38
43
|
else:
|
|
39
44
|
raise RuntimeError(f"Unsupported platform: {system} {machine}")
|
|
@@ -80,6 +85,9 @@ def main() -> int:
|
|
|
80
85
|
ensure_executable(binary_path)
|
|
81
86
|
env = os.environ.copy()
|
|
82
87
|
env.setdefault(COMMAND_NAME_ENV, get_command_name())
|
|
88
|
+
env.setdefault(DISTRIBUTION_ENV, "pypi")
|
|
89
|
+
env.setdefault(ENTRYPOINT_ENV, str(Path(sys.argv[0]).resolve()))
|
|
90
|
+
env.setdefault(BINARY_ENV, str(binary_path.resolve()))
|
|
83
91
|
|
|
84
92
|
# Run the binary with all arguments
|
|
85
93
|
result = subprocess.run(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitcode-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0
|
|
4
4
|
Summary: GitCode CLI - Command line tool for GitCode
|
|
5
5
|
Author-email: GitCode CLI Contributors <support@gitcode.com>
|
|
6
6
|
Maintainer-email: GitCode CLI Contributors <support@gitcode.com>
|
|
@@ -67,6 +67,17 @@ GitCode CLI 把仓库、Issue、PR、Release 和 Actions 带回终端,让开
|
|
|
67
67
|
|
|
68
68
|
## 安装
|
|
69
69
|
|
|
70
|
+
推荐只让一个全局安装渠道拥有 `gc` / `gitcode`。Windows 普通用户和 Node/AI 环境优先使用 npm;macOS 优先 Homebrew;Debian/Ubuntu 优先 DEB;RHEL/Fedora 优先 RPM。Python wheel 建议放入 `pipx` 或虚拟环境,CI 建议固定版本并校验 checksum。
|
|
71
|
+
|
|
72
|
+
安装或升级后可离线检查实际命令来源和全部 PATH 候选:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
gitcode doctor install
|
|
76
|
+
gitcode doctor install --json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
诊断只读取公开的可执行文件、PATH 和本地安装 manifest,不读取认证配置或 Token,也不会卸载其他渠道或修改 PATH。
|
|
80
|
+
|
|
70
81
|
### 从源码构建
|
|
71
82
|
|
|
72
83
|
**前置要求:**
|
|
@@ -83,11 +94,8 @@ go build -o gc ./cmd/gc
|
|
|
83
94
|
mkdir -p ~/.local/bin
|
|
84
95
|
mv gc ~/.local/bin/
|
|
85
96
|
|
|
86
|
-
#
|
|
87
|
-
make
|
|
88
|
-
# 安装
|
|
89
|
-
mkdir -p ~/.local/bin
|
|
90
|
-
mv bin/gc ~/.local/bin/
|
|
97
|
+
# 方式二:构建并安装 gc/gitcode(带完整版本标签)
|
|
98
|
+
make install PREFIX="$HOME/.local"
|
|
91
99
|
|
|
92
100
|
# 添加到 PATH
|
|
93
101
|
export PATH="$HOME/.local/bin:$PATH"
|
|
@@ -103,10 +111,10 @@ export PATH="$HOME/.local/bin:$PATH"
|
|
|
103
111
|
|
|
104
112
|
```bash
|
|
105
113
|
# 从 Releases 下载 .deb 包
|
|
106
|
-
wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.
|
|
114
|
+
wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.0/gc_0.11.0_amd64.deb
|
|
107
115
|
|
|
108
116
|
# 安装
|
|
109
|
-
sudo dpkg -i gc_0.
|
|
117
|
+
sudo dpkg -i gc_0.11.0_amd64.deb
|
|
110
118
|
```
|
|
111
119
|
|
|
112
120
|
DEB/RPM packages install both `gc` and `gitcode`; on Linux they are equivalent.
|
|
@@ -115,15 +123,15 @@ DEB/RPM packages install both `gc` and `gitcode`; on Linux they are equivalent.
|
|
|
115
123
|
|
|
116
124
|
```bash
|
|
117
125
|
# 从 Releases 下载 .rpm 包
|
|
118
|
-
wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.
|
|
126
|
+
wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.0/gc-0.11.0-1.x86_64.rpm
|
|
119
127
|
|
|
120
128
|
# 安装
|
|
121
|
-
sudo rpm -i gc-0.
|
|
129
|
+
sudo rpm -i gc-0.11.0-1.x86_64.rpm
|
|
122
130
|
```
|
|
123
131
|
|
|
124
132
|
DEB/RPM packages install both `gc` and `gitcode`; on Linux they are equivalent.
|
|
125
133
|
|
|
126
|
-
### Wheel
|
|
134
|
+
### Wheel 包(跨平台、隔离安装)
|
|
127
135
|
|
|
128
136
|
从 Release 归档下载 wheel 包安装,**内置全平台二进制**(Linux x64/ARM、macOS Intel/Apple Silicon、Windows x64):
|
|
129
137
|
|
|
@@ -134,7 +142,7 @@ source .venv/bin/activate # Linux/macOS
|
|
|
134
142
|
# .\.venv\Scripts\Activate.ps1 # Windows PowerShell
|
|
135
143
|
|
|
136
144
|
# 安装(一行命令)
|
|
137
|
-
pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.
|
|
145
|
+
pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.0/gitcode_cli-0.11.0-py3-none-any.whl
|
|
138
146
|
|
|
139
147
|
# Windows PowerShell 中推荐使用 gitcode,避免 gc 被内置 Get-Content 别名覆盖
|
|
140
148
|
gitcode version
|
|
@@ -143,6 +151,7 @@ gitcode version
|
|
|
143
151
|
说明:
|
|
144
152
|
- wheel 会同时安装 `gc` 和 `gitcode` 两个命令入口,功能相同。
|
|
145
153
|
- DEB/RPM 包也会同时安装 `gc` 和 `gitcode`;Linux 上二者功能相同。
|
|
154
|
+
- 不建议让 pip user install 与 DEB/RPM/Homebrew/npm 同时提供全局命令。已混用时先运行 `gitcode doctor install` 确认实际选中路径,再由用户明确选择调整 PATH、升级原渠道或卸载旧渠道;CLI 不会代替用户调用其他包管理器。
|
|
146
155
|
- Windows 使用 `py -m pip install --user ...` 时,脚本会安装到 Python user scheme 的 `Scripts` 目录。请运行 `py -c "import os, sysconfig; print(sysconfig.get_path('scripts', os.name + '_user'))"` 获取准确路径,将其加入用户 `PATH` 后重新打开终端;配置前可直接运行 `py -m gc_cli version`。
|
|
147
156
|
- Windows PowerShell 预置 `gc` 作为 `Get-Content` 别名;如果 `gc version` 被解析为读取文件,请改用 `gitcode version`、`gc.exe version` 或 `py -m gc_cli version`。
|
|
148
157
|
- Windows PowerShell 中通过 `--body-file -` / `--comment-file -` 管道传入中文或其他非 ASCII 正文时,推荐使用 UTF-8 文件;如果必须直接管道,先设置 `$OutputEncoding = [System.Text.UTF8Encoding]::new($false)`。CLI 会拦截疑似已被 PowerShell 损坏成 `???` 的输入并提示正确用法。
|
|
@@ -163,7 +172,7 @@ source .venv/bin/activate # Linux/macOS
|
|
|
163
172
|
# .\.venv\Scripts\Activate.ps1 # Windows PowerShell
|
|
164
173
|
|
|
165
174
|
# 固定版本安装,避免 PyPI 尚未同步时安装旧版本
|
|
166
|
-
python -m pip install -i https://pypi.org/simple/ gitcode-cli==0.
|
|
175
|
+
python -m pip install -i https://pypi.org/simple/ gitcode-cli==0.11.0
|
|
167
176
|
|
|
168
177
|
# Windows PowerShell 中推荐使用 gitcode
|
|
169
178
|
gitcode version
|
|
@@ -185,13 +194,16 @@ gitcode version
|
|
|
185
194
|
```bash
|
|
186
195
|
chmod +x gc_linux_amd64
|
|
187
196
|
mv gc_linux_amd64 ~/.local/bin/gc
|
|
197
|
+
ln -s gc ~/.local/bin/gitcode
|
|
188
198
|
gc version
|
|
189
199
|
```
|
|
190
200
|
|
|
191
|
-
|
|
201
|
+
需要与系统包管理器隔离时可使用上方 wheel;需要免安装直接部署时使用独立二进制。二者都应先确认平台架构受支持。
|
|
192
202
|
|
|
193
203
|
### Docker 镜像
|
|
194
204
|
|
|
205
|
+
> **用途说明**:本仓库 Docker 配置面向开发/构建环境。`docker compose up gc` 默认执行 `gc --help` 展示用法后退出(CLI 工具非长期服务)。交互式使用 `docker run -it --entrypoint bash gitcode/gc:dev`(进入 shell)或 `docker run -it gitcode/gc:dev <子命令>`(如 `auth login`)。
|
|
206
|
+
|
|
195
207
|
仓库已提供 `Dockerfile`、`docker-compose.yml` 和 Makefile 目标:
|
|
196
208
|
|
|
197
209
|
```bash
|
|
@@ -227,6 +239,7 @@ brew upgrade gc
|
|
|
227
239
|
```
|
|
228
240
|
|
|
229
241
|
shell 补全(bash/zsh/fish)随安装自动配置,无需额外操作。
|
|
242
|
+
Homebrew 同时提供 `gc` 与 `gitcode`;升级后可运行 `gitcode doctor install` 检查是否仍被 pip/npm 旧入口遮蔽。
|
|
230
243
|
|
|
231
244
|
### npm (跨平台)
|
|
232
245
|
|
|
@@ -240,10 +253,39 @@ npx @gitcode-cli/cli@latest install
|
|
|
240
253
|
|
|
241
254
|
```bash
|
|
242
255
|
npm install -g @gitcode-cli/cli
|
|
243
|
-
|
|
256
|
+
gitcode version
|
|
244
257
|
```
|
|
245
258
|
|
|
246
|
-
|
|
259
|
+
如果 `gitcode version` 仍显示旧的 pip/wheel 版本,先直接调用 npm 安装目录中的新入口诊断,不必先卸载 pip:
|
|
260
|
+
|
|
261
|
+
```powershell
|
|
262
|
+
# Windows PowerShell
|
|
263
|
+
& "$(npm prefix -g)\gitcode.cmd" doctor install --json
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Linux/macOS
|
|
268
|
+
"$(npm prefix -g)/bin/gitcode" doctor install --json
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
包内置 Linux/macOS/Windows 多平台二进制。Windows bootstrap 同时安装 `gc.exe` 和 `gitcode.exe`,PowerShell 请使用 `gitcode`,避免内置 `gc`/`Get-Content` alias。
|
|
272
|
+
|
|
273
|
+
npm global 与 npm bootstrap 默认使用 `notify` 模式:命令本身立即执行,24 小时 TTL 到期后在后台检查 stable `latest`,发现新版后在下一次启动提示 `gitcode update`,不会自动安装,也不会改变刚完成命令的退出码。需要自动应用的用户可明确启用 `auto`;该模式具有跨进程锁、版本健康检查和失败回滚。
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
gitcode update --check # 只检查
|
|
277
|
+
gitcode update # 显式更新当前 npm 渠道
|
|
278
|
+
gitcode update --json
|
|
279
|
+
|
|
280
|
+
gitcode config set update.mode auto
|
|
281
|
+
gitcode config set update.mode notify
|
|
282
|
+
gitcode config set update.mode off
|
|
283
|
+
|
|
284
|
+
gitcode --no-update-check version # 单次禁用
|
|
285
|
+
GC_NO_UPDATE_CHECK=1 gitcode version
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
`CI=true`、`--no-interactive`、`--no-update-check` 或 `GC_NO_UPDATE_CHECK=1` 会禁用后台检查。更新器仅从官方 `https://registry.npmjs.org` 获取精确 stable 版本,安装时禁用生命周期脚本,并以最小环境启动;它不会调用 pip、Homebrew、apt、dnf,也不会静默修改 PATH。npm 生命周期脚本被组织策略禁用时,可直接运行 npm prefix 中的 `gitcode` 再执行 `doctor install`;wrapper 会在首次直接运行时补建来源 metadata。
|
|
247
289
|
|
|
248
290
|
### 规划中的安装方式
|
|
249
291
|
|
|
@@ -381,6 +423,9 @@ gitcode actions artifact download <artifact-id> -R owner/repo --output artifact.
|
|
|
381
423
|
# 删除 artifact
|
|
382
424
|
gitcode actions artifact delete <artifact-id> -R owner/repo --yes
|
|
383
425
|
|
|
426
|
+
# 校验 workflow YAML
|
|
427
|
+
gitcode actions yaml validate --file .gitcode/workflows/ci.yml -R owner/repo
|
|
428
|
+
|
|
384
429
|
# 调用 GitCode API 原始响应
|
|
385
430
|
gitcode api repos/owner/repo
|
|
386
431
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
gc_cli/__init__.py,sha256=SRx6SgapEnoX7KGX9Vs50Nmsjj_irrC6hWn8Dn5WaL8,243
|
|
2
|
+
gc_cli/__main__.py,sha256=fqZ9iOh0ac8K_B9WmHydaxokzIivd5QBPJoNqgXnugo,154
|
|
3
|
+
gc_cli/wrapper.py,sha256=Q_NathDiUKF5C4D-TEQd5Ky_y2GN88pqS2IybKKOkRs,3155
|
|
4
|
+
gc_cli/bin/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
gc_cli/bin/gc-darwin-amd64,sha256=mbmV5HoqO8AK1pSnlJ6Hg6T5p1BMOrSsCAb7QflX6aw,9839120
|
|
6
|
+
gc_cli/bin/gc-darwin-arm64,sha256=_PDFZsQ4kIkUFrs3sq2IoKqwCZPd4WKVdwyrU-uxgfs,9462706
|
|
7
|
+
gc_cli/bin/gc-linux-amd64,sha256=Xp89s4iDL9aDo4kEwxIByLncnsg-mECgm2zdaqLCT5I,8954008
|
|
8
|
+
gc_cli/bin/gc-linux-arm64,sha256=4xay9PYrQvyfVNJGgDRqtm1SY4apR_HxjtsKivGHZY8,8519832
|
|
9
|
+
gc_cli/bin/gc-windows-amd64.exe,sha256=JXFMgV4-NswXeeK7ZUFkRUesk75IOHC3YYePjsisFpI,9246720
|
|
10
|
+
gitcode_cli-0.11.0.dist-info/licenses/LICENSE,sha256=dViNRlgMSkfn1udYjx-DEm8D6e182mc47gnLUMNjI24,1254
|
|
11
|
+
gitcode_cli-0.11.0.dist-info/METADATA,sha256=4B5olNklTItcWbRlHY4o57Ur3oWNA8ZpEQhesDF21_E,17045
|
|
12
|
+
gitcode_cli-0.11.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
gitcode_cli-0.11.0.dist-info/entry_points.txt,sha256=DresfT5jkpwU3fPn8n0MTao1m5QZi3XEulKFbQ8BYYY,73
|
|
14
|
+
gitcode_cli-0.11.0.dist-info/top_level.txt,sha256=2fSmR3kQ-XhdgFQdVvWmZcEyERJKVZVxOhk7tna1Sus,7
|
|
15
|
+
gitcode_cli-0.11.0.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
gc_cli/__init__.py,sha256=AHHDLHHlpTlsTScHP-KhJhSCTNWFmZbhht1Eyop6w04,243
|
|
2
|
-
gc_cli/__main__.py,sha256=fqZ9iOh0ac8K_B9WmHydaxokzIivd5QBPJoNqgXnugo,154
|
|
3
|
-
gc_cli/wrapper.py,sha256=vq6JZIs7nZx_FugIljMjpNb0nxTiC0lQqfZ7Dhz6aMw,2744
|
|
4
|
-
gc_cli/bin/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
gc_cli/bin/gc-darwin-amd64,sha256=iVg_M1wq3UyTCL2zn6-CgbCtQO_ZNRQUE6tr0MsWzdI,9681536
|
|
6
|
-
gc_cli/bin/gc-darwin-arm64,sha256=V_tMzKsO-nwxN-NKF5o2_EezDz2k-v4H8eu5j8ySicw,9316258
|
|
7
|
-
gc_cli/bin/gc-linux-amd64,sha256=0gwvP7Ua-lD189nF5CQI6_GuFkFMeQzHsJArxzEtJoY,8802456
|
|
8
|
-
gc_cli/bin/gc-linux-arm64,sha256=eRUuCXQr1QMYtOP9NT2Rm_I_czjuX5xdVuvic6Y8IeE,8454296
|
|
9
|
-
gc_cli/bin/gc-windows-amd64.exe,sha256=dfW8mx5xxKxQQ0xDcFHdnnGsVOjMcfiRq2hWlmjHmKw,9102336
|
|
10
|
-
gitcode_cli-0.10.3.dist-info/licenses/LICENSE,sha256=dViNRlgMSkfn1udYjx-DEm8D6e182mc47gnLUMNjI24,1254
|
|
11
|
-
gitcode_cli-0.10.3.dist-info/METADATA,sha256=ZS9OqnfDVoCemFqAUGKx2EV_TYU-ccquqO-_jzymNdQ,13987
|
|
12
|
-
gitcode_cli-0.10.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
-
gitcode_cli-0.10.3.dist-info/entry_points.txt,sha256=DresfT5jkpwU3fPn8n0MTao1m5QZi3XEulKFbQ8BYYY,73
|
|
14
|
-
gitcode_cli-0.10.3.dist-info/top_level.txt,sha256=2fSmR3kQ-XhdgFQdVvWmZcEyERJKVZVxOhk7tna1Sus,7
|
|
15
|
-
gitcode_cli-0.10.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|