gitcode-cli 0.3.0__py3-none-any.whl → 0.5.7__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 +11 -11
- gc_cli/__main__.py +9 -0
- gc_cli/bin/.gitkeep +0 -0
- 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 +102 -81
- gitcode_cli-0.5.7.dist-info/METADATA +369 -0
- gitcode_cli-0.5.7.dist-info/RECORD +15 -0
- {gitcode_cli-0.3.0.dist-info → gitcode_cli-0.5.7.dist-info}/WHEEL +2 -1
- {gitcode_cli-0.3.0.dist-info → gitcode_cli-0.5.7.dist-info}/entry_points.txt +1 -0
- {gitcode_cli-0.3.0.dist-info → gitcode_cli-0.5.7.dist-info}/licenses/LICENSE +27 -27
- {gitcode_cli-0.3.0.dist-info → gitcode_cli-0.5.7.dist-info}/top_level.txt +0 -0
- gitcode_cli-0.3.0.dist-info/METADATA +0 -27
- gitcode_cli-0.3.0.dist-info/RECORD +0 -9
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.
|
|
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.7"
|
|
8
|
+
__author__ = "GitCode CLI Contributors"
|
|
9
|
+
__all__ = ["__version__", "main"]
|
|
10
|
+
|
|
11
|
+
from gc_cli.wrapper import main
|
gc_cli/__main__.py
ADDED
gc_cli/bin/.gitkeep
CHANGED
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return f"gc-
|
|
34
|
-
elif system == "
|
|
35
|
-
return "gc-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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.7
|
|
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
|
+
[](./docs/AI-GUIDE.md)
|
|
33
|
+
|
|
34
|
+
[](https://golang.org)
|
|
35
|
+
[](LICENSE)
|
|
36
|
+
[](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.7/gc_0.5.7_amd64.deb
|
|
102
|
+
|
|
103
|
+
# 安装
|
|
104
|
+
sudo dpkg -i gc_0.5.7_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.7/gc-0.5.7-1.x86_64.rpm
|
|
114
|
+
|
|
115
|
+
# 安装
|
|
116
|
+
sudo rpm -i gc-0.5.7-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.7/gitcode_cli-0.5.7-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=Yi08ftr-OFw-AKkpunO7GnQYUFvOxEi_PcmNk6Y66bg,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=86OynZA78i5oU1JpuFXfWZ_Enk5pFDTLGsQh0TuWqyQ,8368128
|
|
6
|
+
gc_cli/bin/gc-darwin-arm64,sha256=NjBFW2RdQ5bMLezc-DNU2IfHI22ugMXdI652HtTvaZA,8033042
|
|
7
|
+
gc_cli/bin/gc-linux-amd64,sha256=Y3rU80teEZgaecIui-IcrGEIWoM75Q1eWNicwQ3bU3o,8147096
|
|
8
|
+
gc_cli/bin/gc-linux-arm64,sha256=OEhpygfb8UyME5tZm8-jf04eVZ6wA0TOcqlw9D5VDwM,7864472
|
|
9
|
+
gc_cli/bin/gc-windows-amd64.exe,sha256=WUpXhetlzOYzogGMc5veR9oFTvimO-ebA3V5DJVFHkg,8434688
|
|
10
|
+
gitcode_cli-0.5.7.dist-info/licenses/LICENSE,sha256=23d4Rfrm1CLX092oLjzs2UTYcy5Sp-dpaji0IAHIsiE,1280
|
|
11
|
+
gitcode_cli-0.5.7.dist-info/METADATA,sha256=SCdrHbhohqekVplE9qjoEpTgKowN0XPzRb69C9jnQLA,9918
|
|
12
|
+
gitcode_cli-0.5.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
13
|
+
gitcode_cli-0.5.7.dist-info/entry_points.txt,sha256=DresfT5jkpwU3fPn8n0MTao1m5QZi3XEulKFbQ8BYYY,73
|
|
14
|
+
gitcode_cli-0.5.7.dist-info/top_level.txt,sha256=2fSmR3kQ-XhdgFQdVvWmZcEyERJKVZVxOhk7tna1Sus,7
|
|
15
|
+
gitcode_cli-0.5.7.dist-info/RECORD,,
|
|
@@ -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.
|
|
File without changes
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: gitcode-cli
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: GitCode CLI - Command line tool for GitCode
|
|
5
|
-
Author-email: GitCode CLI Contributors <support@gitcode.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Keywords: gitcode,cli,git,devops
|
|
8
|
-
Classifier: Development Status :: 4 - Beta
|
|
9
|
-
Classifier: Environment :: Console
|
|
10
|
-
Classifier: Intended Audience :: Developers
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Topic :: Software Development
|
|
19
|
-
Classifier: Topic :: Utilities
|
|
20
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
-
Requires-Python: >=3.8
|
|
22
|
-
Project-URL: Homepage, https://gitcode.com/gitcode-cli/cli
|
|
23
|
-
|
|
24
|
-
GitCode CLI - Command line tool for GitCode
|
|
25
|
-
|
|
26
|
-
Binary executables are available at:
|
|
27
|
-
https://gitcode.com/gitcode-cli/cli/releases
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
gc_cli/__init__.py,sha256=VljLbVD3K21mCiUkiBrfKDmgXr20Md4_Az1d-Nd7vgc,241
|
|
2
|
-
gc_cli/wrapper.py,sha256=bJ5aqTRADaV_GX079pBPVhzbRYDZwjaRoK1nmUjVIoE,2119
|
|
3
|
-
gc_cli/bin/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
gitcode_cli-0.3.0.dist-info/METADATA,sha256=nF-wIITsdnyeWpZd9NI_T80j3tLTukg9PU2YeUvFNTM,1019
|
|
5
|
-
gitcode_cli-0.3.0.dist-info/WHEEL,sha256=2jHdxKWnCIK_lI5LTqwkSmjgOUSsTtjdBrux51aJqKg,77
|
|
6
|
-
gitcode_cli-0.3.0.dist-info/entry_points.txt,sha256=IXAR-ST1fHD9LRD7nYjxTBfXjI_CgfEc3BPZmLef2OY,43
|
|
7
|
-
gitcode_cli-0.3.0.dist-info/top_level.txt,sha256=2fSmR3kQ-XhdgFQdVvWmZcEyERJKVZVxOhk7tna1Sus,7
|
|
8
|
-
gitcode_cli-0.3.0.dist-info/licenses/LICENSE,sha256=WsjkQaj0PPK_TKVoHDok218rd8JZdj1GIJ5TrrZD6jE,1253
|
|
9
|
-
gitcode_cli-0.3.0.dist-info/RECORD,,
|