winter-super-cli 2026.6.26 → 2026.6.27
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.
- package/CHANGELOG.md +28 -5
- package/README.md +66 -0
- package/package.json +5 -1
- package/resources/local/gsap-skills/.claude-plugin/marketplace.json +20 -0
- package/resources/local/gsap-skills/.claude-plugin/plugin.json +6 -0
- package/resources/local/gsap-skills/.cursor-plugin/marketplace.json +13 -0
- package/resources/local/gsap-skills/.cursor-plugin/plugin.json +22 -0
- package/resources/local/gsap-skills/.github/copilot-instructions.md +17 -0
- package/resources/local/gsap-skills/.github/instructions/react.instructions.md +15 -0
- package/resources/local/gsap-skills/.github/instructions/scrolltrigger.instructions.md +18 -0
- package/resources/local/gsap-skills/AGENTS.md +27 -0
- package/resources/local/gsap-skills/CLAUDE.md +1 -0
- package/resources/local/gsap-skills/GEMINI.md +1 -0
- package/resources/local/gsap-skills/LICENSE +21 -0
- package/resources/local/gsap-skills/README.md +163 -0
- package/resources/local/gsap-skills/assets/gsap-green.svg +7 -0
- package/resources/local/gsap-skills/assets/gsap-icon-inverted.svg +15 -0
- package/resources/local/gsap-skills/assets/gsap-icon-square.svg +1 -0
- package/resources/local/gsap-skills/assets/gsap-white.svg +7 -0
- package/resources/local/gsap-skills/examples/README.md +29 -0
- package/resources/local/gsap-skills/examples/nuxt/app/app.vue +3 -0
- package/resources/local/gsap-skills/examples/nuxt/app/composables/useGSAP.ts +91 -0
- package/resources/local/gsap-skills/examples/nuxt/app/pages/index.vue +55 -0
- package/resources/local/gsap-skills/examples/nuxt/nuxt.config.ts +4 -0
- package/resources/local/gsap-skills/examples/nuxt/package.json +18 -0
- package/resources/local/gsap-skills/examples/react/App.jsx +46 -0
- package/resources/local/gsap-skills/examples/react/index.html +12 -0
- package/resources/local/gsap-skills/examples/react/main.jsx +9 -0
- package/resources/local/gsap-skills/examples/react/package.json +21 -0
- package/resources/local/gsap-skills/examples/react/vite.config.js +7 -0
- package/resources/local/gsap-skills/examples/vanilla/index.html +33 -0
- package/resources/local/gsap-skills/examples/vanilla/main.js +36 -0
- package/resources/local/gsap-skills/examples/vue/app.vue +47 -0
- package/resources/local/gsap-skills/examples/vue/index.html +15 -0
- package/resources/local/gsap-skills/examples/vue/main.js +9 -0
- package/resources/local/gsap-skills/examples/vue/package.json +19 -0
- package/resources/local/gsap-skills/examples/vue/vite.config.js +7 -0
- package/resources/local/gsap-skills/skills/gsap-core/SKILL.md +254 -0
- package/resources/local/gsap-skills/skills/gsap-frameworks/SKILL.md +266 -0
- package/resources/local/gsap-skills/skills/gsap-performance/SKILL.md +79 -0
- package/resources/local/gsap-skills/skills/gsap-plugins/SKILL.md +433 -0
- package/resources/local/gsap-skills/skills/gsap-react/SKILL.md +136 -0
- package/resources/local/gsap-skills/skills/gsap-scrolltrigger/SKILL.md +296 -0
- package/resources/local/gsap-skills/skills/gsap-timeline/SKILL.md +107 -0
- package/resources/local/gsap-skills/skills/gsap-utils/SKILL.md +284 -0
- package/resources/local/gsap-skills/skills/llms.txt +39 -0
- package/resources/local/hermes-agent-core/AGENTS.md +1132 -0
- package/resources/local/hermes-agent-core/LICENSE +21 -0
- package/resources/local/hermes-agent-core/README.md +215 -0
- package/resources/local/hermes-agent-core/docs/2026-05-07-s6-overlay-dynamic-subagent-gateways.md +434 -0
- package/resources/local/hermes-agent-core/hermes-already-has-routines.md +160 -0
- package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/DESCRIPTION.md +3 -0
- package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/claude-code/SKILL.md +745 -0
- package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/codex/SKILL.md +130 -0
- package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/hermes-agent/SKILL.md +1021 -0
- package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/kanban-codex-lane/SKILL.md +277 -0
- package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/kanban-codex-lane/templates/pmb-codex-lane-prompt.md +57 -0
- package/resources/local/hermes-agent-core/skills/autonomous-ai-agents/opencode/SKILL.md +219 -0
- package/resources/local/hermes-agent-core/skills/github/DESCRIPTION.md +3 -0
- package/resources/local/hermes-agent-core/skills/github/codebase-inspection/SKILL.md +116 -0
- package/resources/local/hermes-agent-core/skills/github/github-auth/SKILL.md +247 -0
- package/resources/local/hermes-agent-core/skills/github/github-auth/scripts/gh-env.sh +66 -0
- package/resources/local/hermes-agent-core/skills/github/github-code-review/SKILL.md +481 -0
- package/resources/local/hermes-agent-core/skills/github/github-code-review/references/review-output-template.md +74 -0
- package/resources/local/hermes-agent-core/skills/github/github-issues/SKILL.md +370 -0
- package/resources/local/hermes-agent-core/skills/github/github-issues/templates/bug-report.md +35 -0
- package/resources/local/hermes-agent-core/skills/github/github-issues/templates/feature-request.md +31 -0
- package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/SKILL.md +367 -0
- package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/references/ci-troubleshooting.md +183 -0
- package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/references/conventional-commits.md +71 -0
- package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/templates/pr-body-bugfix.md +35 -0
- package/resources/local/hermes-agent-core/skills/github/github-pr-workflow/templates/pr-body-feature.md +33 -0
- package/resources/local/hermes-agent-core/skills/github/github-repo-management/SKILL.md +516 -0
- package/resources/local/hermes-agent-core/skills/github/github-repo-management/references/github-api-cheatsheet.md +161 -0
- package/resources/local/hermes-agent-core/skills/mcp/DESCRIPTION.md +3 -0
- package/resources/local/hermes-agent-core/skills/mcp/native-mcp/SKILL.md +357 -0
- package/resources/local/hermes-agent-core/skills/software-development/debugging-hermes-tui-commands/SKILL.md +152 -0
- package/resources/local/hermes-agent-core/skills/software-development/hermes-agent-skill-authoring/SKILL.md +165 -0
- package/resources/local/hermes-agent-core/skills/software-development/hermes-s6-container-supervision/SKILL.md +176 -0
- package/resources/local/hermes-agent-core/skills/software-development/node-inspect-debugger/SKILL.md +319 -0
- package/resources/local/hermes-agent-core/skills/software-development/plan/SKILL.md +58 -0
- package/resources/local/hermes-agent-core/skills/software-development/python-debugpy/SKILL.md +375 -0
- package/resources/local/hermes-agent-core/skills/software-development/requesting-code-review/SKILL.md +280 -0
- package/resources/local/hermes-agent-core/skills/software-development/spike/SKILL.md +197 -0
- package/resources/local/hermes-agent-core/skills/software-development/subagent-driven-development/SKILL.md +352 -0
- package/resources/local/hermes-agent-core/skills/software-development/subagent-driven-development/references/context-budget-discipline.md +53 -0
- package/resources/local/hermes-agent-core/skills/software-development/subagent-driven-development/references/gates-taxonomy.md +93 -0
- package/resources/local/hermes-agent-core/skills/software-development/systematic-debugging/SKILL.md +367 -0
- package/resources/local/hermes-agent-core/skills/software-development/test-driven-development/SKILL.md +343 -0
- package/resources/local/hermes-agent-core/skills/software-development/writing-plans/SKILL.md +297 -0
- package/resources/local/manifest.json +12 -0
- package/rule.md +2 -0
- package/scripts/audit-pack.js +5 -0
- package/scripts/smoke-browser.js +53 -0
- package/scripts/smoke-package.js +38 -4
- package/skill.md +36 -4
- package/skills/gsap.md +26 -0
- package/skills/hermes-agent.md +17 -0
- package/src/agent/agent-definitions.js +4 -4
- package/src/agent/runtime.js +179 -5
- package/src/agent/subagent-child.js +44 -0
- package/src/ai/capability-scorecard.js +193 -14
- package/src/ai/hermes-core.js +77 -0
- package/src/ai/model-capabilities.js +42 -2
- package/src/ai/prompts/system-prompt.js +16 -2
- package/src/ai/small-model-amplifier.js +35 -7
- package/src/ai/workflow-selector.js +22 -1
- package/src/cli/commands.js +21 -1
- package/src/cli/config.js +42 -4
- package/src/cli/context-loader.js +253 -9
- package/src/cli/conversation-format.js +5 -0
- package/src/cli/input-controller.js +79 -10
- package/src/cli/prompt-builder.js +45 -8
- package/src/cli/repl-commands.js +115 -0
- package/src/cli/repl.js +147 -86
- package/src/cli/slash-commands.js +3 -1
- package/src/cli/tui.js +133 -37
- package/src/mcp/client.js +46 -5
- package/src/tools/agent.js +316 -25
- package/src/tools/executor.js +310 -9
- package/src/tools/permission.js +20 -17
- package/winter.d.ts +112 -10
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github-repo-management
|
|
3
|
+
description: "Clone/create/fork repos; manage remotes, releases."
|
|
4
|
+
version: 1.1.0
|
|
5
|
+
author: Hermes Agent
|
|
6
|
+
license: MIT
|
|
7
|
+
platforms: [linux, macos, windows]
|
|
8
|
+
metadata:
|
|
9
|
+
hermes:
|
|
10
|
+
tags: [GitHub, Repositories, Git, Releases, Secrets, Configuration]
|
|
11
|
+
related_skills: [github-auth, github-pr-workflow, github-issues]
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# GitHub Repository Management
|
|
15
|
+
|
|
16
|
+
Create, clone, fork, configure, and manage GitHub repositories. Each section shows `gh` first, then the `git` + `curl` fallback.
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
- Authenticated with GitHub (see `github-auth` skill)
|
|
21
|
+
|
|
22
|
+
### Setup
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
if command -v gh &>/dev/null && gh auth status &>/dev/null; then
|
|
26
|
+
AUTH="gh"
|
|
27
|
+
else
|
|
28
|
+
AUTH="git"
|
|
29
|
+
if [ -z "$GITHUB_TOKEN" ]; then
|
|
30
|
+
if [ -f ~/.hermes/.env ] && grep -q "^GITHUB_TOKEN=" ~/.hermes/.env; then
|
|
31
|
+
GITHUB_TOKEN=$(grep "^GITHUB_TOKEN=" ~/.hermes/.env | head -1 | cut -d= -f2 | tr -d '\n\r')
|
|
32
|
+
elif grep -q "github.com" ~/.git-credentials 2>/dev/null; then
|
|
33
|
+
GITHUB_TOKEN=$(grep "github.com" ~/.git-credentials 2>/dev/null | head -1 | sed 's|https://[^:]*:\([^@]*\)@.*|\1|')
|
|
34
|
+
fi
|
|
35
|
+
fi
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Get your GitHub username (needed for several operations)
|
|
39
|
+
if [ "$AUTH" = "gh" ]; then
|
|
40
|
+
GH_USER=$(gh api user --jq '.login')
|
|
41
|
+
else
|
|
42
|
+
GH_USER=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user | python3 -c "import sys,json; print(json.load(sys.stdin)['login'])")
|
|
43
|
+
fi
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If you're inside a repo already:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
REMOTE_URL=$(git remote get-url origin)
|
|
50
|
+
OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
|
|
51
|
+
OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
|
|
52
|
+
REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 1. Cloning Repositories
|
|
58
|
+
|
|
59
|
+
Cloning is pure `git` — works identically either way:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Clone via HTTPS (works with credential helper or token-embedded URL)
|
|
63
|
+
git clone https://github.com/owner/repo-name.git
|
|
64
|
+
|
|
65
|
+
# Clone into a specific directory
|
|
66
|
+
git clone https://github.com/owner/repo-name.git ./my-local-dir
|
|
67
|
+
|
|
68
|
+
# Shallow clone (faster for large repos)
|
|
69
|
+
git clone --depth 1 https://github.com/owner/repo-name.git
|
|
70
|
+
|
|
71
|
+
# Clone a specific branch
|
|
72
|
+
git clone --branch develop https://github.com/owner/repo-name.git
|
|
73
|
+
|
|
74
|
+
# Clone via SSH (if SSH is configured)
|
|
75
|
+
git clone git@github.com:owner/repo-name.git
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**With gh (shorthand):**
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
gh repo clone owner/repo-name
|
|
82
|
+
gh repo clone owner/repo-name -- --depth 1
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 2. Creating Repositories
|
|
86
|
+
|
|
87
|
+
**With gh:**
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Create a public repo and clone it
|
|
91
|
+
gh repo create my-new-project --public --clone
|
|
92
|
+
|
|
93
|
+
# Private, with description and license
|
|
94
|
+
gh repo create my-new-project --private --description "A useful tool" --license MIT --clone
|
|
95
|
+
|
|
96
|
+
# Under an organization
|
|
97
|
+
gh repo create my-org/my-new-project --public --clone
|
|
98
|
+
|
|
99
|
+
# From existing local directory
|
|
100
|
+
cd /path/to/existing/project
|
|
101
|
+
gh repo create my-project --source . --public --push
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**With git + curl:**
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Create the remote repo via API
|
|
108
|
+
curl -s -X POST \
|
|
109
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
110
|
+
https://api.github.com/user/repos \
|
|
111
|
+
-d '{
|
|
112
|
+
"name": "my-new-project",
|
|
113
|
+
"description": "A useful tool",
|
|
114
|
+
"private": false,
|
|
115
|
+
"auto_init": true,
|
|
116
|
+
"license_template": "mit"
|
|
117
|
+
}'
|
|
118
|
+
|
|
119
|
+
# Clone it
|
|
120
|
+
git clone https://github.com/$GH_USER/my-new-project.git
|
|
121
|
+
cd my-new-project
|
|
122
|
+
|
|
123
|
+
# -- OR -- push an existing local directory to the new repo
|
|
124
|
+
cd /path/to/existing/project
|
|
125
|
+
git init
|
|
126
|
+
git add .
|
|
127
|
+
git commit -m "Initial commit"
|
|
128
|
+
git remote add origin https://github.com/$GH_USER/my-new-project.git
|
|
129
|
+
git push -u origin main
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
To create under an organization:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
curl -s -X POST \
|
|
136
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
137
|
+
https://api.github.com/orgs/my-org/repos \
|
|
138
|
+
-d '{"name": "my-new-project", "private": false}'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### From a Template
|
|
142
|
+
|
|
143
|
+
**With gh:**
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
gh repo create my-new-app --template owner/template-repo --public --clone
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**With curl:**
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
curl -s -X POST \
|
|
153
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
154
|
+
https://api.github.com/repos/owner/template-repo/generate \
|
|
155
|
+
-d '{"owner": "'"$GH_USER"'", "name": "my-new-app", "private": false}'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## 3. Forking Repositories
|
|
159
|
+
|
|
160
|
+
**With gh:**
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
gh repo fork owner/repo-name --clone
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**With git + curl:**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Create the fork via API
|
|
170
|
+
curl -s -X POST \
|
|
171
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
172
|
+
https://api.github.com/repos/owner/repo-name/forks
|
|
173
|
+
|
|
174
|
+
# Wait a moment for GitHub to create it, then clone
|
|
175
|
+
sleep 3
|
|
176
|
+
git clone https://github.com/$GH_USER/repo-name.git
|
|
177
|
+
cd repo-name
|
|
178
|
+
|
|
179
|
+
# Add the original repo as "upstream" remote
|
|
180
|
+
git remote add upstream https://github.com/owner/repo-name.git
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Keeping a Fork in Sync
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Pure git — works everywhere
|
|
187
|
+
git fetch upstream
|
|
188
|
+
git checkout main
|
|
189
|
+
git merge upstream/main
|
|
190
|
+
git push origin main
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**With gh (shortcut):**
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
gh repo sync $GH_USER/repo-name
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## 4. Repository Information
|
|
200
|
+
|
|
201
|
+
**With gh:**
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
gh repo view owner/repo-name
|
|
205
|
+
gh repo list --limit 20
|
|
206
|
+
gh search repos "machine learning" --language python --sort stars
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**With curl:**
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# View repo details
|
|
213
|
+
curl -s \
|
|
214
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
215
|
+
https://api.github.com/repos/$OWNER/$REPO \
|
|
216
|
+
| python3 -c "
|
|
217
|
+
import sys, json
|
|
218
|
+
r = json.load(sys.stdin)
|
|
219
|
+
print(f\"Name: {r['full_name']}\")
|
|
220
|
+
print(f\"Description: {r['description']}\")
|
|
221
|
+
print(f\"Stars: {r['stargazers_count']} Forks: {r['forks_count']}\")
|
|
222
|
+
print(f\"Default branch: {r['default_branch']}\")
|
|
223
|
+
print(f\"Language: {r['language']}\")"
|
|
224
|
+
|
|
225
|
+
# List your repos
|
|
226
|
+
curl -s \
|
|
227
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
228
|
+
"https://api.github.com/user/repos?per_page=20&sort=updated" \
|
|
229
|
+
| python3 -c "
|
|
230
|
+
import sys, json
|
|
231
|
+
for r in json.load(sys.stdin):
|
|
232
|
+
vis = 'private' if r['private'] else 'public'
|
|
233
|
+
print(f\" {r['full_name']:40} {vis:8} {r.get('language', ''):10} ★{r['stargazers_count']}\")"
|
|
234
|
+
|
|
235
|
+
# Search repos
|
|
236
|
+
curl -s \
|
|
237
|
+
"https://api.github.com/search/repositories?q=machine+learning+language:python&sort=stars&per_page=10" \
|
|
238
|
+
| python3 -c "
|
|
239
|
+
import sys, json
|
|
240
|
+
for r in json.load(sys.stdin)['items']:
|
|
241
|
+
print(f\" {r['full_name']:40} ★{r['stargazers_count']:6} {r['description'][:60] if r['description'] else ''}\")"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## 5. Repository Settings
|
|
245
|
+
|
|
246
|
+
**With gh:**
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
gh repo edit --description "Updated description" --visibility public
|
|
250
|
+
gh repo edit --enable-wiki=false --enable-issues=true
|
|
251
|
+
gh repo edit --default-branch main
|
|
252
|
+
gh repo edit --add-topic "machine-learning,python"
|
|
253
|
+
gh repo edit --enable-auto-merge
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**With curl:**
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
curl -s -X PATCH \
|
|
260
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
261
|
+
https://api.github.com/repos/$OWNER/$REPO \
|
|
262
|
+
-d '{
|
|
263
|
+
"description": "Updated description",
|
|
264
|
+
"has_wiki": false,
|
|
265
|
+
"has_issues": true,
|
|
266
|
+
"allow_auto_merge": true
|
|
267
|
+
}'
|
|
268
|
+
|
|
269
|
+
# Update topics
|
|
270
|
+
curl -s -X PUT \
|
|
271
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
272
|
+
-H "Accept: application/vnd.github.mercy-preview+json" \
|
|
273
|
+
https://api.github.com/repos/$OWNER/$REPO/topics \
|
|
274
|
+
-d '{"names": ["machine-learning", "python", "automation"]}'
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## 6. Branch Protection
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# View current protection
|
|
281
|
+
curl -s \
|
|
282
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
283
|
+
https://api.github.com/repos/$OWNER/$REPO/branches/main/protection
|
|
284
|
+
|
|
285
|
+
# Set up branch protection
|
|
286
|
+
curl -s -X PUT \
|
|
287
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
288
|
+
https://api.github.com/repos/$OWNER/$REPO/branches/main/protection \
|
|
289
|
+
-d '{
|
|
290
|
+
"required_status_checks": {
|
|
291
|
+
"strict": true,
|
|
292
|
+
"contexts": ["ci/test", "ci/lint"]
|
|
293
|
+
},
|
|
294
|
+
"enforce_admins": false,
|
|
295
|
+
"required_pull_request_reviews": {
|
|
296
|
+
"required_approving_review_count": 1
|
|
297
|
+
},
|
|
298
|
+
"restrictions": null
|
|
299
|
+
}'
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## 7. Secrets Management (GitHub Actions)
|
|
303
|
+
|
|
304
|
+
**With gh:**
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
gh secret set API_KEY --body "your-secret-value"
|
|
308
|
+
gh secret set SSH_KEY < ~/.ssh/id_rsa
|
|
309
|
+
gh secret list
|
|
310
|
+
gh secret delete API_KEY
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**With curl:**
|
|
314
|
+
|
|
315
|
+
Secrets require encryption with the repo's public key — more involved via API:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# Get the repo's public key for encrypting secrets
|
|
319
|
+
curl -s \
|
|
320
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
321
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/secrets/public-key
|
|
322
|
+
|
|
323
|
+
# Encrypt and set (requires Python with PyNaCl)
|
|
324
|
+
python3 -c "
|
|
325
|
+
from base64 import b64encode
|
|
326
|
+
from nacl import encoding, public
|
|
327
|
+
import json, sys
|
|
328
|
+
|
|
329
|
+
# Get the public key
|
|
330
|
+
key_id = '<key_id_from_above>'
|
|
331
|
+
public_key = '<base64_key_from_above>'
|
|
332
|
+
|
|
333
|
+
# Encrypt
|
|
334
|
+
sealed = public.SealedBox(
|
|
335
|
+
public.PublicKey(public_key.encode('utf-8'), encoding.Base64Encoder)
|
|
336
|
+
).encrypt('your-secret-value'.encode('utf-8'))
|
|
337
|
+
print(json.dumps({
|
|
338
|
+
'encrypted_value': b64encode(sealed).decode('utf-8'),
|
|
339
|
+
'key_id': key_id
|
|
340
|
+
}))"
|
|
341
|
+
|
|
342
|
+
# Then PUT the encrypted secret
|
|
343
|
+
curl -s -X PUT \
|
|
344
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
345
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/secrets/API_KEY \
|
|
346
|
+
-d '<output from python script above>'
|
|
347
|
+
|
|
348
|
+
# List secrets (names only, values hidden)
|
|
349
|
+
curl -s \
|
|
350
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
351
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/secrets \
|
|
352
|
+
| python3 -c "
|
|
353
|
+
import sys, json
|
|
354
|
+
for s in json.load(sys.stdin)['secrets']:
|
|
355
|
+
print(f\" {s['name']:30} updated: {s['updated_at']}\")"
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Note: For secrets, `gh secret set` is dramatically simpler. If setting secrets is needed and `gh` isn't available, recommend installing it for just that operation.
|
|
359
|
+
|
|
360
|
+
## 8. Releases
|
|
361
|
+
|
|
362
|
+
**With gh:**
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
gh release create v1.0.0 --title "v1.0.0" --generate-notes
|
|
366
|
+
gh release create v2.0.0-rc1 --draft --prerelease --generate-notes
|
|
367
|
+
gh release create v1.0.0 ./dist/binary --title "v1.0.0" --notes "Release notes"
|
|
368
|
+
gh release list
|
|
369
|
+
gh release download v1.0.0 --dir ./downloads
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**With curl:**
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
# Create a release
|
|
376
|
+
curl -s -X POST \
|
|
377
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
378
|
+
https://api.github.com/repos/$OWNER/$REPO/releases \
|
|
379
|
+
-d '{
|
|
380
|
+
"tag_name": "v1.0.0",
|
|
381
|
+
"name": "v1.0.0",
|
|
382
|
+
"body": "## Changelog\n- Feature A\n- Bug fix B",
|
|
383
|
+
"draft": false,
|
|
384
|
+
"prerelease": false,
|
|
385
|
+
"generate_release_notes": true
|
|
386
|
+
}'
|
|
387
|
+
|
|
388
|
+
# List releases
|
|
389
|
+
curl -s \
|
|
390
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
391
|
+
https://api.github.com/repos/$OWNER/$REPO/releases \
|
|
392
|
+
| python3 -c "
|
|
393
|
+
import sys, json
|
|
394
|
+
for r in json.load(sys.stdin):
|
|
395
|
+
tag = r.get('tag_name', 'no tag')
|
|
396
|
+
print(f\" {tag:15} {r['name']:30} {'draft' if r['draft'] else 'published'}\")"
|
|
397
|
+
|
|
398
|
+
# Upload a release asset (binary file)
|
|
399
|
+
RELEASE_ID=<id_from_create_response>
|
|
400
|
+
curl -s -X POST \
|
|
401
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
402
|
+
-H "Content-Type: application/octet-stream" \
|
|
403
|
+
"https://uploads.github.com/repos/$OWNER/$REPO/releases/$RELEASE_ID/assets?name=binary-amd64" \
|
|
404
|
+
--data-binary @./dist/binary-amd64
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## 9. GitHub Actions Workflows
|
|
408
|
+
|
|
409
|
+
**With gh:**
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
gh workflow list
|
|
413
|
+
gh run list --limit 10
|
|
414
|
+
gh run view <RUN_ID>
|
|
415
|
+
gh run view <RUN_ID> --log-failed
|
|
416
|
+
gh run rerun <RUN_ID>
|
|
417
|
+
gh run rerun <RUN_ID> --failed
|
|
418
|
+
gh workflow run ci.yml --ref main
|
|
419
|
+
gh workflow run deploy.yml -f environment=staging
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
**With curl:**
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
# List workflows
|
|
426
|
+
curl -s \
|
|
427
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
428
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/workflows \
|
|
429
|
+
| python3 -c "
|
|
430
|
+
import sys, json
|
|
431
|
+
for w in json.load(sys.stdin)['workflows']:
|
|
432
|
+
print(f\" {w['id']:10} {w['name']:30} {w['state']}\")"
|
|
433
|
+
|
|
434
|
+
# List recent runs
|
|
435
|
+
curl -s \
|
|
436
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
437
|
+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs?per_page=10" \
|
|
438
|
+
| python3 -c "
|
|
439
|
+
import sys, json
|
|
440
|
+
for r in json.load(sys.stdin)['workflow_runs']:
|
|
441
|
+
print(f\" Run {r['id']} {r['name']:30} {r['conclusion'] or r['status']}\")"
|
|
442
|
+
|
|
443
|
+
# Download failed run logs
|
|
444
|
+
RUN_ID=<run_id>
|
|
445
|
+
curl -s -L \
|
|
446
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
447
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/logs \
|
|
448
|
+
-o /tmp/ci-logs.zip
|
|
449
|
+
cd /tmp && unzip -o ci-logs.zip -d ci-logs
|
|
450
|
+
|
|
451
|
+
# Re-run a failed workflow
|
|
452
|
+
curl -s -X POST \
|
|
453
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
454
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/rerun
|
|
455
|
+
|
|
456
|
+
# Re-run only failed jobs
|
|
457
|
+
curl -s -X POST \
|
|
458
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
459
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/rerun-failed-jobs
|
|
460
|
+
|
|
461
|
+
# Trigger a workflow manually (workflow_dispatch)
|
|
462
|
+
WORKFLOW_ID=<workflow_id_or_filename>
|
|
463
|
+
curl -s -X POST \
|
|
464
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
465
|
+
https://api.github.com/repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/dispatches \
|
|
466
|
+
-d '{"ref": "main", "inputs": {"environment": "staging"}}'
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
## 10. Gists
|
|
470
|
+
|
|
471
|
+
**With gh:**
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
gh gist create script.py --public --desc "Useful script"
|
|
475
|
+
gh gist list
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
**With curl:**
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
# Create a gist
|
|
482
|
+
curl -s -X POST \
|
|
483
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
484
|
+
https://api.github.com/gists \
|
|
485
|
+
-d '{
|
|
486
|
+
"description": "Useful script",
|
|
487
|
+
"public": true,
|
|
488
|
+
"files": {
|
|
489
|
+
"script.py": {"content": "print(\"hello\")"}
|
|
490
|
+
}
|
|
491
|
+
}'
|
|
492
|
+
|
|
493
|
+
# List your gists
|
|
494
|
+
curl -s \
|
|
495
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
496
|
+
https://api.github.com/gists \
|
|
497
|
+
| python3 -c "
|
|
498
|
+
import sys, json
|
|
499
|
+
for g in json.load(sys.stdin):
|
|
500
|
+
files = ', '.join(g['files'].keys())
|
|
501
|
+
print(f\" {g['id']} {g['description'] or '(no desc)':40} {files}\")"
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
## Quick Reference Table
|
|
505
|
+
|
|
506
|
+
| Action | gh | git + curl |
|
|
507
|
+
|--------|-----|-----------|
|
|
508
|
+
| Clone | `gh repo clone o/r` | `git clone https://github.com/o/r.git` |
|
|
509
|
+
| Create repo | `gh repo create name --public` | `curl POST /user/repos` |
|
|
510
|
+
| Fork | `gh repo fork o/r --clone` | `curl POST /repos/o/r/forks` + `git clone` |
|
|
511
|
+
| Repo info | `gh repo view o/r` | `curl GET /repos/o/r` |
|
|
512
|
+
| Edit settings | `gh repo edit --...` | `curl PATCH /repos/o/r` |
|
|
513
|
+
| Create release | `gh release create v1.0` | `curl POST /repos/o/r/releases` |
|
|
514
|
+
| List workflows | `gh workflow list` | `curl GET /repos/o/r/actions/workflows` |
|
|
515
|
+
| Rerun CI | `gh run rerun ID` | `curl POST /repos/o/r/actions/runs/ID/rerun` |
|
|
516
|
+
| Set secret | `gh secret set KEY` | `curl PUT /repos/o/r/actions/secrets/KEY` (+ encryption) |
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# GitHub REST API Cheatsheet
|
|
2
|
+
|
|
3
|
+
Base URL: `https://api.github.com`
|
|
4
|
+
|
|
5
|
+
All requests need: `-H "Authorization: token $GITHUB_TOKEN"`
|
|
6
|
+
|
|
7
|
+
Use the `gh-env.sh` helper to set `$GITHUB_TOKEN`, `$GH_OWNER`, `$GH_REPO` automatically:
|
|
8
|
+
```bash
|
|
9
|
+
source "${HERMES_HOME:-$HOME/.hermes}/skills/github/github-auth/scripts/gh-env.sh"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Repositories
|
|
13
|
+
|
|
14
|
+
| Action | Method | Endpoint |
|
|
15
|
+
|--------|--------|----------|
|
|
16
|
+
| Get repo info | GET | `/repos/{owner}/{repo}` |
|
|
17
|
+
| Create repo (user) | POST | `/user/repos` |
|
|
18
|
+
| Create repo (org) | POST | `/orgs/{org}/repos` |
|
|
19
|
+
| Update repo | PATCH | `/repos/{owner}/{repo}` |
|
|
20
|
+
| Delete repo | DELETE | `/repos/{owner}/{repo}` |
|
|
21
|
+
| List your repos | GET | `/user/repos?per_page=30&sort=updated` |
|
|
22
|
+
| List org repos | GET | `/orgs/{org}/repos` |
|
|
23
|
+
| Fork repo | POST | `/repos/{owner}/{repo}/forks` |
|
|
24
|
+
| Create from template | POST | `/repos/{owner}/{template}/generate` |
|
|
25
|
+
| Get topics | GET | `/repos/{owner}/{repo}/topics` |
|
|
26
|
+
| Set topics | PUT | `/repos/{owner}/{repo}/topics` |
|
|
27
|
+
|
|
28
|
+
## Pull Requests
|
|
29
|
+
|
|
30
|
+
| Action | Method | Endpoint |
|
|
31
|
+
|--------|--------|----------|
|
|
32
|
+
| List PRs | GET | `/repos/{owner}/{repo}/pulls?state=open` |
|
|
33
|
+
| Create PR | POST | `/repos/{owner}/{repo}/pulls` |
|
|
34
|
+
| Get PR | GET | `/repos/{owner}/{repo}/pulls/{number}` |
|
|
35
|
+
| Update PR | PATCH | `/repos/{owner}/{repo}/pulls/{number}` |
|
|
36
|
+
| List PR files | GET | `/repos/{owner}/{repo}/pulls/{number}/files` |
|
|
37
|
+
| Merge PR | PUT | `/repos/{owner}/{repo}/pulls/{number}/merge` |
|
|
38
|
+
| Request reviewers | POST | `/repos/{owner}/{repo}/pulls/{number}/requested_reviewers` |
|
|
39
|
+
| Create review | POST | `/repos/{owner}/{repo}/pulls/{number}/reviews` |
|
|
40
|
+
| Inline comment | POST | `/repos/{owner}/{repo}/pulls/{number}/comments` |
|
|
41
|
+
|
|
42
|
+
### PR Merge Body
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{"merge_method": "squash", "commit_title": "feat: description (#N)"}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Merge methods: `"merge"`, `"squash"`, `"rebase"`
|
|
49
|
+
|
|
50
|
+
### PR Review Events
|
|
51
|
+
|
|
52
|
+
`"APPROVE"`, `"REQUEST_CHANGES"`, `"COMMENT"`
|
|
53
|
+
|
|
54
|
+
## Issues
|
|
55
|
+
|
|
56
|
+
| Action | Method | Endpoint |
|
|
57
|
+
|--------|--------|----------|
|
|
58
|
+
| List issues | GET | `/repos/{owner}/{repo}/issues?state=open` |
|
|
59
|
+
| Create issue | POST | `/repos/{owner}/{repo}/issues` |
|
|
60
|
+
| Get issue | GET | `/repos/{owner}/{repo}/issues/{number}` |
|
|
61
|
+
| Update issue | PATCH | `/repos/{owner}/{repo}/issues/{number}` |
|
|
62
|
+
| Add comment | POST | `/repos/{owner}/{repo}/issues/{number}/comments` |
|
|
63
|
+
| Add labels | POST | `/repos/{owner}/{repo}/issues/{number}/labels` |
|
|
64
|
+
| Remove label | DELETE | `/repos/{owner}/{repo}/issues/{number}/labels/{name}` |
|
|
65
|
+
| Add assignees | POST | `/repos/{owner}/{repo}/issues/{number}/assignees` |
|
|
66
|
+
| List labels | GET | `/repos/{owner}/{repo}/labels` |
|
|
67
|
+
| Search issues | GET | `/search/issues?q={query}+repo:{owner}/{repo}` |
|
|
68
|
+
|
|
69
|
+
Note: The Issues API also returns PRs. Filter with `"pull_request" not in item` when parsing.
|
|
70
|
+
|
|
71
|
+
## CI / GitHub Actions
|
|
72
|
+
|
|
73
|
+
| Action | Method | Endpoint |
|
|
74
|
+
|--------|--------|----------|
|
|
75
|
+
| List workflows | GET | `/repos/{owner}/{repo}/actions/workflows` |
|
|
76
|
+
| List runs | GET | `/repos/{owner}/{repo}/actions/runs?per_page=10` |
|
|
77
|
+
| List runs (branch) | GET | `/repos/{owner}/{repo}/actions/runs?branch={branch}` |
|
|
78
|
+
| Get run | GET | `/repos/{owner}/{repo}/actions/runs/{run_id}` |
|
|
79
|
+
| Download logs | GET | `/repos/{owner}/{repo}/actions/runs/{run_id}/logs` |
|
|
80
|
+
| Re-run | POST | `/repos/{owner}/{repo}/actions/runs/{run_id}/rerun` |
|
|
81
|
+
| Re-run failed | POST | `/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs` |
|
|
82
|
+
| Trigger dispatch | POST | `/repos/{owner}/{repo}/actions/workflows/{id}/dispatches` |
|
|
83
|
+
| Commit status | GET | `/repos/{owner}/{repo}/commits/{sha}/status` |
|
|
84
|
+
| Check runs | GET | `/repos/{owner}/{repo}/commits/{sha}/check-runs` |
|
|
85
|
+
|
|
86
|
+
## Releases
|
|
87
|
+
|
|
88
|
+
| Action | Method | Endpoint |
|
|
89
|
+
|--------|--------|----------|
|
|
90
|
+
| List releases | GET | `/repos/{owner}/{repo}/releases` |
|
|
91
|
+
| Create release | POST | `/repos/{owner}/{repo}/releases` |
|
|
92
|
+
| Get release | GET | `/repos/{owner}/{repo}/releases/{id}` |
|
|
93
|
+
| Delete release | DELETE | `/repos/{owner}/{repo}/releases/{id}` |
|
|
94
|
+
| Upload asset | POST | `https://uploads.github.com/repos/{owner}/{repo}/releases/{id}/assets?name={filename}` |
|
|
95
|
+
|
|
96
|
+
## Secrets
|
|
97
|
+
|
|
98
|
+
| Action | Method | Endpoint |
|
|
99
|
+
|--------|--------|----------|
|
|
100
|
+
| List secrets | GET | `/repos/{owner}/{repo}/actions/secrets` |
|
|
101
|
+
| Get public key | GET | `/repos/{owner}/{repo}/actions/secrets/public-key` |
|
|
102
|
+
| Set secret | PUT | `/repos/{owner}/{repo}/actions/secrets/{name}` |
|
|
103
|
+
| Delete secret | DELETE | `/repos/{owner}/{repo}/actions/secrets/{name}` |
|
|
104
|
+
|
|
105
|
+
## Branch Protection
|
|
106
|
+
|
|
107
|
+
| Action | Method | Endpoint |
|
|
108
|
+
|--------|--------|----------|
|
|
109
|
+
| Get protection | GET | `/repos/{owner}/{repo}/branches/{branch}/protection` |
|
|
110
|
+
| Set protection | PUT | `/repos/{owner}/{repo}/branches/{branch}/protection` |
|
|
111
|
+
| Delete protection | DELETE | `/repos/{owner}/{repo}/branches/{branch}/protection` |
|
|
112
|
+
|
|
113
|
+
## User / Auth
|
|
114
|
+
|
|
115
|
+
| Action | Method | Endpoint |
|
|
116
|
+
|--------|--------|----------|
|
|
117
|
+
| Get current user | GET | `/user` |
|
|
118
|
+
| List user repos | GET | `/user/repos` |
|
|
119
|
+
| List user gists | GET | `/gists` |
|
|
120
|
+
| Create gist | POST | `/gists` |
|
|
121
|
+
| Search repos | GET | `/search/repositories?q={query}` |
|
|
122
|
+
|
|
123
|
+
## Pagination
|
|
124
|
+
|
|
125
|
+
Most list endpoints support:
|
|
126
|
+
- `?per_page=100` (max 100)
|
|
127
|
+
- `?page=2` for next page
|
|
128
|
+
- Check `Link` header for `rel="next"` URL
|
|
129
|
+
|
|
130
|
+
## Rate Limits
|
|
131
|
+
|
|
132
|
+
- Authenticated: 5,000 requests/hour
|
|
133
|
+
- Check remaining: `curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/rate_limit`
|
|
134
|
+
|
|
135
|
+
## Common curl Patterns
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# GET
|
|
139
|
+
curl -s -H "Authorization: token $GITHUB_TOKEN" \
|
|
140
|
+
https://api.github.com/repos/$GH_OWNER/$GH_REPO
|
|
141
|
+
|
|
142
|
+
# POST with JSON body
|
|
143
|
+
curl -s -X POST \
|
|
144
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
145
|
+
https://api.github.com/repos/$GH_OWNER/$GH_REPO/issues \
|
|
146
|
+
-d '{"title": "...", "body": "..."}'
|
|
147
|
+
|
|
148
|
+
# PATCH (update)
|
|
149
|
+
curl -s -X PATCH \
|
|
150
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
151
|
+
https://api.github.com/repos/$GH_OWNER/$GH_REPO/issues/42 \
|
|
152
|
+
-d '{"state": "closed"}'
|
|
153
|
+
|
|
154
|
+
# DELETE
|
|
155
|
+
curl -s -X DELETE \
|
|
156
|
+
-H "Authorization: token $GITHUB_TOKEN" \
|
|
157
|
+
https://api.github.com/repos/$GH_OWNER/$GH_REPO/issues/42/labels/bug
|
|
158
|
+
|
|
159
|
+
# Parse JSON response with python3
|
|
160
|
+
curl -s ... | python3 -c "import sys,json; data=json.load(sys.stdin); print(data['field'])"
|
|
161
|
+
```
|