gitee-cli is an agent-first command-line tool for working with gitee.com
from scripts, local terminals, and AI-driven workflows.
It gives you a small, stable command surface for authentication, repository
inspection, issue triage, and pull request workflows without dropping down to
raw Gitee API calls. The installed executable is named gitee.
For agent and LLM discovery, start with:
gitee help --jsonThis returns a machine-readable manifest of command groups, subcommands, flags,
examples, and gh-style equivalents. For one command, use a topic path such as
gitee help pr create --json.
gitee-cliis an unofficial community project, not affiliated with, endorsed by, or sponsored by Gitee orgitee.com. Gitee andgitee.comare trademarks of their respective owners, referenced here only to identify platform compatibility.
gitee-cli is built for the high-frequency Gitee tasks that show up in
automation and day-to-day development:
- checking whether auth is usable before starting work
- inspecting repository metadata from a slug or a local checkout
- reading issue history before making a change
- viewing, listing, creating, merging, reviewing, commenting on, and checking out pull requests
- producing stable
--jsonoutput and meaningful exit codes for scripts
The project is intentionally opinionated:
- it targets
gitee.com - it prefers explicit, non-interactive workflows
- it supports both human-readable output and stable
--json - it uses local git context when that makes common workflows faster
Use gitee-cli if you want:
- a Gitee workflow tool that fits AI agents and automation
- a terminal-friendly way to inspect repos, issues, and pull requests
- write operations that accept flags, files, or stdin instead of prompts
- predictable behavior that can be scripted safely
Install the latest stable release with npm:
npm install -g @pkg-ai/gitee-cli
gitee --versionOr run without a global install:
npx @pkg-ai/gitee-cli --versionThe npm package includes prebuilt binaries for Apple Silicon macOS
(aarch64-apple-darwin) and Linux x86_64 (x86_64-unknown-linux-musl).
Install the bundled using-gitee-cli skill. By default it goes to
~/.agents/skills, the cross-client Agent Skills standard directory:
gitee skills installFor Claude Code's personal skill directory, pass --agent claude-code:
gitee skills install --agent claude-code--agent supports only claude-code; omit it for the default cross-client
target. Use gitee skills list to check status, gitee skills uninstall to
remove a target.
This is one full cycle in the terminal: read an issue, fix it, open a PR, field and address review comments, get it approved, and merge.
Start by reading the issue you'll work on, including its discussion:
gitee issue view I123 --repo octo/demo --comments --page 1 --per-page 20 --jsonWrite the fix in your editor, then open a PR from the current branch:
gitee pr create --title "Fix I123" --base develop --body "Closes I123" --jsonBring up the PR for code review — review it yourself, or reply to a reviewer's comment in place:
gitee pr view 42 --repo octo/demo --json
gitee pr comment 42 --repo octo/demo --body "Fixed, please re-review" --jsonPull the PR's comments to see what needs fixing, apply the changes, and push:
gitee pr view 42 --repo octo/demo --comments --page 1 --per-page 20 --jsonOnce the feedback is addressed, approve and merge:
gitee pr review 42 --repo octo/demo --approve --json
gitee pr merge 42 --repo octo/demo --squash --jsonGitee has no GitHub-style request-changes review state. Comment reviews require a body; approval reviews do not accept one.
When --repo is omitted, gitee-cli infers the repository from the local git
checkout, keeping commands short when you are already in the right repository.
Supported origin URL forms
git@gitee.com:owner/repo.gitssh://git@gitee.com/owner/repo.githttps://gitee.com/owner/repo.githttp://gitee.com/owner/repo.git
Most reads work without a saved token on public repositories. Authentication is required for writes and some user-specific flows; private repositories and some human-name fallback lookups may still require it.
Runtime token resolution order:
GITEE_TOKEN- saved config file token
Config directory resolution order:
GITEE_CONFIG_DIRXDG_CONFIG_HOME/giteeHOME/.config/gitee- current directory
./.gitee
By default ~/.config/gitee/config.toml stores the saved token and non-secret
clone protocol preference.
Relevant environment variables
GITEE_TOKEN: overrides the saved token at runtimeGITEE_CONFIG_DIR: points directly to the config directoryXDG_CONFIG_HOME: used whenGITEE_CONFIG_DIRis not setHOME: used for the default config pathGITEE_BASE_URL: overrides the API base URL (defaulthttps://gitee.com/api); mainly for tests or local API mocking
gitee-cli is designed to be scriptable:
- successful output goes to
stdout - errors go to
stderr - core commands support
--json - exit codes are stable enough to branch on in automation
Exit codes:
0: success2: usage error3: authentication error or authentication required4: config error5: remote request error6: resource not found7: local git error
See CONTRIBUTING.md for local development, testing, and pull request guidance.
MIT. See LICENSE.