pygitcode
A CLI tool for GitCode (
api.gitcode.com), modeled after GitHub CLI (gh).
English | 中文
For agent-assisted setup, usage, upgrades, or troubleshooting, read docs/en/USING_WITH_AGENT.md first.
Installation
pip install pygitcode
This exposes both gc and gitcode commands in your shell.
To optionally route existing gh commands between GitCode and GitHub, install and configure the managed proxy:
gc setup gh-proxy --configure
The command installs the shim, adds a managed shell PATH block, and registers OpenCode instructions that teach agents to try the dispatcher before API fallbacks. Restart OpenCode afterward. The proxy sends GitCode repositories to gc, sends GitHub or unknown contexts to the native gh, and refuses unsupported commands when the target is GitCode. See the compatibility notes for routing controls and uninstall instructions.
Quick Start
If you already know GitHub CLI (gh), you can start with the same familiar flows:
gc auth login
gc issue list
gc issue view 42
gc pr list
gc pr create --fill
gc pr audit
gc pr merge 42 --squash
Use gitcode instead of gc on Windows PowerShell because gc is a built-in alias for Get-Content.
gc pr audit prints a reason for every failed R1-R4 merge-readiness rule. List-mode errors other than HTTP 401 are recorded per PR and exit 0 unless --fail-exit is set. HTTP 401 aborts the remaining list and exits 1, regardless of this flag.
Documentation
Repository Selection
Commands operate on the current Git repository by default. You can also select a repository explicitly:
gc issue list -R owner/repo
gc pr list -R owner/repo
Authentication
gc resolves tokens in this order:
--tokenoptionGC_TOKENenvironment variable~/.config/gc/config.json, written bygc auth login
Useful commands:
gc auth login
gc auth status
gc auth token
gc auth logout
License
MIT
Metadata
Release files for pygitcode 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pygitcode-0.1.5.tar.gz | 50.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pygitcode-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 110.1 kB
Release files / pygitcode-0.1.5.tar.gz
| Download URL | pygitcode-0.1.5.tar.gz |
|---|---|
| Size | 50.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1554d6c878306f72e8f8131b8b194bf36615f952aa62b93429b4503b46021b30
|
|
BLAKE2b-256 checksum How to use checksums |
ffefbfafdbca6682cc064bf77ad66675e03f82319c1d2e1caca9b297aaf3b49a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 7, 2026.
Transparency logRelease files / pygitcode-0.1.5-py3-none-any.whl
| Download URL | pygitcode-0.1.5-py3-none-any.whl |
|---|---|
| Size | 59.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4519cf2c273bc032378e330ec2d080f63a55a40ae6eafe8de88039f6c20b46b3
|
|
BLAKE2b-256 checksum How to use checksums |
60221b40cd7d7ba2a1b9de359b8a1c2650d0c1280ad025db113dbb058eb59ac1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 7, 2026.
Transparency log