@oh-gc/cli 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/dist/commands/auth/status.js +1 -1
  2. package/dist/commands/auth/status.js.map +1 -1
  3. package/dist/commands/branch/get.js +1 -1
  4. package/dist/commands/branch/get.js.map +1 -1
  5. package/dist/commands/branch/list.js +1 -1
  6. package/dist/commands/branch/list.js.map +1 -1
  7. package/dist/commands/branch/protect.js +1 -1
  8. package/dist/commands/branch/protect.js.map +1 -1
  9. package/dist/commands/collaborator/add.js +1 -1
  10. package/dist/commands/collaborator/add.js.map +1 -1
  11. package/dist/commands/collaborator/list.js +1 -1
  12. package/dist/commands/collaborator/list.js.map +1 -1
  13. package/dist/commands/collaborator/permission.js +1 -1
  14. package/dist/commands/collaborator/permission.js.map +1 -1
  15. package/dist/commands/collaborator/remove.js +1 -1
  16. package/dist/commands/collaborator/remove.js.map +1 -1
  17. package/dist/commands/commit/compare.js +1 -1
  18. package/dist/commands/commit/compare.js.map +1 -1
  19. package/dist/commands/commit/diff.js +1 -1
  20. package/dist/commands/commit/diff.js.map +1 -1
  21. package/dist/commands/commit/get.js +1 -1
  22. package/dist/commands/commit/get.js.map +1 -1
  23. package/dist/commands/commit/list.js +1 -1
  24. package/dist/commands/commit/list.js.map +1 -1
  25. package/dist/commands/file/get.js +1 -1
  26. package/dist/commands/file/get.js.map +1 -1
  27. package/dist/commands/file/list.js +1 -1
  28. package/dist/commands/file/list.js.map +1 -1
  29. package/dist/commands/file/raw.js +1 -1
  30. package/dist/commands/file/raw.js.map +1 -1
  31. package/dist/commands/hook/create.js +1 -1
  32. package/dist/commands/hook/create.js.map +1 -1
  33. package/dist/commands/hook/delete.js +1 -1
  34. package/dist/commands/hook/delete.js.map +1 -1
  35. package/dist/commands/hook/get.js +1 -1
  36. package/dist/commands/hook/get.js.map +1 -1
  37. package/dist/commands/hook/list.js +1 -1
  38. package/dist/commands/hook/list.js.map +1 -1
  39. package/dist/commands/issue/close.js +1 -1
  40. package/dist/commands/issue/comment.js +1 -1
  41. package/dist/commands/issue/comment.js.map +1 -1
  42. package/dist/commands/issue/history.js +1 -1
  43. package/dist/commands/issue/labels.js +2 -2
  44. package/dist/commands/issue/list.js +1 -1
  45. package/dist/commands/issue/list.js.map +1 -1
  46. package/dist/commands/issue/reactions.js +1 -1
  47. package/dist/commands/issue/reopen.js +1 -1
  48. package/dist/commands/issue/update.js +3 -3
  49. package/dist/commands/issue/view.js +1 -1
  50. package/dist/commands/issue/view.js.map +1 -1
  51. package/dist/commands/label/create.js +1 -1
  52. package/dist/commands/label/create.js.map +1 -1
  53. package/dist/commands/label/delete.js +1 -1
  54. package/dist/commands/label/delete.js.map +1 -1
  55. package/dist/commands/label/list.js +1 -1
  56. package/dist/commands/label/list.js.map +1 -1
  57. package/dist/commands/label/update.js +1 -1
  58. package/dist/commands/label/update.js.map +1 -1
  59. package/dist/commands/milestone/create.js +1 -1
  60. package/dist/commands/milestone/create.js.map +1 -1
  61. package/dist/commands/milestone/delete.js +1 -1
  62. package/dist/commands/milestone/delete.js.map +1 -1
  63. package/dist/commands/milestone/get.js +1 -1
  64. package/dist/commands/milestone/get.js.map +1 -1
  65. package/dist/commands/milestone/list.js +1 -1
  66. package/dist/commands/milestone/list.js.map +1 -1
  67. package/dist/commands/milestone/update.js +1 -1
  68. package/dist/commands/milestone/update.js.map +1 -1
  69. package/dist/commands/org/list.js +1 -1
  70. package/dist/commands/org/list.js.map +1 -1
  71. package/dist/commands/org/members.js +1 -1
  72. package/dist/commands/org/members.js.map +1 -1
  73. package/dist/commands/org/view.js +1 -1
  74. package/dist/commands/org/view.js.map +1 -1
  75. package/dist/commands/pr/close.js +1 -1
  76. package/dist/commands/pr/comment.js +3 -3
  77. package/dist/commands/pr/comments.js +1 -1
  78. package/dist/commands/pr/comments.js.map +1 -1
  79. package/dist/commands/pr/commits.js +1 -1
  80. package/dist/commands/pr/commits.js.map +1 -1
  81. package/dist/commands/pr/diff.js +1 -1
  82. package/dist/commands/pr/diff.js.map +1 -1
  83. package/dist/commands/pr/labels.js +4 -4
  84. package/dist/commands/pr/labels.js.map +1 -1
  85. package/dist/commands/pr/link.js +1 -1
  86. package/dist/commands/pr/link.js.map +1 -1
  87. package/dist/commands/pr/list.js +1 -1
  88. package/dist/commands/pr/list.js.map +1 -1
  89. package/dist/commands/pr/logs.js +1 -1
  90. package/dist/commands/pr/logs.js.map +1 -1
  91. package/dist/commands/pr/merge.js +1 -1
  92. package/dist/commands/pr/merge.js.map +1 -1
  93. package/dist/commands/pr/reactions.js +1 -1
  94. package/dist/commands/pr/reopen.js +1 -1
  95. package/dist/commands/pr/review.js +3 -3
  96. package/dist/commands/pr/review.js.map +1 -1
  97. package/dist/commands/pr/reviewers.js +6 -6
  98. package/dist/commands/pr/reviewers.js.map +1 -1
  99. package/dist/commands/pr/test.js +3 -3
  100. package/dist/commands/pr/test.js.map +1 -1
  101. package/dist/commands/pr/testers.js +6 -6
  102. package/dist/commands/pr/testers.js.map +1 -1
  103. package/dist/commands/pr/update.js +1 -1
  104. package/dist/commands/pr/update.js.map +1 -1
  105. package/dist/commands/pr/view.js +1 -1
  106. package/dist/commands/pr/view.js.map +1 -1
  107. package/dist/commands/release/create.js +1 -1
  108. package/dist/commands/release/create.js.map +1 -1
  109. package/dist/commands/repo/archive.js +1 -1
  110. package/dist/commands/repo/archive.js.map +1 -1
  111. package/dist/commands/repo/contributors.js +1 -1
  112. package/dist/commands/repo/contributors.js.map +1 -1
  113. package/dist/commands/repo/create.js +1 -1
  114. package/dist/commands/repo/create.js.map +1 -1
  115. package/dist/commands/repo/delete.js +1 -1
  116. package/dist/commands/repo/delete.js.map +1 -1
  117. package/dist/commands/repo/events.js +1 -1
  118. package/dist/commands/repo/events.js.map +1 -1
  119. package/dist/commands/repo/fork.js +1 -1
  120. package/dist/commands/repo/fork.js.map +1 -1
  121. package/dist/commands/repo/forks.js +1 -1
  122. package/dist/commands/repo/forks.js.map +1 -1
  123. package/dist/commands/repo/get-remote.js +1 -1
  124. package/dist/commands/repo/get-remote.js.map +1 -1
  125. package/dist/commands/repo/languages.js +1 -1
  126. package/dist/commands/repo/languages.js.map +1 -1
  127. package/dist/commands/repo/list.js +1 -1
  128. package/dist/commands/repo/list.js.map +1 -1
  129. package/dist/commands/repo/module.js +1 -1
  130. package/dist/commands/repo/module.js.map +1 -1
  131. package/dist/commands/repo/roles.js +1 -1
  132. package/dist/commands/repo/roles.js.map +1 -1
  133. package/dist/commands/repo/set-remote.js +1 -1
  134. package/dist/commands/repo/set-remote.js.map +1 -1
  135. package/dist/commands/repo/settings.js +1 -1
  136. package/dist/commands/repo/settings.js.map +1 -1
  137. package/dist/commands/repo/stats.js +1 -1
  138. package/dist/commands/repo/stats.js.map +1 -1
  139. package/dist/commands/repo/transfer.js +1 -1
  140. package/dist/commands/repo/transfer.js.map +1 -1
  141. package/dist/commands/repo/transition.js +1 -1
  142. package/dist/commands/repo/transition.js.map +1 -1
  143. package/dist/commands/repo/update.js +1 -1
  144. package/dist/commands/repo/update.js.map +1 -1
  145. package/dist/commands/repo/view.js +1 -1
  146. package/dist/commands/repo/view.js.map +1 -1
  147. package/dist/commands/search/code.js +1 -1
  148. package/dist/commands/search/code.js.map +1 -1
  149. package/dist/commands/search/issues.js +1 -1
  150. package/dist/commands/search/issues.js.map +1 -1
  151. package/dist/commands/search/repos.js +1 -1
  152. package/dist/commands/search/repos.js.map +1 -1
  153. package/dist/commands/tag/list.js +1 -1
  154. package/dist/commands/tag/list.js.map +1 -1
  155. package/dist/commands/tag/protect.js +1 -1
  156. package/dist/commands/tag/protect.js.map +1 -1
  157. package/dist/commands/user/edit.js +2 -2
  158. package/dist/commands/user/emails.js +1 -1
  159. package/dist/commands/user/events.d.ts +1 -1
  160. package/dist/commands/user/events.js +3 -7
  161. package/dist/commands/user/events.js.map +1 -1
  162. package/dist/commands/user/followers.js +2 -2
  163. package/dist/commands/user/following.js +2 -2
  164. package/dist/commands/user/issues.js +3 -3
  165. package/dist/commands/user/key-add.js +1 -1
  166. package/dist/commands/user/key-delete.js +1 -1
  167. package/dist/commands/user/keys.js +1 -1
  168. package/dist/commands/user/leave-org.js +1 -1
  169. package/dist/commands/user/membership.js +1 -1
  170. package/dist/commands/user/namespace.js +2 -2
  171. package/dist/commands/user/namespaces.js +2 -2
  172. package/dist/commands/user/orgs.js +1 -1
  173. package/dist/commands/user/prs.js +3 -3
  174. package/dist/commands/user/search.js +2 -2
  175. package/dist/commands/user/starred.js +3 -3
  176. package/dist/commands/user/subscriptions.js +3 -3
  177. package/dist/commands/user/view.js +2 -2
  178. package/package.json +5 -3
  179. package/skills/gitcode-cli/INSTALL.md +112 -0
  180. package/skills/gitcode-cli/SKILL.md +152 -0
  181. package/skills/gitcode-cli/agents/openai.yaml +7 -0
  182. package/skills/gitcode-cli/references/commands.md +382 -0
  183. package/dist/commands/search/users.d.ts +0 -16
  184. package/dist/commands/search/users.js +0 -52
  185. package/dist/commands/search/users.js.map +0 -1
  186. package/dist/commands/user/key-get.d.ts +0 -12
  187. package/dist/commands/user/key-get.js +0 -36
  188. package/dist/commands/user/key-get.js.map +0 -1
  189. package/dist/commands/user/update.d.ts +0 -15
  190. package/dist/commands/user/update.js +0 -60
  191. package/dist/commands/user/update.js.map +0 -1
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: gitcode-cli
3
+ description: Use when managing GitCode repositories from the terminal with the oh-gc CLI, including auth, issues, PRs, reviewers, testers, labels, releases, repository settings, and GitCode URLs. Trigger when a user asks to run, choose, script, or troubleshoot oh-gc commands or interact with GitCode without a browser.
4
+ ---
5
+
6
+ # oh-gc CLI - GitCode Command Line Tool
7
+
8
+ **Version:** 0.7.6 | **Updated:** 2026-05-17
9
+
10
+ `oh-gc` is a CLI for [GitCode](https://gitcode.com), modeled after GitHub CLI (`gh`). It manages authentication, issues, pull requests, releases, repository settings, and repository content from the terminal.
11
+
12
+ **Package:** `npm install -g @oh-gc/cli` (requires Node.js 18+)
13
+
14
+ For exact command flags and examples, read [references/commands.md](references/commands.md). If that file is unavailable, use `oh-gc <topic> <command> --help`.
15
+
16
+ ## Operating Rules
17
+
18
+ - Before executing the first `oh-gc` command in a session, run `oh-gc --version`.
19
+ - If `oh-gc` is missing or is not version `0.7.6`, install `npm install -g @oh-gc/cli@0.7.6` before using other `oh-gc` commands.
20
+ - Follow the host tool's approval model for installation, login, publishing, network access, or any other restricted action.
21
+ - Prefer `--json` for scripting and parse it with a structured parser such as `jq` when available.
22
+ - Use `--repo owner/repo` when the current directory is not the target repository or when working across repositories.
23
+ - Do not guess GitCode PR URLs: use `https://gitcode.com/{owner}/{repo}/pull/{number}` with singular `pull`.
24
+
25
+ ## State-Changing Commands
26
+
27
+ Read-only commands can be run when they answer the user's request. For commands that mutate GitCode or git state, make sure the user explicitly requested the action and the target repository is unambiguous.
28
+
29
+ State-changing actions include:
30
+
31
+ - Creating, updating, closing, reopening, merging, approving, testing, assigning, labeling, linking, or deleting issues/PRs/comments.
32
+ - Creating, updating, deleting, protecting, archiving, transferring, or changing settings for repos, branches, tags, files, collaborators, labels, milestones, hooks, SSH keys, modules, or permission modes.
33
+ - Running `oh-gc release create`, which can run tests/builds, create commits/tags, push to git, create a GitCode release, and upload assets.
34
+
35
+ For high-impact actions such as `repo delete`, `repo archive`, `repo transfer`, `release create`, `pr merge`, `branch delete`, `tag delete`, `file delete`, and forced review/test approval, restate the target and proceed only when the user's request is explicit.
36
+
37
+ ## Mandatory Preflight
38
+
39
+ 1. Version: `oh-gc --version`
40
+ 2. Auth: `oh-gc auth status`
41
+ - If not logged in: `oh-gc auth login`
42
+ - Token source: GitCode -> 个人设置 -> 访问令牌
43
+ 3. Repository context:
44
+ - Inside a git repo with a `gitcode.com` remote, or
45
+ - Pass `--repo owner/repo`
46
+
47
+ Most repository commands support:
48
+
49
+ - `--repo owner/repo` - target repository in OWNER/REPO format
50
+ - `--json` - raw JSON output
51
+ - `--help` - command help
52
+
53
+ Remote override is stored at `.gitcode/oh-gc-config.json` and managed by `oh-gc repo set-remote <name>` / `oh-gc repo get-remote`.
54
+
55
+ ## PR Template Rule
56
+
57
+ `oh-gc pr create` does **not** automatically read `.gitcode/PULL_REQUEST_TEMPLATE.md`. Agents must handle templates explicitly.
58
+
59
+ Before creating a PR:
60
+
61
+ 1. Determine the target repository and base branch.
62
+ 2. Check for a template in the target repository:
63
+ - Local target repo: `test -f .gitcode/PULL_REQUEST_TEMPLATE.md && cat .gitcode/PULL_REQUEST_TEMPLATE.md`
64
+ - Remote/cross-repo target: `oh-gc file raw .gitcode/PULL_REQUEST_TEMPLATE.md <base-branch> --repo owner/repo`
65
+ - If the template lookup returns "not found", proceed without a template.
66
+ 3. If a template exists, build the PR body around its sections and fill them in.
67
+ 4. For non-interactive automation, pass the filled body with `--body`. Otherwise, create the PR and immediately run `oh-gc pr update <number> --body "<filled template>"`.
68
+ 5. Do not replace the template with a free-form body unless the user explicitly requests that.
69
+
70
+ For fork-to-upstream PRs, `--repo` targets the upstream repo and `--head` must use `owner:branch` format, not `owner/branch`.
71
+
72
+ ```bash
73
+ oh-gc pr create --repo upstream-owner/repo --head myname:my-feature --base main --title "Fix bug" --body "<filled template>"
74
+ ```
75
+
76
+ ## Common Workflows
77
+
78
+ ### Issue Triage
79
+
80
+ ```bash
81
+ oh-gc issue list --search "crash"
82
+ oh-gc issue view 15
83
+ oh-gc issue comment 15 --body "Investigating, likely related to #12"
84
+ oh-gc issue update 15 --labels "bug,P0" --assignee bob
85
+ ```
86
+
87
+ ### PR Review
88
+
89
+ ```bash
90
+ oh-gc pr view 42 --json
91
+ oh-gc pr diff 42
92
+ oh-gc pr comments 42 --latest
93
+ oh-gc pr comment 42 --body "Please update the tests."
94
+ ```
95
+
96
+ Only approve, mark tests passed, or merge when explicitly requested:
97
+
98
+ ```bash
99
+ oh-gc pr review 42
100
+ oh-gc pr test 42
101
+ oh-gc pr merge 42 --method squash
102
+ ```
103
+
104
+ ### Cross-Repo PR
105
+
106
+ ```bash
107
+ oh-gc pr create --repo upstream-owner/repo --head myname:my-feature --base master --title "Fix bug" --body "<filled template or summary>"
108
+ oh-gc pr view 42 --repo upstream-owner/repo --json
109
+ ```
110
+
111
+ ## Command Selection
112
+
113
+ Read [references/commands.md](references/commands.md) for the full command catalog. This map is for choosing the command family quickly:
114
+
115
+ - Auth: `oh-gc auth login/status/logout`
116
+ - Issues: `oh-gc issue list/view/create/update/comment/close/reopen/labels/history/reactions/prs/branches`
117
+ - PRs: `oh-gc pr list/view/create/update/close/reopen/diff/comment/comments/reviewers/testers/review/test/labels/link/merge/files/history/logs`
118
+ - Repos: `oh-gc repo list/view/create/update/delete/fork/forks/settings/languages/contributors/events/stats/archive/transition/module/roles/transfer`
119
+ - Users: `oh-gc user view/edit/emails/followers/following/events/search/keys/starred/subscriptions/issues/prs/orgs`
120
+ - Branches/tags: `oh-gc branch ...`, `oh-gc tag ...`
121
+ - Contents: `oh-gc file get/raw/list/create/update/delete`, `oh-gc commit ...`
122
+ - Admin objects: `oh-gc collaborator ...`, `oh-gc label ...`, `oh-gc milestone ...`, `oh-gc hook ...`, `oh-gc org ...`
123
+ - Search/release: `oh-gc search repos/issues/code`, `oh-gc release create`
124
+
125
+ ## Configuration
126
+
127
+ | Setting | Location | How to set |
128
+ |---------|----------|------------|
129
+ | Auth token | `~/.config/gitcode-cli/config.json` | `oh-gc auth login` |
130
+ | Remote override | `.gitcode/oh-gc-config.json` | `oh-gc repo set-remote <name>` |
131
+ | Proxy | `https_proxy` / `HTTPS_PROXY` env var | Automatic |
132
+
133
+ ## Error Handling
134
+
135
+ | Error | Cause | Fix |
136
+ |-------|-------|-----|
137
+ | "Not logged in" | No token configured | `oh-gc auth login` |
138
+ | "Authentication failed" | Token expired or invalid | Re-run `oh-gc auth login` with a new token |
139
+ | "Remote not found" | Not in a git repo or remote missing | `cd` to repo, check `git remote -v`, or pass `--repo owner/repo` |
140
+ | "Not a GitCode repository" | Remote URL is not `gitcode.com` | Add a GitCode remote or pass `--repo owner/repo` |
141
+ | "Could not connect" | Network/proxy issue | Check network; set `https_proxy` / `HTTPS_PROXY` if needed |
142
+ | "Rate limit exceeded" | Too many API calls | Wait and retry |
143
+ | "Can not find the branch" | Cross-repo PR `--head` lacks fork owner | Use `--head owner:branch` |
144
+ | PR body missing template fields | Template was skipped or replaced | Read the template and update the PR body with filled sections |
145
+
146
+ ## Tips
147
+
148
+ - `oh-gc file raw <path> <ref>` prints decoded content; `oh-gc file get <path> --ref <ref>` prints metadata plus base64 content.
149
+ - `oh-gc pr comments --comment-type diff_comment` filters to code review comments.
150
+ - `oh-gc pr reviewers --append` adds reviewers without replacing existing reviewers.
151
+ - `oh-gc pr update --state closed` closes a PR without merging.
152
+ - When reporting PR links, always use `https://gitcode.com/{owner}/{repo}/pull/{number}`.
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "GitCode CLI"
3
+ short_description: "Manage GitCode repositories with oh-gc"
4
+ default_prompt: "Use $gitcode-cli to list open PRs for this GitCode repository."
5
+
6
+ policy:
7
+ allow_implicit_invocation: true
@@ -0,0 +1,382 @@
1
+ # oh-gc Command Reference
2
+
3
+ Use this reference for exact `oh-gc` command names, common flags, and examples.
4
+
5
+ ## Authentication
6
+
7
+ ```bash
8
+ oh-gc auth login # Log in with personal access token
9
+ oh-gc auth logout # Remove stored token
10
+ oh-gc auth status # Show current user info
11
+ ```
12
+
13
+ Token is stored at `~/.config/gitcode-cli/config.json`.
14
+
15
+ ## Repository Flag
16
+
17
+ Most repository commands support:
18
+
19
+ ```bash
20
+ oh-gc issue list --repo openharmony/arkui_ace_engine
21
+ oh-gc issue create --repo owner/repo --title "Bug report"
22
+ oh-gc pr view 123 --repo owner/repo
23
+ oh-gc pr create --repo upstream-owner/repo --head myname:my-feature --base main
24
+ ```
25
+
26
+ ## Issues
27
+
28
+ ```bash
29
+ # List and view
30
+ oh-gc issue list
31
+ oh-gc issue list --state closed
32
+ oh-gc issue list --state all
33
+ oh-gc issue list --assignee alice
34
+ oh-gc issue list --search "login bug"
35
+ oh-gc issue list --limit 50
36
+ oh-gc issue view 12
37
+
38
+ # Create
39
+ oh-gc issue create
40
+ oh-gc issue create --title "Bug" --body "..."
41
+ oh-gc issue create --repo owner/repo --title "Bug"
42
+ oh-gc issue create --assignee alice --labels "bug,P0"
43
+
44
+ # Update
45
+ oh-gc issue update 12 --title "New title"
46
+ oh-gc issue update 12 --body "New body"
47
+ oh-gc issue update 12 --state closed
48
+ oh-gc issue update 12 --state open
49
+ oh-gc issue update 12 --labels "bug,urgent" --assignee bob
50
+
51
+ # Comment
52
+ oh-gc issue comment 12
53
+ oh-gc issue comment 12 --body "Confirmed"
54
+
55
+ # Close/reopen
56
+ oh-gc issue close 12
57
+ oh-gc issue reopen 12
58
+
59
+ # Labels
60
+ oh-gc issue labels 12 bug,feature
61
+ oh-gc issue labels 12 bug --remove
62
+
63
+ # History, reactions, related objects
64
+ oh-gc issue history 12
65
+ oh-gc issue reactions 12
66
+ oh-gc issue prs 12
67
+ oh-gc issue prs 12 --mode 1
68
+ oh-gc issue branches 12
69
+ oh-gc issue branches 12 --set feature-x,fix-y
70
+
71
+ # Comment management
72
+ oh-gc issue comment-get <id>
73
+ oh-gc issue comment-edit <id> --body "new"
74
+ oh-gc issue comment-delete <id>
75
+ oh-gc issue comment-history <id>
76
+ oh-gc issue comment-reactions <id>
77
+ ```
78
+
79
+ ## Pull Requests
80
+
81
+ Before creating a PR, read the PR template rule in `SKILL.md`. `oh-gc pr create` does not automatically load `.gitcode/PULL_REQUEST_TEMPLATE.md`.
82
+
83
+ ```bash
84
+ # List and view
85
+ oh-gc pr list
86
+ oh-gc pr list --state merged
87
+ oh-gc pr list --state all
88
+ oh-gc pr list --author alice
89
+ oh-gc pr list --reviewer bob
90
+ oh-gc pr list --assignee carol
91
+ oh-gc pr list --limit 50
92
+ oh-gc pr view 5
93
+
94
+ # Create
95
+ oh-gc pr create
96
+ oh-gc pr create --title "Fix bug" --base main --body "<filled template or summary>"
97
+ oh-gc pr create --head feature --base main --draft --body "<body>"
98
+ oh-gc pr create --repo owner/repo --head myname:feature --base main --body "<body>"
99
+
100
+ # Update
101
+ oh-gc pr update 5 --title "New title"
102
+ oh-gc pr update 5 --body "New description"
103
+ oh-gc pr update 5 --state closed
104
+ oh-gc pr update 5 --state open
105
+ oh-gc pr update 5 --draft
106
+ oh-gc pr update 5 --labels "bug,wip"
107
+
108
+ # Close/reopen
109
+ oh-gc pr close 5
110
+ oh-gc pr reopen 5
111
+
112
+ # Diff
113
+ oh-gc pr diff 5
114
+ oh-gc pr diff 5 --name-only
115
+ oh-gc pr diff 5 --color never
116
+
117
+ # Merge
118
+ oh-gc pr merge 5
119
+ oh-gc pr merge 5 --method squash
120
+ oh-gc pr merge 5 --method rebase
121
+
122
+ # Comment
123
+ oh-gc pr comment 5 --body "LGTM!"
124
+ oh-gc pr comment 5 --body "Fix this" --path src/main.ts --line 10
125
+ oh-gc pr comment 5 --repo owner/repo --body "Note"
126
+ oh-gc pr comment-reply 5 --comment-id 456 --body "Thanks, fixed"
127
+ oh-gc pr comment-reply 5 --discussion-id abc123 --body "Addressed"
128
+
129
+ # List/delete comments
130
+ oh-gc pr comments 5
131
+ oh-gc pr comments 5 --limit 10 --latest
132
+ oh-gc pr comments 5 --full-body
133
+ oh-gc pr comments 5 --comment-type diff_comment
134
+ oh-gc pr comments 5 --comment-type pr_comment
135
+ oh-gc pr comments 5 --delete 12345
136
+
137
+ # Reactions, commits, files, history
138
+ oh-gc pr reactions 5
139
+ oh-gc pr commits 5
140
+ oh-gc pr files 5
141
+ oh-gc pr history 5
142
+ oh-gc pr logs 5
143
+ oh-gc pr linked-issues 5
144
+
145
+ # Reviewers/testers/approval
146
+ oh-gc pr reviewers 5 alice,bob
147
+ oh-gc pr reviewers 5 alice --append
148
+ oh-gc pr reviewers 5 alice --remove
149
+ oh-gc pr testers 5 alice,bob
150
+ oh-gc pr testers 5 alice --append
151
+ oh-gc pr testers 5 alice --remove
152
+ oh-gc pr review 5
153
+ oh-gc pr review 5 --force
154
+ oh-gc pr test 5
155
+ oh-gc pr test 5 --force
156
+
157
+ # Labels, links, assignees
158
+ oh-gc pr labels 5 bug,enhancement
159
+ oh-gc pr labels 5 bug --remove
160
+ oh-gc pr labels 5 bug,feature --replace
161
+ oh-gc pr link 5 1,2,3
162
+ oh-gc pr link 5 1,2 --remove
163
+ oh-gc pr assignees 5 --add alice,bob
164
+ oh-gc pr assignees 5 --reset
165
+ oh-gc pr assignees 5 --reset --all
166
+ oh-gc pr assignees 5 --remove alice
167
+
168
+ # Settings and option reviewers
169
+ oh-gc pr settings
170
+ oh-gc pr settings-update --merge-method squash --delete-branch-on-merge
171
+ oh-gc pr option-reviewers 5
172
+
173
+ # Comment management
174
+ oh-gc pr comment-get <id>
175
+ oh-gc pr comment-edit <id> --body "new"
176
+ oh-gc pr comment-delete <id>
177
+ oh-gc pr comment-history <id>
178
+ oh-gc pr comment-reactions <id>
179
+ ```
180
+
181
+ ## Releases
182
+
183
+ `oh-gc release create` is high-impact: it can run tests/builds, create commits/tags, push to git, create the GitCode release, and upload assets.
184
+
185
+ ```bash
186
+ oh-gc release create
187
+ oh-gc release create v1.0.0
188
+ oh-gc release create --prerelease
189
+ oh-gc release create v1.0.0 --notes "..."
190
+ ```
191
+
192
+ ## Repositories
193
+
194
+ ```bash
195
+ # List, view, create, update
196
+ oh-gc repo list
197
+ oh-gc repo list --org myorg
198
+ oh-gc repo list --user alice
199
+ oh-gc repo list --visibility private
200
+ oh-gc repo view
201
+ oh-gc repo create myrepo
202
+ oh-gc repo create myrepo --org myorg
203
+ oh-gc repo update --description "..."
204
+
205
+ # High-impact repo operations
206
+ oh-gc repo delete --repo owner/repo --yes
207
+ oh-gc repo transfer <new-owner>
208
+ oh-gc repo archive --password secret
209
+ oh-gc repo archive --open --password secret
210
+
211
+ # Forks and metadata
212
+ oh-gc repo fork
213
+ oh-gc repo fork --org myorg
214
+ oh-gc repo forks
215
+ oh-gc repo languages
216
+ oh-gc repo contributors
217
+ oh-gc repo contributors --stats
218
+ oh-gc repo events
219
+ oh-gc repo events --filter push
220
+ oh-gc repo stats --branch main
221
+ oh-gc repo stats --downloads
222
+
223
+ # Settings and modules
224
+ oh-gc repo settings
225
+ oh-gc repo settings --disable-fork
226
+ oh-gc repo settings --open-gpg --lfs
227
+ oh-gc repo transition
228
+ oh-gc repo transition --mode 2
229
+ oh-gc repo module --wiki --issues
230
+ oh-gc repo module --no-fork
231
+ oh-gc repo roles
232
+
233
+ # Remote config
234
+ oh-gc repo get-remote
235
+ oh-gc repo set-remote upstream
236
+ ```
237
+
238
+ Remote override is stored at `.gitcode/oh-gc-config.json`.
239
+
240
+ ## Search
241
+
242
+ ```bash
243
+ oh-gc search repos "keyword"
244
+ oh-gc search issues "keyword"
245
+ oh-gc search code "keyword"
246
+ ```
247
+
248
+ ## Users
249
+
250
+ ```bash
251
+ oh-gc user view
252
+ oh-gc user view alice
253
+ oh-gc user edit --name "New Name" --bio "..."
254
+ oh-gc user edit --avatar "https://..."
255
+ oh-gc user emails
256
+ oh-gc user followers
257
+ oh-gc user following
258
+ oh-gc user events alice
259
+ oh-gc user events alice --year 2024
260
+ oh-gc user search alice
261
+ oh-gc user search bob --sort joined_at
262
+ oh-gc user namespace alice
263
+ oh-gc user namespaces
264
+ oh-gc user namespaces --mode project
265
+ oh-gc user keys
266
+ oh-gc user key-add --title "My Key" --key "ssh-rsa ..."
267
+ oh-gc user key-delete 123
268
+ oh-gc user starred
269
+ oh-gc user starred alice
270
+ oh-gc user subscriptions
271
+ oh-gc user subscriptions alice
272
+ oh-gc user issues
273
+ oh-gc user issues --state closed --filter created
274
+ oh-gc user issues --since "2024-01-01T00:00:00Z"
275
+ oh-gc user prs
276
+ oh-gc user prs --state merged --scope assigned_to_me
277
+ oh-gc user prs --source-branch feature --target-branch main
278
+ oh-gc user orgs alice
279
+ oh-gc user membership myorg
280
+ oh-gc user leave-org myorg
281
+ ```
282
+
283
+ ## Branches
284
+
285
+ ```bash
286
+ oh-gc branch list
287
+ oh-gc branch list --protected
288
+ oh-gc branch get <name>
289
+ oh-gc branch create <name> --ref <sha/branch>
290
+ oh-gc branch delete <name>
291
+ oh-gc branch protect <name>
292
+ oh-gc branch protect <name> --enforce-admins
293
+ oh-gc branch protect <name> --require-status-checks ci,lint
294
+ oh-gc branch protect <name> --dismiss-stale-reviews
295
+ oh-gc branch protect <name> --unprotect
296
+ oh-gc branch protect-rules
297
+ oh-gc branch protect-rule-create <pattern> --pusher <roles> --merger <roles>
298
+ oh-gc branch protect-rule-update <pattern> --pusher <roles> --merger <roles>
299
+ oh-gc branch protect-rule-delete <pattern>
300
+ ```
301
+
302
+ ## Commits
303
+
304
+ ```bash
305
+ oh-gc commit list
306
+ oh-gc commit list --sha main
307
+ oh-gc commit get <sha>
308
+ oh-gc commit diff <sha>
309
+ oh-gc commit compare <base> <head>
310
+ oh-gc commit comments <sha>
311
+ oh-gc commit comment <sha> --body "text"
312
+ ```
313
+
314
+ ## Files
315
+
316
+ ```bash
317
+ oh-gc file get <path>
318
+ oh-gc file get <path> --ref main
319
+ oh-gc file raw <path> main
320
+ oh-gc file list
321
+ oh-gc file create <path> --content "text" --message "msg"
322
+ oh-gc file update <path> --sha <sha> --content "text" --message "msg"
323
+ oh-gc file delete <path> --sha <sha> --message "msg"
324
+ ```
325
+
326
+ ## Collaborators
327
+
328
+ ```bash
329
+ oh-gc collaborator list
330
+ oh-gc collaborator add <username>
331
+ oh-gc collaborator remove <username>
332
+ oh-gc collaborator permission <username>
333
+ ```
334
+
335
+ ## Labels
336
+
337
+ ```bash
338
+ oh-gc label list
339
+ oh-gc label create
340
+ oh-gc label update <name>
341
+ oh-gc label delete <name>
342
+ ```
343
+
344
+ ## Milestones
345
+
346
+ ```bash
347
+ oh-gc milestone list
348
+ oh-gc milestone get <number>
349
+ oh-gc milestone create
350
+ oh-gc milestone update <number>
351
+ oh-gc milestone delete <number>
352
+ ```
353
+
354
+ ## Webhooks
355
+
356
+ ```bash
357
+ oh-gc hook list
358
+ oh-gc hook get <id>
359
+ oh-gc hook create "webhook" --url https://example.com/hook --events push
360
+ oh-gc hook delete <id>
361
+ ```
362
+
363
+ ## Tags
364
+
365
+ ```bash
366
+ oh-gc tag list
367
+ oh-gc tag create <name> --ref <sha/branch>
368
+ oh-gc tag delete <name>
369
+ oh-gc tag protect <name>
370
+ oh-gc tag protect-get <name>
371
+ oh-gc tag protect-create <name> --access-level 40
372
+ oh-gc tag protect-update <name> --access-level 30
373
+ oh-gc tag protect-delete <name>
374
+ ```
375
+
376
+ ## Organizations
377
+
378
+ ```bash
379
+ oh-gc org list
380
+ oh-gc org view <org>
381
+ oh-gc org members <org>
382
+ ```
@@ -1,16 +0,0 @@
1
- import { BaseCommand } from '../../base-command';
2
- export default class SearchUsers extends BaseCommand {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
- order: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
- page: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
9
- 'per-page': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
10
- json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
- };
12
- static args: {
13
- query: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
14
- };
15
- run(): Promise<void>;
16
- }
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const base_command_1 = require("../../base-command");
4
- const search_1 = require("../../api/search");
5
- const config_1 = require("../../config");
6
- const ui_1 = require("../../ui");
7
- const core_1 = require("@oclif/core");
8
- class SearchUsers extends base_command_1.BaseCommand {
9
- async run() {
10
- const { flags, args } = await this.parse(SearchUsers);
11
- const token = (0, config_1.getToken)();
12
- if (!token) {
13
- this.error('Not authenticated. Run: oh-gc auth login');
14
- }
15
- const result = await (0, search_1.searchUsers)(token, {
16
- q: args.query,
17
- sort: flags.sort,
18
- order: flags.order,
19
- page: flags.page,
20
- per_page: flags['per-page'],
21
- });
22
- if (flags.json) {
23
- (0, ui_1.printJson)(result);
24
- }
25
- else {
26
- this.log(`Found ${result.total_count} users`);
27
- if (result.items.length > 0) {
28
- (0, ui_1.printTable)(result.items.map((u) => ({
29
- login: u.login,
30
- name: u.name,
31
- })), ['login', 'name']);
32
- }
33
- }
34
- }
35
- }
36
- SearchUsers.description = 'Search users';
37
- SearchUsers.examples = [
38
- '<%= config.bin %> search users alice',
39
- '<%= config.bin %> search users "john doe" --sort joined_at',
40
- ];
41
- SearchUsers.flags = {
42
- ...base_command_1.BaseCommand.baseFlags,
43
- sort: core_1.Flags.string({ description: 'Sort field', options: ['joined_at'] }),
44
- order: core_1.Flags.string({ description: 'Sort order', options: ['asc', 'desc'] }),
45
- page: core_1.Flags.integer({ description: 'Page number', default: 1 }),
46
- 'per-page': core_1.Flags.integer({ description: 'Results per page', default: 30 }),
47
- };
48
- SearchUsers.args = {
49
- query: core_1.Args.string({ description: 'Search query', required: true }),
50
- };
51
- exports.default = SearchUsers;
52
- //# sourceMappingURL=users.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/commands/search/users.ts"],"names":[],"mappings":";;AAAA,qDAAgD;AAChD,6CAA8C;AAC9C,yCAAuC;AACvC,iCAAgD;AAChD,sCAAyC;AAEzC,MAAqB,WAAY,SAAQ,0BAAW;IAoBlD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACrD,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAA;QACxB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACxD,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAW,EAAC,KAAK,EAAE;YACtC,CAAC,EAAE,IAAI,CAAC,KAAK;YACb,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAmC;YAChD,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC;SAC5B,CAAC,CAAA;QAEF,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,IAAA,cAAS,EAAC,MAAM,CAAC,CAAA;QACnB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,WAAW,QAAQ,CAAC,CAAA;YAC7C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,IAAA,eAAU,EACR,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACvB,KAAK,EAAE,CAAC,CAAC,KAAK;oBACd,IAAI,EAAE,CAAC,CAAC,IAAI;iBACb,CAAC,CAAC,EACH,CAAC,OAAO,EAAE,MAAM,CAAC,CAClB,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;;AAhDM,uBAAW,GAAG,cAAc,CAAA;AAE5B,oBAAQ,GAAG;IAChB,sCAAsC;IACtC,4DAA4D;CAC7D,CAAA;AAEM,iBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;IACzE,KAAK,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;IAC5E,IAAI,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC/D,UAAU,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;CAC5E,CAAA;AAEM,gBAAI,GAAG;IACZ,KAAK,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CACpE,CAAA;kBAlBkB,WAAW"}
@@ -1,12 +0,0 @@
1
- import { BaseCommand } from '../../base-command';
2
- export default class UserKeyGet extends BaseCommand {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
- };
8
- static args: {
9
- id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
10
- };
11
- run(): Promise<void>;
12
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const base_command_1 = require("../../base-command");
4
- const user_1 = require("../../api/user");
5
- const config_1 = require("../../config");
6
- const ui_1 = require("../../ui");
7
- const core_1 = require("@oclif/core");
8
- class UserKeyGet extends base_command_1.BaseCommand {
9
- async run() {
10
- const { flags, args } = await this.parse(UserKeyGet);
11
- const token = (0, config_1.getToken)();
12
- if (!token) {
13
- this.error('Not authenticated. Run: oh-gc auth login');
14
- }
15
- const key = await (0, user_1.getUserKey)(token, args.id);
16
- if (flags.json) {
17
- (0, ui_1.printJson)(key);
18
- }
19
- else {
20
- this.log(`ID: ${key.id}`);
21
- this.log(`Title: ${key.title}`);
22
- this.log(`Key: ${key.key}`);
23
- this.log(`Created: ${key.created_at}`);
24
- }
25
- }
26
- }
27
- UserKeyGet.description = 'View an SSH public key';
28
- UserKeyGet.examples = ['<%= config.bin %> user key-get 12345'];
29
- UserKeyGet.flags = {
30
- ...base_command_1.BaseCommand.baseFlags,
31
- };
32
- UserKeyGet.args = {
33
- id: core_1.Args.string({ description: 'Key ID', required: true }),
34
- };
35
- exports.default = UserKeyGet;
36
- //# sourceMappingURL=key-get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"key-get.js","sourceRoot":"","sources":["../../../src/commands/user/key-get.ts"],"names":[],"mappings":";;AAAA,qDAAgD;AAChD,yCAA2C;AAC3C,yCAAuC;AACvC,iCAAoC;AACpC,sCAAkC;AAElC,MAAqB,UAAW,SAAQ,0BAAW;IAajD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACpD,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAA;QACxB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACxD,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,IAAA,iBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;QAE5C,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,IAAA,cAAS,EAAC,GAAG,CAAC,CAAA;QAChB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,EAAE,EAAE,CAAC,CAAA;YACzB,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAC/B,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAC,CAAA;YAC3B,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,UAAU,EAAE,CAAC,CAAA;QACxC,CAAC;IACH,CAAC;;AA7BM,sBAAW,GAAG,wBAAwB,CAAA;AAEtC,mBAAQ,GAAG,CAAC,sCAAsC,CAAC,CAAA;AAEnD,gBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;CACzB,CAAA;AAEM,eAAI,GAAG;IACZ,EAAE,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CAC3D,CAAA;kBAXkB,UAAU"}
@@ -1,15 +0,0 @@
1
- import { BaseCommand } from '../../base-command';
2
- export default class UserUpdate extends BaseCommand {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
- company: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
- bio: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
- email: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
- blog: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
- location: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
- json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
- };
14
- run(): Promise<void>;
15
- }