gitcode-cli
v1.1.13
Published
GitCode CLI - Command-line tool for GitCode platform. Like `gh` for GitHub, `gc` for GitCode.
Readme
gitcode-cli — GitCode CLI
Command-line tool for GitCode. Like
ghfor GitHub,gitcode-clifor GitCode.
Quick Start
# No install needed — runs directly:
npx gitcode-cli auth login
npx gitcode-cli repo list
# Or install globally:
npm install -g gitcode-cli
gitcode-cli auth loginNote: Shortcut
gcmay conflict with git (git commitalias) or PowerShell (Get-Content). Usegitcode-clifor reliable cross-platform access.
Or install once, use gc anywhere:
npm install -g gitcode-cli # or: bun add -g gitcode-cli
gc auth login
gc repo listInstall
| Method | Command | Binary |
|--------|---------|--------|
| npx (no install) | npx gitcode-cli <cmd> | npx gitcode-cli |
| npm | npm install -g gitcode-cli | gc or gitcode-cli |
| bun | bun add -g gitcode-cli | gc or gitcode-cli |
| Source | git clone ... && npm install -g . | gc or gitcode-cli |
Windows users: Use
gitcode-cliinstead ofgc. PowerShell hasgcas a built-in alias forGet-Content. Both commands work on macOS/Linux. | Source |git clone https://gitcode.com/toads/gitcode-cli.git && npm install -g .|
Authentication
gc auth login # Interactive (paste token)
gc auth login -t <token> # Non-interactive
gc auth status # Check statusGet your token at: https://gitcode.com/setting/token-classic/create
Or via environment variable:
export GITCODE_TOKEN=your_tokenCommands
19 commands, 85+ subcommands.
| Command | Description | gh equivalent |
|---------|-------------|---------------|
| gc auth | Login, logout, status, setup-git | gh auth |
| gc repo | list, view, create, delete, clone, fork, edit, starred | gh repo |
| gc issue | list, view, create, close, reopen, edit, comment | gh issue |
| gc pr | list, view, create, merge, close, reopen, comment, review, checkout, diff | gh pr |
| gc search | repos, issues, users | gh search |
| gc release | list, view, create, edit, delete, upload, download | gh release |
| gc label | list, create, edit, delete | gh label |
| gc file | view, list (browse repo files) | — |
| gc browse | Open repo/issue/PR/file in browser | gh browse |
| gc milestone | list, view, create, close, delete | — |
| gc tag | list, create, delete, protect, unprotect | — |
| gc hook | list, view, create, delete, test (webhooks) | — |
| gc commit | list, view, compare | — |
| gc org | list, view, repos, members | gh org |
| gc ssh-key | list, add, delete | gh ssh-key |
| gc api | Raw API + jq/template/paginate + @file | gh api |
| gc config | get, set, list | gh config |
| gc completion | bash, zsh, fish | gh completion |
| gc workflow | init, push, diff | — |
Universal flags (like gh)
All list/view commands support:
--json Output as JSON
-q, --jq Filter with jq syntax: -q '.[].title'
-t, --template Format with Go template: -t '{{.title}}'
-w, --web Open in browser
-S, --search Keyword search
-s, --state Filter by state
-a, --assignee Filter by assignee
-A, --author Filter by author
-l, --label Filter by label
-L, --limit Max resultsExamples
# Issues
gc issue list -R owner/repo -s open -l bug
gc issue create -t "Bug" -b "Details" -R owner/repo
gc issue view 42 -R owner/repo -w
gc issue list -R owner/repo -q '.[].title'
# Pull Requests
gc pr list -R owner/repo -s all -B main -A username
gc pr create -t "Feature" --head feat --base main -d
gc pr checkout 42
gc pr review 42 --approve -b "LGTM"
gc pr diff 42 -R owner/repo
# Search
gc search repos "keyword" --language go --sort stars_count
gc search issues "bug" -R owner/repo --state open
gc search users "name"
# Repositories
gc repo create --name my-project --private
gc repo fork owner/repo --name my-fork
gc repo clone owner/repo
# Releases
gc release create --tag v1.0 -n "v1.0" -b "Release notes"
gc release upload v1.0.0 app.zip -R owner/repo
gc release download v1.0.0 -R owner/repo
# Raw API
gc api /user/repos --paginate -q '.[].full_name'
gc api /repos/{owner}/{repo}/issues -X POST -F title="Bug"vs gh — Flag Parity
| Command | gh | gc | Status |
|---------|----|----|--------|
| pr list | 14 flags | 16 flags | 🟢 gc 更多 |
| issue list | 14 flags | 14 flags | 🟢 完全对齐 |
| issue create | 12 flags | 9 flags | 🟡 |
| pr create | 16 flags | 9 flags | 🟡 |
| issue view | 5 flags | 5 flags | 🟢 完全对齐 |
12 core gh commands fully covered. 6 additional GitCode-specific commands.
Contributing
git clone https://gitcode.com/toads/gitcode-cli.git
cd gitcode-cli && npm install
node bin/gc.js --helpLicense
MIT
