Loading...
Loading...
Compare original and translation side by side
oh-gcghnpm install -g @oh-gc/clinpm install -g @oh-gc/clioh-gc --versionnpm install -g @oh-gc/cli@{version}npm install -g @oh-gc/cli@{version}oh-gc authoh-gc issueoh-gc proh-gc --versionnpm install -g @oh-gc/cli@{version}npm install -g @oh-gc/cli@{version}oh-gc authoh-gc issueoh-gc proh-gc auth statusoh-gc auth logingitcode.comoh-gc repo set-remote <name>--repo owner/repooh-gc auth statusoh-gc auth logingitcode.comoh-gc repo set-remote <name>--repo owner/repo--json--help--json--help--repo--repo owner/repoundefined--repo--repo owner/repoundefinedundefinedundefinedoh-gc auth login # Log in with personal access token (interactive prompt)
oh-gc auth logout # Remove stored token
oh-gc auth status # Show current user info~/.config/gitcode-cli/config.jsonoh-gc auth login # Log in with personal access token (interactive prompt)
oh-gc auth logout # Remove stored token
oh-gc auth status # Show current user info~/.config/gitcode-cli/config.jsonundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedoh-gc release create # Use version from package.json
oh-gc release create v1.0.0 # Specific version
oh-gc release create --prerelease # Mark as prerelease
oh-gc release create v1.0.0 --notes "..." # Custom release notesoh-gc release create # Use version from package.json
oh-gc release create v1.0.0 # Specific version
oh-gc release create --prerelease # Mark as prerelease
oh-gc release create v1.0.0 --notes "..." # Custom release notesoh-gc repo list # List your repositories
oh-gc repo list --org myorg # List org repositories
oh-gc repo create myrepo # Create a new repository
oh-gc repo create myrepo --org myorg # Create under an org
oh-gc repo delete --yes # Delete current repo (no prompt)
oh-gc repo fork # Fork current repo to your account
oh-gc repo fork --org myorg # Fork into an organization
oh-gc repo forks # List forks of current repo
oh-gc repo settings # View repo advanced settings
oh-gc repo settings --disable-fork # Update a setting
oh-gc repo languages # Show language breakdown
oh-gc repo contributors # List contributors
oh-gc repo contributors --stats # Show detailed contribution stats
oh-gc repo events # List repository events
oh-gc repo events --filter push # Filter by event type
oh-gc repo stats --branch main # Commit stats per author
oh-gc repo stats --downloads # Download stats by date
oh-gc repo archive --password secret # Archive a repository
oh-gc repo archive --open --password secret # Unarchive a repository
oh-gc repo transition # View permission inheritance mode
oh-gc repo transition --mode 2 # Set to independent mode
oh-gc repo module --wiki --issues # Enable wiki and issues modules
oh-gc repo module --no-fork # Disable fork module
oh-gc repo roles # List customized roles
oh-gc repo list --user alice # List user's public repos
oh-gc repo list --visibility private # List private repositories
oh-gc repo get-remote # Show which remote oh-gc uses
oh-gc repo set-remote upstream # Use a different remote
oh-gc repo view # View repository info
oh-gc repo update --description "..." # Update repository settings
oh-gc repo transfer <new-owner> # Transfer repository ownership.gitcode/oh-gc-config.jsonoh-gc repo list # List your repositories
oh-gc repo list --org myorg # List org repositories
oh-gc repo create myrepo # Create a new repository
oh-gc repo create myrepo --org myorg # Create under an org
oh-gc repo delete --yes # Delete current repo (no prompt)
oh-gc repo fork # Fork current repo to your account
oh-gc repo fork --org myorg # Fork into an organization
oh-gc repo forks # List forks of current repo
oh-gc repo settings # View repo advanced settings
oh-gc repo settings --disable-fork # Update a setting
oh-gc repo languages # Show language breakdown
oh-gc repo contributors # List contributors
oh-gc repo contributors --stats # Show detailed contribution stats
oh-gc repo events # List repository events
oh-gc repo events --filter push # Filter by event type
oh-gc repo stats --branch main # Commit stats per author
oh-gc repo stats --downloads # Download stats by date
oh-gc repo archive --password secret # Archive a repository
oh-gc repo archive --open --password secret # Unarchive a repository
oh-gc repo transition # View permission inheritance mode
oh-gc repo transition --mode 2 # Set to independent mode
oh-gc repo module --wiki --issues # Enable wiki and issues modules
oh-gc repo module --no-fork # Disable fork module
oh-gc repo roles # List customized roles
oh-gc repo list --user alice # List user's public repos
oh-gc repo list --visibility private # List private repositories
oh-gc repo get-remote # Show which remote oh-gc uses
oh-gc repo set-remote upstream # Use a different remote
oh-gc repo view # View repository info
oh-gc repo update --description "..." # Update repository settings
oh-gc repo transfer <new-owner> # Transfer repository ownership.gitcode/oh-gc-config.jsonoh-gc search repos "keyword" # Search repositories
oh-gc search issues "keyword" # Search issues across repos
oh-gc search code "keyword" # Search code across reposoh-gc search repos "keyword" # Search repositories
oh-gc search issues "keyword" # Search issues across repos
oh-gc search code "keyword" # Search code across reposoh-gc user view # View your profile
oh-gc user view alice # View another user's profile
oh-gc user edit --name "New Name" --bio "..." # Update your profile
oh-gc user edit --avatar "https://..." # Update avatar
oh-gc user emails # List your email addresses
oh-gc user followers # List your followers
oh-gc user following # List users you follow
oh-gc user events alice # List user activity events
oh-gc user events alice --year 2024 # Filter events by year
oh-gc user search alice # Search users
oh-gc user search bob --sort joined_at # Sort by registration time
oh-gc user namespace alice # Get namespace by path
oh-gc user namespaces # List all your namespaces
oh-gc user namespaces --mode project # Filter namespace mode
oh-gc user keys # List your SSH keys
oh-gc user key-add --title "My Key" --key "ssh-rsa ..." # Add SSH key
oh-gc user key-delete 123 # Delete SSH key by ID
oh-gc user starred # List your starred repos
oh-gc user starred alice # List another user's starred repos
oh-gc user subscriptions # List your watched repos
oh-gc user subscriptions alice # List another user's watched repos
oh-gc user issues # List your issues across all repos
oh-gc user issues --state closed --filter created # Filter user issues
oh-gc user issues --since "2024-01-01T00:00:00Z" # Issues updated since date
oh-gc user prs # List your PRs across all repos
oh-gc user prs --state merged --scope assigned_to_me # Filter user PRs
oh-gc user prs --source-branch feature --target-branch main # Filter by branches
oh-gc user orgs alice # List user's organizations
oh-gc user membership myorg # View your org membership
oh-gc user leave-org myorg # Leave an organizationoh-gc user view # View your profile
oh-gc user view alice # View another user's profile
oh-gc user edit --name "New Name" --bio "..." # Update your profile
oh-gc user edit --avatar "https://..." # Update avatar
oh-gc user emails # List your email addresses
oh-gc user followers # List your followers
oh-gc user following # List users you follow
oh-gc user events alice # List user activity events
oh-gc user events alice --year 2024 # Filter events by year
oh-gc user search alice # Search users
oh-gc user search bob --sort joined_at # Sort by registration time
oh-gc user namespace alice # Get namespace by path
oh-gc user namespaces # List all your namespaces
oh-gc user namespaces --mode project # Filter namespace mode
oh-gc user keys # List your SSH keys
oh-gc user key-add --title "My Key" --key "ssh-rsa ..." # Add SSH key
oh-gc user key-delete 123 # Delete SSH key by ID
oh-gc user starred # List your starred repos
oh-gc user starred alice # List another user's starred repos
oh-gc user subscriptions # List your watched repos
oh-gc user subscriptions alice # List another user's watched repos
oh-gc user issues # List your issues across all repos
oh-gc user issues --state closed --filter created # Filter user issues
oh-gc user issues --since "2024-01-01T00:00:00Z" # Issues updated since date
oh-gc user prs # List your PRs across all repos
oh-gc user prs --state merged --scope assigned_to_me # Filter user PRs
oh-gc user prs --source-branch feature --target-branch main # Filter by branches
oh-gc user orgs alice # List user's organizations
oh-gc user membership myorg # View your org membership
oh-gc user leave-org myorg # Leave an organizationoh-gc branch list # List all branches
oh-gc branch list --protected # List only protected branches
oh-gc branch get <name> # Get branch details
oh-gc branch create <name> --ref <sha/branch> # Create a new branch
oh-gc branch delete <name> # Delete a branch
oh-gc branch protect <name> # Set branch protection rules
oh-gc branch protect <name> --enforce-admins # Enforce protection for admins
oh-gc branch protect <name> --require-status-checks ci,lint # Require status checks
oh-gc branch protect <name> --dismiss-stale-reviews # Dismiss stale PR reviews
oh-gc branch protect <name> --unprotect # Remove branch protection
oh-gc branch protect-rules # List all branch protection rules
oh-gc branch protect-rule-create <pattern> --pusher <roles> --merger <roles> # Create protection rule
oh-gc branch protect-rule-update <pattern> --pusher <roles> --merger <roles> # Update protection rule
oh-gc branch protect-rule-delete <pattern> # Delete protection ruleoh-gc branch list # List all branches
oh-gc branch list --protected # List only protected branches
oh-gc branch get <name> # Get branch details
oh-gc branch create <name> --ref <sha/branch> # Create a new branch
oh-gc branch delete <name> # Delete a branch
oh-gc branch protect <name> # Set branch protection rules
oh-gc branch protect <name> --enforce-admins # Enforce protection for admins
oh-gc branch protect <name> --require-status-checks ci,lint # Require status checks
oh-gc branch protect <name> --dismiss-stale-reviews # Dismiss stale PR reviews
oh-gc branch protect <name> --unprotect # Remove branch protection
oh-gc branch protect-rules # List all branch protection rules
oh-gc branch protect-rule-create <pattern> --pusher <roles> --merger <roles> # Create protection rule
oh-gc branch protect-rule-update <pattern> --pusher <roles> --merger <roles> # Update protection rule
oh-gc branch protect-rule-delete <pattern> # Delete protection ruleoh-gc commit list # List commits
oh-gc commit list --sha main # List commits from specific branch
oh-gc commit get <sha> # Get commit details
oh-gc commit diff <sha> # View commit diff
oh-gc commit compare <base> <head> # Compare two commits or branches
oh-gc commit comments <sha> # List comments on a commit
oh-gc commit comment <sha> --body "text" # Create a commit commentoh-gc commit list # List commits
oh-gc commit list --sha main # List commits from specific branch
oh-gc commit get <sha> # Get commit details
oh-gc commit diff <sha> # View commit diff
oh-gc commit compare <base> <head> # Compare two commits or branches
oh-gc commit comments <sha> # List comments on a commit
oh-gc commit comment <sha> --body "text" # Create a commit commentoh-gc file get <path> # Get file contents (base64 encoded)
oh-gc file raw <path> --ref main # Get raw file contents
oh-gc file list # List repository files
oh-gc file create <path> --content "text" --message "msg" # Create a file
oh-gc file update <path> --sha <sha> --content "text" --message "msg" # Update a file
oh-gc file delete <path> --sha <sha> --message "msg" # Delete a fileoh-gc file get <path> # Get file contents (base64 encoded)
oh-gc file raw <path> --ref main # Get raw file contents
oh-gc file list # List repository files
oh-gc file create <path> --content "text" --message "msg" # Create a file
oh-gc file update <path> --sha <sha> --content "text" --message "msg" # Update a file
oh-gc file delete <path> --sha <sha> --message "msg" # Delete a fileoh-gc collaborator list # List repository collaborators
oh-gc collaborator add <username> # Add a collaborator
oh-gc collaborator remove <username> # Remove a collaborator
oh-gc collaborator permission <username> # Get collaborator permission leveloh-gc collaborator list # List repository collaborators
oh-gc collaborator add <username> # Add a collaborator
oh-gc collaborator remove <username> # Remove a collaborator
oh-gc collaborator permission <username> # Get collaborator permission leveloh-gc label list # List repository labels
oh-gc label create # Create a new label
oh-gc label update <name> # Update a label
oh-gc label delete <name> # Delete a labeloh-gc label list # List repository labels
oh-gc label create # Create a new label
oh-gc label update <name> # Update a label
oh-gc label delete <name> # Delete a labeloh-gc milestone list # List milestones
oh-gc milestone get <number> # Get milestone details
oh-gc milestone create # Create a new milestone
oh-gc milestone update <number> # Update a milestone
oh-gc milestone delete <number> # Delete a milestoneoh-gc milestone list # List milestones
oh-gc milestone get <number> # Get milestone details
oh-gc milestone create # Create a new milestone
oh-gc milestone update <number> # Update a milestone
oh-gc milestone delete <number> # Delete a milestoneoh-gc hook list # List repository webhooks
oh-gc hook get <id> # Get webhook details
oh-gc hook create # Create a webhook
oh-gc hook delete <id> # Delete a webhookoh-gc hook list # List repository webhooks
oh-gc hook get <id> # Get webhook details
oh-gc hook create # Create a webhook
oh-gc hook delete <id> # Delete a webhookoh-gc tag list # List repository tags
oh-gc tag create <name> --ref <sha/branch> # Create a tag
oh-gc tag delete <name> # Delete a tag
oh-gc tag protect <name> # Protect a tag
oh-gc tag protect-get <name> # Get protected tag details
oh-gc tag protect-create <name> --access-level 40 # Create protected tag rule
oh-gc tag protect-update <name> --access-level 30 # Update protected tag rule
oh-gc tag protect-delete <name> # Delete protected tag ruleoh-gc tag list # List repository tags
oh-gc tag create <name> --ref <sha/branch> # Create a tag
oh-gc tag delete <name> # Delete a tag
oh-gc tag protect <name> # Protect a tag
oh-gc tag protect-get <name> # Get protected tag details
oh-gc tag protect-create <name> --access-level 40 # Create protected tag rule
oh-gc tag protect-update <name> --access-level 30 # Update protected tag rule
oh-gc tag protect-delete <name> # Delete protected tag ruleoh-gc org list # List your organizations
oh-gc org view <org> # Get organization details
oh-gc org members <org> # List organization membersoh-gc org list # List your organizations
oh-gc org view <org> # Get organization details
oh-gc org members <org> # List organization membersStep 1: Create PR
oh-gc pr create --title "Add feature X" --base main
→ outputs PR number (e.g., #42)
Step 2: Assign people
oh-gc pr reviewers 42 alice,bob
oh-gc pr testers 42 carol
Step 3: Add metadata
oh-gc pr labels 42 feature,v2.0
oh-gc pr link 42 15,16 # Link related issues
Step 4: Review cycle
oh-gc pr diff 42 # Reviewer checks diff
oh-gc pr comments 42 # Check existing feedback
oh-gc pr comment 42 --body "LGTM"
oh-gc pr review 42 # Approve review
oh-gc pr test 42 # Mark test passed
Step 5: Merge
oh-gc pr merge 42 --method squashStep 1: Create PR
oh-gc pr create --title "Add feature X" --base main
→ outputs PR number (e.g., #42)
Step 2: Assign people
oh-gc pr reviewers 42 alice,bob
oh-gc pr testers 42 carol
Step 3: Add metadata
oh-gc pr labels 42 feature,v2.0
oh-gc pr link 42 15,16 # Link related issues
Step 4: Review cycle
oh-gc pr diff 42 # Reviewer checks diff
oh-gc pr comments 42 # Check existing feedback
oh-gc pr comment 42 --body "LGTM"
oh-gc pr review 42 # Approve review
oh-gc pr test 42 # Mark test passed
Step 5: Merge
oh-gc pr merge 42 --method squashStep 1: Find issues
oh-gc issue list --search "crash"
oh-gc issue list --state all --assignee alice
Step 2: Inspect
oh-gc issue view 15
Step 3: Respond
oh-gc issue comment 15 --body "Investigating, likely related to #12"
Step 4: Create follow-up
oh-gc issue create --title "Fix crash on login" --labels "bug,P0" --assignee bobStep 1: Find issues
oh-gc issue list --search "crash"
oh-gc issue list --state all --assignee alice
Step 2: Inspect
oh-gc issue view 15
Step 3: Respond
oh-gc issue comment 15 --body "Investigating, likely related to #12"
Step 4: Create follow-up
oh-gc issue create --title "Fix crash on login" --labels "bug,P0" --assignee bob--head owner:branchStep 1: Create PR from fork to upstream
oh-gc pr create --repo upstream-owner/repo --head myname:my-feature --base master --title "Fix bug"
Step 2: Manage on the upstream repo
oh-gc pr view 42 --json # Check status--repo--headowner:branchownerbranchowner/branch--head owner:branchStep 1: Create PR from fork to upstream
oh-gc pr create --repo upstream-owner/repo --head myname:my-feature --base master --title "Fix bug"
Step 2: Manage on the upstream repo
oh-gc pr view 42 --json # Check status--repo--headowner:branchownerbranchowner/branch| Setting | Location | How to set |
|---|---|---|
| Auth token | | |
| Remote override | | |
| Proxy | | Automatic |
| 设置 | 位置 | 设置方式 |
|---|---|---|
| 身份验证 Token | | |
| Remote 覆盖配置 | | |
| 代理 | | 自动 |
User wants to interact with GitCode
↓
Version matches? (oh-gc --version)
↓ No → npm install -g @oh-gc/cli@{version}
↓ Yes
Logged in? (oh-gc auth status)
↓ No → oh-gc auth login
↓ Yes
Inside git repo with gitcode.com remote?
↓ No → Use --repo flag, or cd to repo
↓ Yes
What does user want?
├─ List/view issues → oh-gc issue list / issue view
├─ Create issue → oh-gc issue create
├─ Update issue → oh-gc issue update
├─ Close/reopen issue → oh-gc issue close / issue reopen
├─ Comment on issue → oh-gc issue comment
├─ Manage issue labels → oh-gc issue labels
├─ View issue history → oh-gc issue history
├─ View issue reactions → oh-gc issue reactions
├─ List/view PRs → oh-gc pr list / pr view
├─ Create PR → oh-gc pr create
├─ Update PR → oh-gc pr update
├─ Close/reopen PR → oh-gc pr close / pr reopen
├─ View PR reactions → oh-gc pr reactions
├─ Review PR diff → oh-gc pr diff
├─ Comment on PR → oh-gc pr comment (general) or --path --line (line-level)
├─ Assign reviewers → oh-gc pr reviewers
├─ Assign testers → oh-gc pr testers
├─ Approve review → oh-gc pr review
├─ Mark test passed → oh-gc pr test
├─ Manage labels → oh-gc pr labels
├─ Link issues to PR → oh-gc pr link
├─ Merge PR → oh-gc pr merge
├─ View PR history → oh-gc pr logs
├─ Create release → oh-gc release create
├─ Search repos/issues → oh-gc search repos / search issues / search code
├─ View user profile → oh-gc user view
├─ Edit user profile → oh-gc user edit
├─ List user events → oh-gc user events
├─ Search users → oh-gc user search
├─ Manage SSH keys → oh-gc user keys / user key-add / user key-delete
├─ View starred repos → oh-gc user starred
├─ View watched repos → oh-gc user subscriptions
├─ View namespaces → oh-gc user namespace / user namespaces
├─ Manage branches → oh-gc branch list / branch get / branch protect
├─ View commits/files → oh-gc commit list / file get
├─ Manage collaborators → oh-gc collaborator list / add / remove
├─ Manage labels → oh-gc label list / create / update / delete
├─ Manage milestones → oh-gc milestone list / create / update
├─ Manage webhooks → oh-gc hook list / create / delete
└─ Configure remote → oh-gc repo set-remote / repo get-remoteUser wants to interact with GitCode
↓
Version matches? (oh-gc --version)
↓ No → npm install -g @oh-gc/cli@{version}
↓ Yes
Logged in? (oh-gc auth status)
↓ No → oh-gc auth login
↓ Yes
Inside git repo with gitcode.com remote?
↓ No → Use --repo flag, or cd to repo
↓ Yes
What does user want?
├─ List/view issues → oh-gc issue list / issue view
├─ Create issue → oh-gc issue create
├─ Update issue → oh-gc issue update
├─ Close/reopen issue → oh-gc issue close / issue reopen
├─ Comment on issue → oh-gc issue comment
├─ Manage issue labels → oh-gc issue labels
├─ View issue history → oh-gc issue history
├─ View issue reactions → oh-gc issue reactions
├─ List/view PRs → oh-gc pr list / pr view
├─ Create PR → oh-gc pr create
├─ Update PR → oh-gc pr update
├─ Close/reopen PR → oh-gc pr close / pr reopen
├─ View PR reactions → oh-gc pr reactions
├─ Review PR diff → oh-gc pr diff
├─ Comment on PR → oh-gc pr comment (general) or --path --line (line-level)
├─ Assign reviewers → oh-gc pr reviewers
├─ Assign testers → oh-gc pr testers
├─ Approve review → oh-gc pr review
├─ Mark test passed → oh-gc pr test
├─ Manage labels → oh-gc pr labels
├─ Link issues to PR → oh-gc pr link
├─ Merge PR → oh-gc pr merge
├─ View PR history → oh-gc pr logs
├─ Create release → oh-gc release create
├─ Search repos/issues → oh-gc search repos / search issues / search code
├─ View user profile → oh-gc user view
├─ Edit user profile → oh-gc user edit
├─ List user events → oh-gc user events
├─ Search users → oh-gc user search
├─ Manage SSH keys → oh-gc user keys / user key-add / user key-delete
├─ View starred repos → oh-gc user starred
├─ View watched repos → oh-gc user subscriptions
├─ View namespaces → oh-gc user namespace / user namespaces
├─ Manage branches → oh-gc branch list / branch get / branch protect
├─ View commits/files → oh-gc commit list / file get
├─ Manage collaborators → oh-gc collaborator list / add / remove
├─ Manage labels → oh-gc label list / create / update / delete
├─ Manage milestones → oh-gc milestone list / create / update
├─ Manage webhooks → oh-gc hook list / create / delete
└─ Configure remote → oh-gc repo set-remote / repo get-remote| Error | Cause | Fix |
|---|---|---|
| "Not logged in" | No token configured | |
| "Authentication failed" | Token expired or invalid | Re-run |
| "Remote not found" | Not in a git repo or remote missing | |
| "Not a GitCode repository" | Remote URL isn't | Add a gitcode.com remote |
| "Could not connect" | Network issue or proxy not set | Check internet; set |
| "Rate limit exceeded" | Too many API calls | Wait and retry |
| "API error 405" | Wrong HTTP method (internal) | Update oh-gc to latest version |
| "Can not find the branch" | | Use |
| 错误 | 原因 | 修复方法 |
|---|---|---|
| "Not logged in" | 未配置 Token | |
| "Authentication failed" | Token 已过期或无效 | 使用新的 Token 重新运行 |
| "Remote not found" | 当前不在 git 仓库中,或缺少 remote | |
| "Not a GitCode repository" | Remote URL 不是 | 添加一个 gitcode.com remote |
| "Could not connect" | 网络问题或未设置代理 | 检查网络;如果处于代理之后,请设置 |
| "Rate limit exceeded" | API 调用次数过多 | 等待后重试 |
| "API error 405" | HTTP 方法错误(内部问题) | 将 oh-gc 更新至最新版本 |
| "Can not find the branch" | | 跨仓库 PR 使用 |
https://gitcode.com/{owner}/{repo}/issues/{number}https://gitcode.com/{owner}/{repo}/pull/{number}/pulls//pull/pullpullshttps://gitcode.com/{owner}/{repo}/issues/{number}https://gitcode.com/{owner}/{repo}/pull/{number}/pulls//pull/pullpulls--jsonjqoh-gc pr list --json | jq '.[].title'--repo owner/repooh-gc pr comments --comment-type diff_commentoh-gc pr reviewers --appendoh-gc pr update --state closedhttps://gitcode.com/{owner}/{repo}/pull/{number}pull--jsonjqoh-gc pr list --json | jq '.[].title'--repo owner/repooh-gc pr comments --comment-type diff_commentoh-gc pr reviewers --appendoh-gc pr update --state closedhttps://gitcode.com/{owner}/{repo}/pull/{number}pull