Skip to main content

pygitcode

A CLI tool for GitCode (api.gitcode.com), modeled after GitHub CLI (gh).

PyPI Python License

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
gc repo view owner/repo
gc repo clone owner/repo

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.

GitCode MCP

This repository also maintains the independently installable codeasier-gitcode-mcp runtime (Python 3.11+), with stdio, Streamable HTTP, OAuth, and 31 GitCode tools. It is a separate distribution: installing pygitcode does not install MCP, ASGI, or cryptography dependencies. See the MCP documentation and migration guide. Codex-specific plugin integration remains in codex-codeasier.

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:

  1. --token option
  2. GC_TOKEN environment variable
  3. ~/.config/gc/config.json, written by gc auth login

Useful commands:

gc auth login
gc auth status
gc auth token
gc auth logout

License

MIT

Metadata

Release files for pygitcode 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygitcode 0.2.0
File Size Uploaded Provenance Actions
pygitcode-0.2.0.tar.gz 181.6 kB With provenance Details for pygitcode-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygitcode 0.2.0
File Interpreter ABI Platform Actions
pygitcode-0.2.0-py3-none-any.whl Python 3 none any Details for pygitcode-0.2.0-py3-none-any.whl

Total release size: 402.3 kB

Release files / pygitcode-0.2.0.tar.gz

Download URL pygitcode-0.2.0.tar.gz
Size 181.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ba265bdabe8f3d739423266af833f8dd1fc423b4dc0d57d38d5985bf35a0ae3f
BLAKE2b-256 checksum
How to use checksums
fc11980417441dc2d2833e8b4b104fa88abca53683589e7361edc47b2e5868a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Release files / pygitcode-0.2.0-py3-none-any.whl

Download URL pygitcode-0.2.0-py3-none-any.whl
Size 220.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d655a0b1face21f28b83cbf311dc5efdcb7219151a8691d2b0e7ab0654738241
BLAKE2b-256 checksum
How to use checksums
dc82afdddc493ade5cced411c2f233588da9f83d357fac8fe74a3cd6163771ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Security for pygitcode 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pygitcode-0.2.0.tar.gz

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 Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page