gitee
A gh-like command-line client for Gitee. Manage pull
requests, issues, releases, gists, and more from your terminal.
Quick start
1 — Install (pick one):
Or grab a binary from GitHub Releases.
2 — Log in with a Gitee personal access token:
3 — Use it. Run inside any git clone (or add --repo owner/name):
That's it. Everything below is detail.
Install
| Method | Command | Notes |
|---|---|---|
| crates.io | cargo install gitee-cli-rs |
builds from source |
| cargo-binstall | cargo binstall gitee-cli-rs |
same binary, no compile |
| Homebrew (macOS) | brew install kipyin/tap/gitee |
arm64 + x86_64 |
| Direct download | Releases | gitee-<target>-v<ver>.tar.xz |
| From source | cargo install --path . |
after git clone |
The crates.io package is
gitee-cli-rs, but the installed command isgitee.
Shell completions (bash/zsh/fish/powershell/elvish):
Configure
The CLI needs a Gitee personal access token. Create one at https://gitee.com/profile/personal_access_tokens (default scopes are fine for reading; check pull_requests, issues, and projects for write actions).
For CI / scripts, use an environment variable instead:
Token lookup order: $GITEE_TOKEN → OS keyring → ~/.config/gitee/<host>.token.
Useful commands:
Everyday commands
Run from inside a repo, or point anywhere with --repo owner/name.
# pull requests
# issues
# cross-repo dashboard
# search
# releases
# repositories
# labels / milestones
# gists
# raw API escape hatch
Handy global flags:
Command reference
| Subcommand | Description |
|---|---|
list |
List PRs (--state, --author, --limit) |
status |
Open PRs relevant to you: created, assigned, awaiting your test (--limit) |
view <n> |
Show pull request details |
diff <n> |
Show pull request diff |
checkout <n> |
Fetch and check out a pull request locally |
create |
Open a PR (--title or --fill; --body, --head, --base, --assignee, --tester, --label, --milestone, --close-issue) |
edit <n> |
Edit metadata (--title, --body, --assignee, --tester, --label, --milestone) |
merge <n> |
Merge (--squash, --rebase, --no-close-issue) |
comment <n> |
Add a comment (-m/--body) |
approve <n> |
Approve / 审查通过 (--force) |
test <n> |
Mark tested / 测试通过 (--force) — Gitee-specific |
close <n> / reopen <n> |
Change state |
link <n> <issue> |
Link a pull request to an issue |
| Subcommand | Description |
|---|---|
list |
List issues (--state, --assignee, --limit) |
status |
Open issues relevant to you: created, assigned (--limit) |
view <n> |
Show issue details (Gitee issue idents are strings, e.g. I88) |
create |
Create (--title required; --body, --assignee, --labels, --milestone, --security-hole) |
edit <n> |
Edit metadata (--title, --body, --assignee, --label, --milestone, --security-hole) |
close <n> / reopen <n> |
Change state |
link <n> <pr> |
Link an issue to a pull request |
comment <n> |
Add a comment (-m/--body) |
| Flag | Description |
|---|---|
--limit |
Cap each section (default 30) |
Shows open issues assigned to you and created by you across all repos. PR sections are omitted — Gitee v5 has no user-level pulls endpoint.
| Subcommand | Description |
|---|---|
repos <query> |
Search repositories (--owner, --language, --fork, --sort, --order, --limit) |
issues <query> |
Search issues (--state, --author, --assignee, --label, --language, --sort, --order, --limit; scoped with global --repo) |
users <query> |
Search users (--sort, --order, --limit) |
| Subcommand | Description |
|---|---|
list |
List releases (--limit) |
view <tag> |
Show release details |
create |
Create (--tag required; --name, --notes, --target, --prerelease) |
upload <tag> <files…> |
Attach files to an existing release |
download <tag> |
Download assets (--dir, --pattern) |
edit <tag> |
Edit (--name, --notes, --prerelease) |
delete <tag> |
Delete (--yes to skip confirmation) |
| Subcommand | Description |
|---|---|
view [repo] |
Show repository details |
list [owner] |
List repos (yours, or a user/org's public repos) (--limit) |
clone <spec> [dir] |
Clone via git (--ssh) |
fork |
Fork the resolved repository (--add-remote <name>) |
create <name> |
Create under your account or --org (--private, --description, --homepage, --gitignore, --license) |
edit |
Edit settings (--description, --homepage, --private/--public, --default-branch) |
rename <path> |
Rename the URL slug |
delete |
Delete (--yes to skip confirmation) |
| Subcommand | Description |
|---|---|
list |
List labels (--limit) |
create <name> |
Create (--color required, hex without #) |
edit <name> |
Edit (--name, --color) |
delete <name> |
Delete (--yes to skip confirmation) |
| Subcommand | Description |
|---|---|
list |
List milestones (--state, --limit) |
view <n> |
Show milestone details |
create |
Create (--title and --due-on YYYY-MM-DD required; --description, --state) |
edit <n> |
Edit (--title, --due-on, --description, --state) |
| Subcommand | Description |
|---|---|
list |
List your gists (--limit) |
view <id> |
Show a gist (--raw prints file contents) |
create <files…> |
Create (--desc, --public, --filename when reading - from stdin) |
edit <id> <file> |
Replace one file's contents |
delete <id> |
Delete (--yes to skip confirmation) |
Like gh api. Pass an endpoint path, optional -X method, -F/-f fields,
-H headers, --input, and --paginate for array paging.
| Subcommand | Description |
|---|---|
login |
Store a token (--token, --force to skip validation) |
status |
Show login status and token source |
token |
Print the active token |
logout |
Forget the stored token for the current host |
Global flags
| Flag | Description |
|---|---|
--repo <owner/name> |
Target repository (default: resolved from git remote) |
--remote <name> |
Git remote to resolve the repo from (default: origin) |
--host <host> |
Gitee host (default: gitee.com) |
--json [fields] |
JSON output; --json number,title projects fields |
--jq <expr> |
jq expression on --json output (requires --json) |
--debug |
Log HTTP requests/responses to stderr |
Repository resolution
Most commands operate on a repository resolved two ways:
--repo owner/name, or- from the current directory's git remote (
--remote, defaultorigin).
So either cd into a clone, or pass --repo / --remote explicitly.
Compared to gh (与 gh 的差异)
Gitee OpenAPI v5 does not expose everything GitHub CLI can reach. These are not planned (no public API / no Gitee equivalent):
gh workflow/gh run/gh pr checks/ secrets / variables — Gitee Go has no public v5 REST API; PR 门禁 is only available via third-party appsissue transfer/pin/lock/delete— no Gitee APIrepo archive— no Gitee API- codespaces / projects / attestations / discussions — no Gitee equivalent
Also omitted after swagger verification: repo sync, pr update-branch.
Gitee-specific (Gitee 特色)
Features beyond GitHub CLI parity:
| Feature | Status | Notes |
|---|---|---|
pr test |
shipped | 测试通过 gate; pairs with pr approve (审查通过) |
issue --security-hole |
shipped | mark an issue as a security hole on create/edit |
milestone |
shipped | full list/view/create/edit; Gitee requires --due-on on create |
pr assignees and testers |
shipped | dual review/test roles on create/edit/status |
repo star / watch |
planned | ticket 22 |
webhook |
planned | ticket 20 |
License
MIT — see Cargo.toml.