gitcode-cli 0.2.13__py3-none-any.whl → 0.5.6__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 CHANGED
@@ -1,11 +1,11 @@
1
- """
2
- GitCode CLI - Command line tool for GitCode.
3
-
4
- This package provides a Python wrapper for the gc binary.
5
- """
6
-
7
- __version__ = "0.2.13"
8
- __author__ = "GitCode CLI Contributors"
9
- __all__ = ["__version__", "main"]
10
-
11
- from gc_cli.wrapper import main
1
+ """
2
+ GitCode CLI - Command line tool for GitCode.
3
+
4
+ This package provides a Python wrapper for the gc binary.
5
+ """
6
+
7
+ __version__ = "0.5.6"
8
+ __author__ = "GitCode CLI Contributors"
9
+ __all__ = ["__version__", "main"]
10
+
11
+ from gc_cli.wrapper import main
gc_cli/__main__.py ADDED
@@ -0,0 +1,9 @@
1
+ """Allow running GitCode CLI with ``python -m gc_cli``."""
2
+
3
+ import sys
4
+
5
+ from gc_cli.wrapper import main
6
+
7
+
8
+ if __name__ == "__main__":
9
+ sys.exit(main())
gc_cli/bin/.gitkeep CHANGED
File without changes
Binary file
Binary file
gc_cli/bin/gc-linux-amd64 CHANGED
Binary file
gc_cli/bin/gc-linux-arm64 CHANGED
Binary file
Binary file
gc_cli/wrapper.py CHANGED
@@ -1,81 +1,102 @@
1
- """
2
- Wrapper module for GitCode CLI binary.
3
-
4
- This module provides a Python entry point that calls the appropriate
5
- pre-compiled binary based on the current platform.
6
- """
7
-
8
- import os
9
- import platform
10
- import subprocess
11
- import sys
12
- from pathlib import Path
13
-
14
-
15
- def get_binary_name() -> str:
16
- """Get the binary name for the current platform."""
17
- system = platform.system().lower()
18
- machine = platform.machine().lower()
19
-
20
- # Map machine architecture
21
- arch_map = {
22
- "x86_64": "amd64",
23
- "amd64": "amd64",
24
- "aarch64": "arm64",
25
- "arm64": "arm64",
26
- }
27
- arch = arch_map.get(machine, "amd64")
28
-
29
- # Map system to binary name
30
- if system == "linux":
31
- return f"gc-linux-{arch}"
32
- elif system == "darwin":
33
- return f"gc-darwin-{arch}"
34
- elif system == "windows":
35
- return "gc-windows-amd64.exe"
36
- else:
37
- raise RuntimeError(f"Unsupported platform: {system} {machine}")
38
-
39
-
40
- def get_binary_path() -> Path:
41
- """Get the path to the binary for the current platform."""
42
- package_dir = Path(__file__).parent
43
- binary_name = get_binary_name()
44
- binary_path = package_dir / "bin" / binary_name
45
-
46
- if not binary_path.exists():
47
- raise FileNotFoundError(
48
- f"Binary not found for your platform: {binary_path}\n"
49
- f"Supported platforms: linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64"
50
- )
51
-
52
- return binary_path
53
-
54
-
55
- def main() -> int:
56
- """Main entry point for the gc command."""
57
- try:
58
- binary_path = get_binary_path()
59
-
60
- # Make sure the binary is executable
61
- if not os.access(binary_path, os.X_OK):
62
- binary_path.chmod(0o755)
63
-
64
- # Run the binary with all arguments
65
- result = subprocess.run(
66
- [str(binary_path)] + sys.argv[1:],
67
- cwd=os.getcwd(),
68
- )
69
-
70
- return result.returncode
71
-
72
- except FileNotFoundError as e:
73
- print(f"Error: {e}", file=sys.stderr)
74
- return 1
75
- except Exception as e:
76
- print(f"Error running gc: {e}", file=sys.stderr)
77
- return 1
78
-
79
-
80
- if __name__ == "__main__":
81
- sys.exit(main())
1
+ """
2
+ Wrapper module for GitCode CLI binary.
3
+
4
+ This module provides a Python entry point that calls the appropriate
5
+ pre-compiled binary based on the current platform.
6
+ """
7
+
8
+ import os
9
+ import platform
10
+ import subprocess
11
+ import sys
12
+ from pathlib import Path
13
+
14
+ COMMAND_NAME_ENV = "GITCODE_CLI_COMMAND_NAME"
15
+
16
+
17
+ def get_binary_name() -> str:
18
+ """Get the binary name for the current platform."""
19
+ system = platform.system().lower()
20
+ machine = platform.machine().lower()
21
+
22
+ # Map machine architecture
23
+ arch_map = {
24
+ "x86_64": "amd64",
25
+ "amd64": "amd64",
26
+ "aarch64": "arm64",
27
+ "arm64": "arm64",
28
+ }
29
+ arch = arch_map.get(machine, "amd64")
30
+
31
+ # Map system to binary name
32
+ if system == "linux":
33
+ return f"gc-linux-{arch}"
34
+ elif system == "darwin":
35
+ return f"gc-darwin-{arch}"
36
+ elif system == "windows":
37
+ return "gc-windows-amd64.exe"
38
+ else:
39
+ raise RuntimeError(f"Unsupported platform: {system} {machine}")
40
+
41
+
42
+ def get_binary_path() -> Path:
43
+ """Get the path to the binary for the current platform."""
44
+ package_dir = Path(__file__).parent
45
+ binary_name = get_binary_name()
46
+ binary_path = package_dir / "bin" / binary_name
47
+
48
+ if not binary_path.exists():
49
+ raise FileNotFoundError(
50
+ f"Binary not found for your platform: {binary_path}\n"
51
+ f"Supported platforms: linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64"
52
+ )
53
+
54
+ return binary_path
55
+
56
+
57
+ def get_command_name() -> str:
58
+ """Get the command name that should appear in CLI output."""
59
+ command = Path(sys.argv[0]).stem.lower()
60
+ if command in {"gc", "gitcode"}:
61
+ return command
62
+ if platform.system() == "Windows":
63
+ return "gitcode"
64
+ return "gc"
65
+
66
+
67
+ def ensure_executable(binary_path: Path) -> None:
68
+ """Ensure packaged binaries are executable on POSIX platforms."""
69
+ if platform.system() == "Windows":
70
+ return
71
+ if not os.access(binary_path, os.X_OK):
72
+ binary_path.chmod(0o755)
73
+
74
+
75
+ def main() -> int:
76
+ """Main entry point for the GitCode CLI command."""
77
+ try:
78
+ binary_path = get_binary_path()
79
+
80
+ ensure_executable(binary_path)
81
+ env = os.environ.copy()
82
+ env.setdefault(COMMAND_NAME_ENV, get_command_name())
83
+
84
+ # Run the binary with all arguments
85
+ result = subprocess.run(
86
+ [str(binary_path)] + sys.argv[1:],
87
+ cwd=os.getcwd(),
88
+ env=env,
89
+ )
90
+
91
+ return result.returncode
92
+
93
+ except FileNotFoundError as e:
94
+ print(f"Error: {e}", file=sys.stderr)
95
+ return 1
96
+ except Exception as e:
97
+ print(f"Error running GitCode CLI: {e}", file=sys.stderr)
98
+ return 1
99
+
100
+
101
+ if __name__ == "__main__":
102
+ sys.exit(main())
@@ -0,0 +1,369 @@
1
+ Metadata-Version: 2.4
2
+ Name: gitcode-cli
3
+ Version: 0.5.6
4
+ Summary: GitCode CLI - Command line tool for GitCode
5
+ Author-email: GitCode CLI Contributors <support@gitcode.com>
6
+ Maintainer-email: GitCode CLI Contributors <support@gitcode.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://gitcode.com/gitcode-cli/cli
9
+ Project-URL: Documentation, https://gitcode.com/gitcode-cli/cli
10
+ Project-URL: Repository, https://gitcode.com/gitcode-cli/cli
11
+ Project-URL: Issues, https://gitcode.com/gitcode-cli/cli/issues
12
+ Keywords: gitcode,cli,git,devops
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Software Development
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Dynamic: license-file
29
+
30
+ # GitCode CLI
31
+
32
+ [![AI 操作指南](https://img.shields.io/badge/📖_使用_AI_操作_GitCode_指南-点击查看-FF6B6B?style=for-the-badge)](./docs/AI-GUIDE.md)
33
+
34
+ [![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?style=flat&logo=go)](https://golang.org)
35
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
36
+ [![Release](https://img.shields.io/badge/Release-v0.5.6-blue)](https://gitcode.com/gitcode-cli/cli/releases)
37
+
38
+ GitCode 命令行工具,为 GitCode 用户提供便捷的命令行操作体验。
39
+
40
+ ## 文档导航
41
+
42
+ 按角色建议从以下入口开始:
43
+
44
+ | 角色 | 入口 |
45
+ |------|------|
46
+ | 使用者 | [docs/README.md](./docs/README.md) |
47
+ | 开发者 | [spec/README.md](./spec/README.md) |
48
+ | Codex / 代理 | [AGENTS.md](./AGENTS.md) |
49
+ | Claude | [CLAUDE.md](./CLAUDE.md) |
50
+
51
+ 主要文档:
52
+
53
+ - [命令手册](./docs/COMMANDS.md)
54
+ - [认证说明](./docs/AUTH.md)
55
+ - [回归说明](./docs/REGRESSION.md)
56
+ - [打包说明](./docs/PACKAGING.md)
57
+ - [AI 操作指南(外部项目)](./docs/AI-GUIDE.md)
58
+ - [开发规范](./spec/README.md)
59
+ - [真相源矩阵](./spec/governance/source-of-truth-matrix.md)
60
+ - [AI 本地开发流程](./spec/workflows/ai-local-development-workflow.md)
61
+ - [阶段说明](./issues-plan/PROGRESS.md)
62
+
63
+ ## 安装
64
+
65
+ ### 从源码构建
66
+
67
+ **前置要求:**
68
+ - Go 1.22+
69
+
70
+ ```bash
71
+ # 克隆仓库(需要 git clone 才能获取版本信息)
72
+ git clone https://gitcode.com/gitcode-cli/cli.git
73
+ cd cli
74
+
75
+ # 方式一:使用 go build(推荐)
76
+ go build -o gc ./cmd/gc
77
+ # 安装
78
+ mkdir -p ~/.local/bin
79
+ mv gc ~/.local/bin/
80
+
81
+ # 方式二:使用 make build(带完整版本标签)
82
+ make build
83
+ # 安装
84
+ mkdir -p ~/.local/bin
85
+ mv bin/gc ~/.local/bin/
86
+
87
+ # 添加到 PATH
88
+ export PATH="$HOME/.local/bin:$PATH"
89
+ ```
90
+
91
+ > **说明**:
92
+ > - `go build` 从 `debug.ReadBuildInfo()` 自动获取 git commit 和构建时间(需要 `git clone` 源码)。
93
+ > - `make build` 使用 `-ldflags` 注入完整版本标签(如 `v0.3.11-38-g1128f2b`)。
94
+
95
+ ### Linux 包管理器
96
+
97
+ **DEB (Debian/Ubuntu):**
98
+
99
+ ```bash
100
+ # 从 Releases 下载 .deb 包
101
+ wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.5.6/gc_0.5.6_amd64.deb
102
+
103
+ # 安装
104
+ sudo dpkg -i gc_0.5.6_amd64.deb
105
+ ```
106
+
107
+ DEB/RPM packages install both `gc` and `gitcode`; on Linux they are equivalent.
108
+
109
+ **RPM (RHEL/CentOS/Fedora):**
110
+
111
+ ```bash
112
+ # 从 Releases 下载 .rpm 包
113
+ wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.5.6/gc-0.5.6-1.x86_64.rpm
114
+
115
+ # 安装
116
+ sudo rpm -i gc-0.5.6-1.x86_64.rpm
117
+ ```
118
+
119
+ DEB/RPM packages install both `gc` and `gitcode`; on Linux they are equivalent.
120
+
121
+ ### Wheel 包(跨平台,推荐)
122
+
123
+ 从 Release 归档下载 wheel 包安装,**内置全平台二进制**(Linux x64/ARM、macOS Intel/Apple Silicon、Windows x64):
124
+
125
+ ```bash
126
+ # 创建虚拟环境
127
+ python3 -m venv .venv
128
+ source .venv/bin/activate # Linux/macOS
129
+ # .venv\Scripts\activate # Windows
130
+
131
+ # 安装(一行命令)
132
+ pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.5.6/gitcode_cli-0.5.6-py3-none-any.whl
133
+
134
+ # Windows PowerShell 中推荐使用 gitcode,避免 gc 被内置 Get-Content 别名覆盖
135
+ gitcode version
136
+ ```
137
+
138
+ 说明:
139
+ - wheel 会同时安装 `gc` 和 `gitcode` 两个命令入口,功能相同。
140
+ - DEB/RPM 包也会同时安装 `gc` 和 `gitcode`;Linux 上二者功能相同。
141
+ - Windows PowerShell 预置 `gc` 作为 `Get-Content` 别名;如果 `gc version` 被解析为读取文件,请改用 `gitcode version`、`gc.exe version` 或 `python -m gc_cli version`。
142
+
143
+ ### PyPI(备选)
144
+
145
+ ```bash
146
+ # 创建虚拟环境
147
+ python3 -m venv .venv
148
+ source .venv/bin/activate # Linux/macOS
149
+ # .venv\Scripts\activate # Windows
150
+
151
+ # 安装
152
+ pip install gitcode-cli
153
+
154
+ # Windows PowerShell 中推荐使用 gitcode
155
+ gitcode version
156
+ ```
157
+
158
+ ### 预编译二进制文件
159
+
160
+ 从 Release Assets 直接下载对应平台的二进制文件:
161
+
162
+ | 平台 | 文件 |
163
+ |------|------|
164
+ | Linux x64 | `gc_<version>_linux_amd64.tar.gz` |
165
+ | Linux ARM64 | `gc_<version>_linux_arm64.tar.gz` |
166
+ | macOS Intel | `gc_<version>_darwin_amd64.tar.gz` |
167
+ | macOS Apple Silicon | `gc_<version>_darwin_arm64.tar.gz` |
168
+ | Windows x64 | `gc_<version>_windows_amd64.zip` |
169
+
170
+ 下载地址: https://gitcode.com/gitcode-cli/cli/releases
171
+
172
+ 解压后将二进制文件放到 PATH 目录:
173
+
174
+ ```bash
175
+ # Linux/macOS
176
+ tar -xzf gc_*.tar.gz
177
+ mv gc ~/.local/bin/
178
+
179
+ # Windows
180
+ # 解压 zip 文件后,将 gc.exe 放到 PATH 目录
181
+ ```
182
+
183
+ ### 规划中的安装方式
184
+
185
+ 以下安装方式正在开发中:
186
+
187
+ - [ ] Homebrew (macOS/Linux)
188
+ - [ ] Scoop (Windows)
189
+ - [ ] Docker 镜像
190
+
191
+ ## 快速开始
192
+
193
+ ### 认证
194
+
195
+ **方式一:设置环境变量(推荐)**
196
+
197
+ ```bash
198
+ # 设置 Token 环境变量
199
+ export GC_TOKEN="your_gitcode_token"
200
+
201
+ # 或使用备用变量名
202
+ export GITCODE_TOKEN="your_gitcode_token"
203
+
204
+ # 添加到 shell 配置文件(永久生效)
205
+ echo 'export GC_TOKEN="your_gitcode_token"' >> ~/.bashrc
206
+ source ~/.bashrc
207
+ ```
208
+
209
+ **方式二:交互式登录**
210
+
211
+ ```bash
212
+ # 交互式登录(需输入 Token)
213
+ gc auth login
214
+
215
+ # 非交互登录(从 stdin 读取 Token)
216
+ echo "YOUR_TOKEN" | gc auth login --with-token
217
+ ```
218
+
219
+ 当前版本认证优先级:
220
+
221
+ 1. `GC_TOKEN`
222
+ 2. `GITCODE_TOKEN`
223
+ 3. 本地登录配置
224
+
225
+ 说明:
226
+ - `gc auth login` 会将认证信息持久化到本地配置目录
227
+ - 如果设置了环境变量,环境变量始终覆盖本地配置
228
+ - `gc auth logout` 只清理本地配置,不会自动取消环境变量
229
+ - 详细规则见 [docs/AUTH.md](./docs/AUTH.md)
230
+
231
+ **获取 Token:**
232
+ 1. 登录 [GitCode](https://gitcode.com)
233
+ 2. 进入 设置 -> 私人令牌
234
+ 3. 点击"生成新令牌",选择所需权限
235
+ 4. 复制生成的 Token
236
+
237
+ **验证认证:**
238
+
239
+ ```bash
240
+ # 查看认证状态
241
+ gc auth status
242
+ ```
243
+
244
+ > 详细命令行为和完整示例请查看 [docs/COMMANDS.md](./docs/COMMANDS.md)。
245
+
246
+ ## 输出格式
247
+
248
+ `gc` 的只读命令继续以文本输出为默认体验,同时为脚本和代理保留稳定的结构化入口。
249
+
250
+ ```bash
251
+ # 结构化输出
252
+ gc issue list -R owner/repo --json
253
+ gc issue list -R owner/repo --format json
254
+
255
+ # 常规文本与表格
256
+ gc issue list -R owner/repo --format simple
257
+ gc issue list -R owner/repo --format table
258
+
259
+ # 时间格式切换
260
+ gc issue list -R owner/repo --time-format absolute
261
+ gc issue list -R owner/repo --time-format relative
262
+
263
+ # 自定义模板输出
264
+ gc issue list -R owner/repo --template '{{range .}}#{{.Number}} {{.Title}}{{"\n"}}{{end}}'
265
+ ```
266
+
267
+ `issue view` 和 `pr view` 的文本详情展示也会保持稳定布局,而 `--json` 仍然是面向机器调用的首选入口。
268
+
269
+ ## 常见任务入口
270
+
271
+ 最常用的起步命令:
272
+
273
+ ```bash
274
+ # 查看仓库
275
+ gc repo view
276
+
277
+ # 创建 Issue
278
+ gc issue create --title "Bug report" --body "Description"
279
+
280
+ # 列出 Issues
281
+ gc issue list --state open
282
+
283
+ # 创建 PR
284
+ gc pr create --title "New feature" --base main
285
+
286
+ # 查看认证状态
287
+ gc auth status
288
+ ```
289
+
290
+ 完整命令说明、参数细节、平台限制和更多示例,请直接查看:
291
+
292
+ - [docs/COMMANDS.md](./docs/COMMANDS.md)
293
+ - [docs/AUTH.md](./docs/AUTH.md)
294
+ - [docs/PACKAGING.md](./docs/PACKAGING.md)
295
+ - [docs/REGRESSION.md](./docs/REGRESSION.md)
296
+
297
+ ## Shell 补全
298
+
299
+ ```bash
300
+ # Bash
301
+ gc completion bash > /etc/bash_completion.d/gc
302
+ source ~/.bashrc
303
+
304
+ # Zsh
305
+ gc completion zsh > "${fpath[1]}/_gc"
306
+ source ~/.zshrc
307
+
308
+ # Fish
309
+ gc completion fish > ~/.config/fish/completions/gc.fish
310
+ source ~/.config/fish/config.fish
311
+ ```
312
+
313
+ ## 项目定位
314
+
315
+ 当前仓库已经建立:
316
+
317
+ - 用户文档入口:[`docs/`](./docs/README.md)
318
+ - 正式规范入口:[`spec/`](./spec/README.md)
319
+ - Codex 入口:[`AGENTS.md`](./AGENTS.md)
320
+ - Claude 入口:[`CLAUDE.md`](./CLAUDE.md)
321
+
322
+ 如果你要看完整规范、构建与发布规则、质量门禁和 AI 协作边界,请直接进入对应入口,不要仅依赖本 README。
323
+
324
+ 补充说明:
325
+
326
+ - `docs/AI-GUIDE.md` 只服务外部项目通过 AI 使用 `gc`
327
+ - gitcode-cli 仓库内部 AI 开发请看 `AGENTS.md`、`CLAUDE.md` 和 `spec/workflows/ai-local-development-workflow.md`
328
+ - `issues-plan/PROGRESS.md` 只作为阶段说明,不作为单个 issue / PR 的实时事实依据
329
+
330
+ ## 开发
331
+
332
+ ```bash
333
+ # 克隆仓库
334
+ git clone https://gitcode.com/gitcode-cli/cli.git
335
+ cd gitcode-cli
336
+
337
+ # 安装依赖
338
+ make deps
339
+
340
+ # 构建
341
+ make build
342
+
343
+ # 运行测试
344
+ make test
345
+
346
+ # 代码检查
347
+ make lint
348
+
349
+ # 运行
350
+ make run
351
+ ```
352
+
353
+ ## 贡献
354
+
355
+ 欢迎贡献代码。开始前请查看 [贡献指南](./CONTRIBUTING.md) 和 [spec/README.md](./spec/README.md)。
356
+
357
+ ## 许可证
358
+
359
+ [MIT License](./LICENSE)
360
+
361
+ ## 致谢
362
+
363
+ 本项目参考了 [GitHub CLI](https://github.com/cli/cli) 的设计与实现,感谢 GitHub 团队的开源贡献。
364
+
365
+ ## 相关链接
366
+
367
+ - [GitCode](https://gitcode.com) - GitCode 平台
368
+ - [API 文档](https://gitcode.com/docs/api) - GitCode API 参考
369
+ - [问题反馈](https://gitcode.com/gitcode-cli/cli/issues) - 提交 Bug 或建议
@@ -0,0 +1,15 @@
1
+ gc_cli/__init__.py,sha256=l_OpIkPo6SlFroXTduc6g5o-yJuM_cMoqe8IFaaA8qU,253
2
+ gc_cli/__main__.py,sha256=4IoaQc5w_ZsLDqiDifrGjllM76LLLUM2CSz2ifmwMmY,163
3
+ gc_cli/wrapper.py,sha256=-nQsDyCvTunhgK24tuJ_tjqJJ1ErRs0hPfdHmUh1JDM,2846
4
+ gc_cli/bin/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ gc_cli/bin/gc-darwin-amd64,sha256=gRCdZW0TphbgAGjxBK3_fOFYShpBLqaB_5CbYBWsMJM,8368128
6
+ gc_cli/bin/gc-darwin-arm64,sha256=3WpR-63eMr0Rk6of4wU3IaZe3ZmnaAWAfX-9AV2PDDg,8033042
7
+ gc_cli/bin/gc-linux-amd64,sha256=mgana9mqM5EFIuOsp8Mi43UaKRPaBK4-9lNKSFzPwq8,8147096
8
+ gc_cli/bin/gc-linux-arm64,sha256=41R_0LV0WRczjBTxyUPbmZcjOeeKj0BA575kmh-pst8,7864472
9
+ gc_cli/bin/gc-windows-amd64.exe,sha256=g9ncLNfjFcVOpfDSzHrA5u_Y75JmiIzr3G0CqeZdhtU,8434688
10
+ gitcode_cli-0.5.6.dist-info/licenses/LICENSE,sha256=23d4Rfrm1CLX092oLjzs2UTYcy5Sp-dpaji0IAHIsiE,1280
11
+ gitcode_cli-0.5.6.dist-info/METADATA,sha256=ilNBG6oVhxKB0PFpx6W1GbnvPV3SytTqEAh6egkLCek,9918
12
+ gitcode_cli-0.5.6.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
13
+ gitcode_cli-0.5.6.dist-info/entry_points.txt,sha256=DresfT5jkpwU3fPn8n0MTao1m5QZi3XEulKFbQ8BYYY,73
14
+ gitcode_cli-0.5.6.dist-info/top_level.txt,sha256=2fSmR3kQ-XhdgFQdVvWmZcEyERJKVZVxOhk7tna1Sus,7
15
+ gitcode_cli-0.5.6.dist-info/RECORD,,
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  gc = gc_cli.wrapper:main
3
+ gitcode = gc_cli.wrapper:main
@@ -1,28 +1,28 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 gitcode-cli contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
23
- ---
24
-
25
- This project is inspired by and references the GitHub CLI (https://github.com/cli/cli),
26
- which is also licensed under the MIT License.
27
-
1
+ MIT License
2
+
3
+ Copyright (c) 2026 gitcode-cli contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ This project is inspired by and references the GitHub CLI (https://github.com/cli/cli),
26
+ which is also licensed under the MIT License.
27
+
28
28
  Copyright (c) 2019 GitHub, Inc.
@@ -1,392 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: gitcode-cli
3
- Version: 0.2.13
4
- Summary: GitCode CLI - Command line tool for GitCode
5
- Author-email: GitCode CLI Contributors <support@gitcode.com>
6
- Maintainer-email: GitCode CLI Contributors <support@gitcode.com>
7
- License-Expression: MIT
8
- Project-URL: Homepage, https://gitcode.com/gitcode-cli/cli
9
- Project-URL: Documentation, https://gitcode.com/gitcode-cli/cli
10
- Project-URL: Repository, https://gitcode.com/gitcode-cli/cli
11
- Project-URL: Issues, https://gitcode.com/gitcode-cli/cli/issues
12
- Keywords: gitcode,cli,git,devops
13
- Classifier: Development Status :: 4 - Beta
14
- Classifier: Environment :: Console
15
- Classifier: Intended Audience :: Developers
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Topic :: Software Development
24
- Classifier: Topic :: Utilities
25
- Requires-Python: >=3.8
26
- Description-Content-Type: text/markdown
27
- License-File: LICENSE
28
- Dynamic: license-file
29
-
30
- # GitCode CLI
31
-
32
- [![AI 操作指南](https://img.shields.io/badge/📖_使用_AI_操作_GitCode_指南-点击查看-FF6B6B?style=for-the-badge)](./docs/AI-GUIDE.md)
33
-
34
- [![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?style=flat&logo=go)](https://golang.org)
35
- [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
36
- [![Release](https://img.shields.io/badge/Release-v0.2.12-blue)](https://gitcode.com/gitcode-cli/cli/releases)
37
-
38
- GitCode 命令行工具,为 GitCode 用户提供便捷的命令行操作体验。
39
-
40
- ## 安装
41
-
42
- ### 从源码构建
43
-
44
- **前置要求:**
45
- - Go 1.22+
46
-
47
- ```bash
48
- # 克隆仓库
49
- git clone https://gitcode.com/gitcode-cli/cli.git
50
- cd cli
51
-
52
- # 构建
53
- go build -o gc ./cmd/gc
54
-
55
- # 安装到用户目录
56
- mkdir -p ~/.local/bin
57
- mv gc ~/.local/bin/
58
- export PATH="$HOME/.local/bin:$PATH"
59
- ```
60
-
61
- ### Linux 包管理器
62
-
63
- **DEB (Debian/Ubuntu):**
64
-
65
- ```bash
66
- # 从 Releases 下载 .deb 包
67
- wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.2.12/gc_0.2.12_amd64.deb
68
-
69
- # 安装
70
- sudo dpkg -i gc_0.2.12_amd64.deb
71
- ```
72
-
73
- **RPM (RHEL/CentOS/Fedora):**
74
-
75
- ```bash
76
- # 从 Releases 下载 .rpm 包
77
- wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.2.12/gc-0.2.12-1.x86_64.rpm
78
-
79
- # 安装
80
- sudo rpm -i gc-0.2.12-1.x86_64.rpm
81
- ```
82
-
83
- ### PyPI (跨平台)
84
-
85
- ```bash
86
- # 使用 pip 安装
87
- pip install gitcode-cli
88
-
89
- # 或指定版本
90
- pip install gitcode-cli==0.2.5
91
- ```
92
-
93
- ### 规划中的安装方式
94
-
95
- 以下安装方式正在开发中:
96
-
97
- - [ ] 预编译二进制文件(Linux/macOS/Windows)
98
- - [ ] Homebrew (macOS/Linux)
99
- - [ ] Scoop (Windows)
100
- - [ ] Docker 镜像
101
-
102
- ## 快速开始
103
-
104
- ### 认证
105
-
106
- **方式一:设置环境变量(推荐)**
107
-
108
- ```bash
109
- # 设置 Token 环境变量
110
- export GC_TOKEN="your_gitcode_token"
111
-
112
- # 或使用备用变量名
113
- export GITCODE_TOKEN="your_gitcode_token"
114
-
115
- # 添加到 shell 配置文件(永久生效)
116
- echo 'export GC_TOKEN="your_gitcode_token"' >> ~/.bashrc
117
- source ~/.bashrc
118
- ```
119
-
120
- **方式二:交互式登录**
121
-
122
- ```bash
123
- # 交互式登录(需输入 Token)
124
- gc auth login
125
-
126
- # 使用 Token 参数登录
127
- gc auth login --token YOUR_TOKEN
128
- ```
129
-
130
- **获取 Token:**
131
- 1. 登录 [GitCode](https://gitcode.com)
132
- 2. 进入 设置 -> 私人令牌
133
- 3. 点击"生成新令牌",选择所需权限
134
- 4. 复制生成的 Token
135
-
136
- **验证认证:**
137
-
138
- ```bash
139
- # 查看认证状态
140
- gc auth status
141
- ```
142
-
143
- > 📖 **完整命令指南**: 查看 [COMMANDS.md](./docs/COMMANDS.md) 获取所有命令的详细使用说明和示例。
144
-
145
- ## 命令示例
146
-
147
- ### 仓库操作
148
-
149
- ```bash
150
- # 克隆仓库
151
- gc repo clone owner/repo
152
-
153
- # 创建新仓库
154
- gc repo create my-repo --public
155
-
156
- # 查看仓库信息
157
- gc repo view owner/repo
158
-
159
- # Fork 仓库
160
- gc repo fork owner/repo
161
-
162
- # 删除仓库
163
- gc repo delete owner/repo
164
- ```
165
-
166
- ### Issue 管理
167
-
168
- ```bash
169
- # 创建 Issue
170
- gc issue create --title "Bug report" --body "Description"
171
-
172
- # 列出 Issues
173
- gc issue list --state open
174
-
175
- # 查看 Issue 详情
176
- gc issue view 123
177
-
178
- # 关闭 Issue
179
- gc issue close 123
180
-
181
- # 重开 Issue
182
- gc issue reopen 123
183
-
184
- # 添加评论
185
- gc issue comment 123 --body "Comment text"
186
-
187
- # 管理 Issue 标签
188
- gc issue label 123 --add bug,enhancement
189
-
190
- # 查看 Issue 关联的 PRs
191
- gc issue prs 123
192
- ```
193
-
194
- ### Pull Request 管理
195
-
196
- ```bash
197
- # 创建 PR(自动检测当前分支)
198
- gc pr create --title "New feature" --base main
199
-
200
- # 创建跨仓库 PR(从 fork 到 upstream)
201
- gc pr create -R upstream/repo --fork myfork/repo --title "Feature"
202
-
203
- # 列出 PR
204
- gc pr list --state open
205
-
206
- # 查看 PR 详情
207
- gc pr view 456
208
-
209
- # 查看 PR 评论
210
- gc pr comments 456
211
-
212
- # 回复 PR 评论
213
- gc pr reply 456 --discussion <discussion_id> --body "Reply text"
214
-
215
- # 检出 PR 分支
216
- gc pr checkout 456
217
-
218
- # 合并 PR
219
- gc pr merge 456 --squash
220
-
221
- # 关闭/重开 PR
222
- gc pr close 456
223
- gc pr reopen 456
224
-
225
- # 编辑 PR
226
- gc pr edit 456 --title "New title"
227
- gc pr edit 456 --draft true
228
-
229
- # 代码检视
230
- gc pr review 456 --approve
231
- gc pr review 456 --request
232
- gc pr review 456 --comment "Review comment"
233
- ```
234
-
235
- ### Release 管理
236
-
237
- ```bash
238
- # 创建 Release(建议包含 --notes 参数)
239
- gc release create v1.0.0 --title "Version 1.0" --notes "Release notes"
240
-
241
- # 列出 Releases
242
- gc release list -R owner/repo
243
-
244
- # 查看 Release 详情
245
- gc release view v1.0.0 -R owner/repo
246
-
247
- # 上传资产到 Release
248
- gc release upload v1.0.0 app.zip -R owner/repo
249
- gc release upload v1.0.0 file1.tar.gz file2.rpm -R owner/repo
250
-
251
- # 下载 Release 资产
252
- gc release download v1.0.0 -R owner/repo
253
- gc release download v1.0.0 app.zip -R owner/repo -o ./downloads/
254
-
255
- # 删除 Release
256
- gc release delete v1.0.0 -R owner/repo
257
- ```
258
-
259
- > **注意**: `release create` 命令建议包含 `--notes` 参数,否则可能返回错误。
260
-
261
- ## 功能特性
262
-
263
- | 功能 | 描述 |
264
- |------|------|
265
- | 🔐 认证管理 | Token 认证、多账户支持、安全存储 |
266
- | 📦 仓库操作 | 克隆、创建、Fork、查看、删除 |
267
- | 🐛 Issue 管理 | 创建、列表、查看、关闭、重开、评论 |
268
- | 🔀 PR 管理 | 创建、列表、查看、检出、合并、关闭 |
269
- | 👀 代码检视 | 批准、请求修改、添加评论 |
270
- | 🏷️ 标签管理 | 创建、列表、删除 |
271
- | 🎯 里程碑管理 | 创建、列表、查看、删除 |
272
- | 🚀 Release 管理 | 创建、列表、查看、上传资产、下载资产 |
273
-
274
- ## 命令概览
275
-
276
- ```
277
- gc <command> <subcommand> [flags]
278
-
279
- Commands:
280
- auth 认证管理 (login, logout, status, token)
281
- repo 仓库操作 (clone, create, list, view, fork, delete)
282
- issue Issue 管理 (create, list, view, close, reopen, comment)
283
- pr PR 管理 (create, list, view, checkout, merge, close, reopen, review, diff, ready)
284
- label 标签管理 (create, list, delete)
285
- milestone 里程碑管理 (create, list, view, delete)
286
- release Release 管理 (create, list, view, upload, download, delete)
287
- version 显示版本信息
288
- ```
289
-
290
- ## 配置
291
-
292
- 配置文件位置: `~/.config/gc/config.yaml`
293
-
294
- ```yaml
295
- # 默认主机
296
- host: gitcode.com
297
-
298
- # Git 协议
299
- git_protocol: https
300
-
301
- # 默认编辑器
302
- editor: vim
303
-
304
- # 分页器
305
- pager: less
306
- ```
307
-
308
- ### 环境变量
309
-
310
- | 变量 | 描述 |
311
- |------|------|
312
- | `GC_TOKEN` | 认证 Token |
313
- | `GITCODE_TOKEN` | 备用 Token |
314
- | `GC_HOST` | 默认主机 |
315
- | `NO_COLOR` | 禁用颜色输出 |
316
-
317
- ## Shell 补全
318
-
319
- ```bash
320
- # Bash
321
- gc completion bash > /etc/bash_completion.d/gc
322
- source ~/.bashrc
323
-
324
- # Zsh
325
- gc completion zsh > "${fpath[1]}/_gc"
326
- source ~/.zshrc
327
-
328
- # Fish
329
- gc completion fish > ~/.config/fish/completions/gc.fish
330
- source ~/.config/fish/config.fish
331
- ```
332
-
333
- ## 文档
334
-
335
- - [命令指南](./docs/COMMANDS.md) - 所有命令的详细使用说明和示例
336
- - [版本发布](./RELEASE.md) - 发布流程和产物说明
337
- - [AI 操作指南](./docs/AI-GUIDE.md) - 使用 AI 助手操作 GitCode 的完整指南
338
- - [打包发布](./docs/PACKAGING.md) - DEB/RPM 包构建和发布流程
339
- - [贡献指南](./CONTRIBUTING.md) - 开发和发布流程
340
- - [安全策略](./SECURITY.md) - 敏感信息保护和安全规范
341
- - [CLAUDE.md](./CLAUDE.md) - AI 辅助开发指南
342
- - [需求文档](./issues-plan/) - 完整需求规格和里程碑规划
343
-
344
- ## 技术栈
345
-
346
- | 组件 | 技术 |
347
- |------|------|
348
- | 语言 | Go 1.22+ |
349
- | 命令框架 | Cobra |
350
- | 配置格式 | YAML |
351
- | 目标平台 | Linux, macOS, Windows |
352
-
353
- ## 开发
354
-
355
- ```bash
356
- # 克隆仓库
357
- git clone https://gitcode.com/gitcode-cli/cli.git
358
- cd gitcode-cli
359
-
360
- # 安装依赖
361
- make deps
362
-
363
- # 构建
364
- make build
365
-
366
- # 运行测试
367
- make test
368
-
369
- # 代码检查
370
- make lint
371
-
372
- # 运行
373
- make run
374
- ```
375
-
376
- ## 贡献
377
-
378
- 欢迎贡献代码!请查看 [贡献指南](./CONTRIBUTING.md)。
379
-
380
- ## 许可证
381
-
382
- [MIT License](./LICENSE)
383
-
384
- ## 致谢
385
-
386
- 本项目参考了 [GitHub CLI](https://github.com/cli/cli) 的设计与实现,感谢 GitHub 团队的开源贡献。
387
-
388
- ## 相关链接
389
-
390
- - [GitCode](https://gitcode.com) - GitCode 平台
391
- - [API 文档](https://gitcode.com/docs/api) - GitCode API 参考
392
- - [问题反馈](https://gitcode.com/gitcode-cli/cli/issues) - 提交 Bug 或建议
@@ -1,14 +0,0 @@
1
- gc_cli/__init__.py,sha256=v7ZKbRU4kXr-TeAdvaJuJrt0uc4dpttM9iArBKQ_KJ8,242
2
- gc_cli/wrapper.py,sha256=bJ5aqTRADaV_GX079pBPVhzbRYDZwjaRoK1nmUjVIoE,2119
3
- gc_cli/bin/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- gc_cli/bin/gc-darwin-amd64,sha256=2KDMnRiZY0EHxykJv6Ws92a6PsgP-p4EyPCgaNgxQnY,7837504
5
- gc_cli/bin/gc-darwin-arm64,sha256=XPlVwQQvWl30SC0hetlfx7xfNtgrZ1RnRdC3uLvg9L8,7527202
6
- gc_cli/bin/gc-linux-amd64,sha256=mpXgWDrLnb12OoY1rjVUnWlV60Fj2XHiHs8HzMNvJKA,7631000
7
- gc_cli/bin/gc-linux-arm64,sha256=BtOI81diBCrt8_9tev3mB3mmnXAHs1NIKK1gmnCSph0,7340184
8
- gc_cli/bin/gc-windows-amd64.exe,sha256=2UPt5x1keSCWuyrBY2yy6cMRtJE6qEtZNyRIlXBIji0,7902720
9
- gitcode_cli-0.2.13.dist-info/licenses/LICENSE,sha256=WsjkQaj0PPK_TKVoHDok218rd8JZdj1GIJ5TrrZD6jE,1253
10
- gitcode_cli-0.2.13.dist-info/METADATA,sha256=uhypZYLfDE7LPTm5NXcqTCHe5GsGueLUunCCggREN_I,9025
11
- gitcode_cli-0.2.13.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
12
- gitcode_cli-0.2.13.dist-info/entry_points.txt,sha256=IXAR-ST1fHD9LRD7nYjxTBfXjI_CgfEc3BPZmLef2OY,43
13
- gitcode_cli-0.2.13.dist-info/top_level.txt,sha256=2fSmR3kQ-XhdgFQdVvWmZcEyERJKVZVxOhk7tna1Sus,7
14
- gitcode_cli-0.2.13.dist-info/RECORD,,