gh-axi 0.1.32 → 0.1.34

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/README.md CHANGED
@@ -41,7 +41,7 @@ npx skills add kunchenguid/gh-axi --skill gh-axi -g
41
41
  ```
42
42
 
43
43
  That is the entire setup - no npm install needed.
44
- The skill teaches your agent to run gh-axi through `npx -y gh-axi`, so the CLI comes along on demand.
44
+ The skill is a minimal discovery stub that directs your agent to the always-current `npx -y gh-axi` dashboard and help output instead of duplicating command guidance.
45
45
  You still need [`gh`](https://cli.github.com/) installed and authenticated via `gh auth login` (Node 20+ required).
46
46
  Stacked PR commands also require GitHub's official extension: `gh extension install github/gh-stack`.
47
47
  For GitHub Enterprise or another custom host, authenticate `gh` for that host and either pass `--hostname <host>` after the command or set `GH_HOST`.
@@ -151,8 +151,10 @@ Gist visibility is fixed at creation; a secret gist is unlisted (anyone with the
151
151
  Two file-on-disk input forms are available: positional paths (`gist create a.py b.py`) or repeatable `--file` flags (`gist create --file a.py --file b.py`); mixing the two is an error.
152
152
  To create a gist from piped content, use `--filename <name>` together with a pipe (`echo "..." | gh-axi gist create --filename foo.txt --public`).
153
153
 
154
- `gh-axi api` accepts `-X <method>` and `-X=<method>` as alternatives to the positional HTTP method, plus `--field`, `--header`, `--paginate`, `--jq <expression>`, `--template <format>`, and `--full`.
155
- Giving `-X` more than once or together with a positional method is rejected, as is any other unsupported flag, extra positional argument, or repeated `--jq`/`--template`.
154
+ `gh-axi api` accepts `-X <method>` and `-X=<method>` as alternatives to the positional HTTP method, plus `--field`, `--header`, `--input <file>`, `--paginate`, `--jq <expression>`, `--template <format>`, and `--full`.
155
+ Use `--input <file>` to send a raw JSON request body, or `--input -` to relay piped stdin byte for byte.
156
+ `--input -` rejects an interactive terminal instead of waiting for input.
157
+ Giving `-X` more than once or together with a positional method is rejected, as is any other unsupported flag, extra positional argument, or repeated `--input`/`--jq`/`--template`.
156
158
  JSON responses are normally stripped of noisy fields before TOON encoding, but a response you shaped yourself with `--jq` or `--template` keeps every key and value verbatim — only over-long strings are still truncated so one field cannot flood an agent's context.
157
159
  `--full` is an explicit opt-in escape hatch: it keeps every field and every complete value, and it also returns non-JSON response bodies without the length cap. `--full` is a gh-axi flag only, and gh-axi does not send it to `gh`. Compact output stays the default without `--full`.
158
160
 
@@ -203,13 +205,14 @@ When a command also needs a destination repository, use a dedicated flag for it:
203
205
 
204
206
  ```sh
205
207
  pnpm run build # Compile TypeScript to dist/
206
- pnpm run build:skill # Regenerate skills/gh-axi/SKILL.md from shared skill source
208
+ pnpm run build:skill # Regenerate skills/gh-axi/SKILL.md from src/skill.ts
207
209
  pnpm run dev # Run CLI directly with tsx
208
210
  pnpm test # Run tests with vitest
209
211
  pnpm run test:watch # Run tests in watch mode
210
212
  ```
211
213
 
212
- The committed `skills/gh-axi/SKILL.md` is generated by `pnpm run build:skill`; `pnpm test` fails if it drifts from the shared CLI guidance or generated skill frontmatter.
214
+ The committed `skills/gh-axi/SKILL.md` is generated from `src/skill.ts` by `pnpm run build:skill`; `pnpm test` fails if the generated file drifts.
215
+ The generated skill intentionally defers all command guidance to the CLI dashboard and help output so installed copies do not duplicate stale instructions.
213
216
  The npm package includes `skills/gh-axi/`, so published releases ship the same installable Agent Skill documented in Quick Start.
214
217
 
215
218
  ## License
@@ -1,3 +1,3 @@
1
- import type { RepoContext } from '../context.js';
2
- export declare const API_HELP = "usage: gh-axi api [<method>] <path>\ndescription: Make an authenticated GitHub API request. Defaults to GET if no method specified.\nmethods[6]:\n GET, POST, PUT, PATCH, DELETE, HEAD\nflags[7]:\n -X <method> or -X=<method> (alias for the positional method; give once and do not combine with a positional method), --field <key=value> (repeatable), --header <key:value> (repeatable), --paginate, --jq <expression>, --template <format>, --full (preserve complete field values and response bodies without truncation)\nexamples:\n gh-axi api /repos/{owner}/{repo}\n gh-axi api POST /repos/{owner}/{repo}/issues --field title=\"Bug report\"\n gh-axi api -X POST /repos/{owner}/{repo}/issues --field title=\"Bug report\"\n gh-axi api /repos/{owner}/{repo}/pulls --paginate\n gh-axi api /repos/{owner}/{repo}/issues/1 --jq '[.labels[].name]'";
1
+ import type { RepoContext } from "../context.js";
2
+ export declare const API_HELP = "usage: gh-axi api [<method>] <path>\ndescription: Make an authenticated GitHub API request. Defaults to GET if no method specified.\nmethods[6]:\n GET, POST, PUT, PATCH, DELETE, HEAD\nflags[8]:\n -X <method> or -X=<method> (alias for the positional method; give once and do not combine with a positional method), --field <key=value> (repeatable), --header <key:value> (repeatable), --input <file> (raw JSON request body; use \"-\" for stdin), --paginate, --jq <expression>, --template <format>, --full (preserve complete field values and response bodies without truncation)\nexamples:\n gh-axi api /repos/{owner}/{repo}\n gh-axi api POST /repos/{owner}/{repo}/issues --field title=\"Bug report\"\n gh-axi api -X POST /repos/{owner}/{repo}/issues --field title=\"Bug report\"\n gh-axi api /repos/{owner}/{repo}/pulls --paginate\n gh-axi api /repos/{owner}/{repo}/issues/1 --jq '[.labels[].name]'\n gh-axi api PUT /repos/{owner}/{repo}/branches/main/protection --input body.json\n cat body.json | gh-axi api PUT /repos/{owner}/{repo}/branches/main/protection --input -";
3
3
  export declare function apiCommand(args: string[], ctx?: RepoContext): Promise<string>;
@@ -1,30 +1,39 @@
1
- import { encode } from '@toon-format/toon';
2
- import { ghExec } from '../gh.js';
3
- import { AxiError } from '../errors.js';
4
- import { cleanBody } from '../body.js';
1
+ import { encode } from "@toon-format/toon";
2
+ import { ghExec, ghExecWithStdin } from "../gh.js";
3
+ import { AxiError } from "../errors.js";
4
+ import { cleanBody } from "../body.js";
5
+ import { readStdin, isStdinTTY } from "../stdin.js";
5
6
  export const API_HELP = `usage: gh-axi api [<method>] <path>
6
7
  description: Make an authenticated GitHub API request. Defaults to GET if no method specified.
7
8
  methods[6]:
8
9
  GET, POST, PUT, PATCH, DELETE, HEAD
9
- flags[7]:
10
- -X <method> or -X=<method> (alias for the positional method; give once and do not combine with a positional method), --field <key=value> (repeatable), --header <key:value> (repeatable), --paginate, --jq <expression>, --template <format>, --full (preserve complete field values and response bodies without truncation)
10
+ flags[8]:
11
+ -X <method> or -X=<method> (alias for the positional method; give once and do not combine with a positional method), --field <key=value> (repeatable), --header <key:value> (repeatable), --input <file> (raw JSON request body; use "-" for stdin), --paginate, --jq <expression>, --template <format>, --full (preserve complete field values and response bodies without truncation)
11
12
  examples:
12
13
  gh-axi api /repos/{owner}/{repo}
13
14
  gh-axi api POST /repos/{owner}/{repo}/issues --field title="Bug report"
14
15
  gh-axi api -X POST /repos/{owner}/{repo}/issues --field title="Bug report"
15
16
  gh-axi api /repos/{owner}/{repo}/pulls --paginate
16
- gh-axi api /repos/{owner}/{repo}/issues/1 --jq '[.labels[].name]'`;
17
- const HTTP_METHODS = new Set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD']);
17
+ gh-axi api /repos/{owner}/{repo}/issues/1 --jq '[.labels[].name]'
18
+ gh-axi api PUT /repos/{owner}/{repo}/branches/main/protection --input body.json
19
+ cat body.json | gh-axi api PUT /repos/{owner}/{repo}/branches/main/protection --input -`;
20
+ const HTTP_METHODS = new Set(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"]);
18
21
  /** The `gh api` short flag for HTTP method, equivalent to the positional method. */
19
- const METHOD_FLAG = '-X';
22
+ const METHOD_FLAG = "-X";
20
23
  /** Value flags that may be given more than once, each occurrence forwarded to gh. */
21
- const REPEATABLE_VALUE_FLAGS = new Set(['--field', '--header']);
24
+ const REPEATABLE_VALUE_FLAGS = new Set(["--field", "--header"]);
22
25
  /** Value flags that gh accepts only one of, so a repeat is a caller mistake. */
23
- const SINGLE_VALUE_FLAGS = new Set(['--jq', '--template']);
26
+ const SINGLE_VALUE_FLAGS = new Set(["--jq", "--template", "--input"]);
27
+ /** Maps a single-value flag's name to its key on `ParsedApiArgs`. */
28
+ const SINGLE_VALUE_FLAG_KEYS = {
29
+ "--jq": "jq",
30
+ "--template": "template",
31
+ "--input": "input",
32
+ };
24
33
  /** Flags that stand alone and must not consume the following argument, and are forwarded to gh. */
25
- const BOOL_FLAGS = new Set(['--paginate']);
34
+ const BOOL_FLAGS = new Set(["--paginate"]);
26
35
  /** Flags that stand alone, are gh-axi-only, and must not be forwarded to gh. */
27
- const LOCAL_BOOL_FLAGS = new Set(['--full']);
36
+ const LOCAL_BOOL_FLAGS = new Set(["--full"]);
28
37
  const SUPPORTED_FLAGS = [
29
38
  METHOD_FLAG,
30
39
  ...REPEATABLE_VALUE_FLAGS,
@@ -34,7 +43,7 @@ const SUPPORTED_FLAGS = [
34
43
  ];
35
44
  /** The flag's name without any `=value` suffix, so errors never echo a value. */
36
45
  function flagName(arg) {
37
- const equals = arg.indexOf('=');
46
+ const equals = arg.indexOf("=");
38
47
  return equals === -1 ? arg : arg.slice(0, equals);
39
48
  }
40
49
  /**
@@ -62,63 +71,66 @@ function parseArgs(args) {
62
71
  };
63
72
  for (let i = 0; i < args.length; i++) {
64
73
  const arg = args[i];
65
- if (!arg.startsWith('-')) {
74
+ if (!arg.startsWith("-")) {
66
75
  parsed.positionals.push(arg);
67
76
  continue;
68
77
  }
69
78
  const name = flagName(arg);
70
79
  if (BOOL_FLAGS.has(name)) {
71
80
  if (name !== arg)
72
- throw new AxiError(`${name} does not take a value`, 'VALIDATION_ERROR');
81
+ throw new AxiError(`${name} does not take a value`, "VALIDATION_ERROR");
73
82
  parsed.paginate = true;
74
83
  continue;
75
84
  }
76
85
  if (LOCAL_BOOL_FLAGS.has(name)) {
77
86
  if (name !== arg)
78
- throw new AxiError(`${name} does not take a value`, 'VALIDATION_ERROR');
87
+ throw new AxiError(`${name} does not take a value`, "VALIDATION_ERROR");
79
88
  parsed.full = true;
80
89
  continue;
81
90
  }
82
91
  if (name !== METHOD_FLAG &&
83
92
  !REPEATABLE_VALUE_FLAGS.has(name) &&
84
93
  !SINGLE_VALUE_FLAGS.has(name)) {
85
- throw new AxiError(`unknown flag ${name} for gh-axi api. Supported flags: ${SUPPORTED_FLAGS.join(', ')}`, 'VALIDATION_ERROR');
94
+ throw new AxiError(`unknown flag ${name} for gh-axi api. Supported flags: ${SUPPORTED_FLAGS.join(", ")}`, "VALIDATION_ERROR");
86
95
  }
87
96
  // `--flag=value` carries its own value; `--flag value` consumes the next arg.
88
97
  let value;
89
98
  if (name === arg) {
90
- if (i + 1 >= args.length)
91
- throw new AxiError(`${name} requires a value`, 'VALIDATION_ERROR');
92
- value = args[++i];
99
+ const next = args[i + 1];
100
+ if (next === undefined ||
101
+ (name === "--input" && SUPPORTED_FLAGS.includes(flagName(next))))
102
+ throw new AxiError(`${name} requires a value`, "VALIDATION_ERROR");
103
+ value = next;
104
+ i++;
93
105
  }
94
106
  else {
95
107
  value = arg.slice(name.length + 1);
96
108
  }
97
109
  if (name === METHOD_FLAG) {
98
110
  if (parsed.method !== undefined)
99
- throw new AxiError(`${name} may only be given once`, 'VALIDATION_ERROR');
111
+ throw new AxiError(`${name} may only be given once`, "VALIDATION_ERROR");
100
112
  const upper = value.toUpperCase();
101
113
  if (!HTTP_METHODS.has(upper)) {
102
- throw new AxiError(`${name} ${value} is not a supported HTTP method. Supported: ${[...HTTP_METHODS].join(', ')}`, 'VALIDATION_ERROR');
114
+ throw new AxiError(`${name} ${value} is not a supported HTTP method. Supported: ${[...HTTP_METHODS].join(", ")}`, "VALIDATION_ERROR");
103
115
  }
104
116
  parsed.method = upper;
105
117
  }
106
- else if (name === '--field') {
118
+ else if (name === "--field") {
107
119
  parsed.fields.push(value);
108
120
  }
109
- else if (name === '--header') {
121
+ else if (name === "--header") {
110
122
  parsed.headers.push(value);
111
123
  }
112
124
  else {
113
125
  // gh takes the last occurrence; discarding the earlier expression silently
114
126
  // is the same failure this parser exists to prevent, so reject instead.
115
- const key = name === '--jq' ? 'jq' : 'template';
127
+ const key = SINGLE_VALUE_FLAG_KEYS[name];
116
128
  if (parsed[key] !== undefined)
117
- throw new AxiError(`${name} may only be given once`, 'VALIDATION_ERROR');
129
+ throw new AxiError(`${name} may only be given once`, "VALIDATION_ERROR");
118
130
  // An empty value (an unset shell variable) is a no-op filter for gh that
119
131
  // would still suppress the default field stripping here.
120
- if (value.trim() === '')
121
- throw new AxiError(`${name} requires a value`, 'VALIDATION_ERROR');
132
+ if (value.trim() === "")
133
+ throw new AxiError(`${name} requires a value`, "VALIDATION_ERROR");
122
134
  parsed[key] = value;
123
135
  }
124
136
  }
@@ -131,38 +143,52 @@ const LONG_STRING_CLEANUP_THRESHOLD = 200;
131
143
  /** Maximum length for cleaned string values before truncation. */
132
144
  const STRING_VALUE_TRUNCATION_LIMIT = 2000;
133
145
  export async function apiCommand(args, ctx) {
134
- if (args[0] === '--help' || args.length === 0)
146
+ if (args[0] === "--help" || args.length === 0)
135
147
  return API_HELP;
136
- const { positionals, fields, headers, jq, template, method: methodFlag, paginate, full } = parseArgs(args);
137
- const pathRequired = new AxiError('API path is required: gh-axi api [<method>] <path>', 'VALIDATION_ERROR');
148
+ const { positionals, fields, headers, jq, template, method: methodFlag, input, paginate, full, } = parseArgs(args);
149
+ const pathRequired = new AxiError("API path is required: gh-axi api [<method>] <path>", "VALIDATION_ERROR");
138
150
  if (positionals.length === 0)
139
151
  throw pathRequired;
140
152
  // A positional the command cannot place is a caller typo, and dropping it
141
153
  // silently requests a different endpoint than the one that was asked for.
142
154
  const methodGiven = HTTP_METHODS.has(positionals[0].toUpperCase());
143
155
  if (methodFlag !== undefined && methodGiven) {
144
- throw new AxiError('method given twice: use either -X <method> or the positional method, not both', 'VALIDATION_ERROR');
156
+ throw new AxiError("method given twice: use either -X <method> or the positional method, not both", "VALIDATION_ERROR");
145
157
  }
146
158
  if (positionals.length > (methodGiven ? 2 : 1)) {
147
- throw new AxiError('too many arguments for gh-axi api: expected [<method>] <path>', 'VALIDATION_ERROR');
159
+ throw new AxiError("too many arguments for gh-axi api: expected [<method>] <path>", "VALIDATION_ERROR");
148
160
  }
149
161
  if (methodGiven && positionals.length < 2)
150
162
  throw pathRequired;
151
- const method = methodFlag ?? (methodGiven ? positionals[0].toUpperCase() : 'GET');
163
+ const method = methodFlag ?? (methodGiven ? positionals[0].toUpperCase() : "GET");
152
164
  const path = methodGiven ? positionals[1] : positionals[0];
153
- const ghArgs = ['api', path, '--method', method];
165
+ const ghArgs = ["api", path, "--method", method];
154
166
  for (const f of fields) {
155
- ghArgs.push('--field', f);
167
+ ghArgs.push("--field", f);
156
168
  }
157
169
  for (const h of headers) {
158
- ghArgs.push('--header', h);
170
+ ghArgs.push("--header", h);
171
+ }
172
+ // `--input -` cannot be forwarded to the child `gh` process as-is: execFile
173
+ // gives the child its own unconnected stdin pipe, so `gh` would block
174
+ // forever waiting for bytes nothing writes. Read our own stdin instead and
175
+ // relay it to gh's stdin (still via `--input -`) through ghExecWithStdin.
176
+ let stdinBody;
177
+ if (input === "-") {
178
+ if (isStdinTTY())
179
+ throw new AxiError("--input - requires piped stdin (no request body to read)", "VALIDATION_ERROR");
180
+ stdinBody = await readStdin();
181
+ ghArgs.push("--input", "-");
182
+ }
183
+ else if (input !== undefined) {
184
+ ghArgs.push("--input", input);
159
185
  }
160
186
  if (paginate)
161
- ghArgs.push('--paginate');
187
+ ghArgs.push("--paginate");
162
188
  if (jq !== undefined)
163
- ghArgs.push('--jq', jq);
189
+ ghArgs.push("--jq", jq);
164
190
  if (template !== undefined)
165
- ghArgs.push('--template', template);
191
+ ghArgs.push("--template", template);
166
192
  // A caller who wrote a jq expression or template already chose the exact shape
167
193
  // they want, so noisy-field stripping would silently delete fields they asked
168
194
  // for by name (`url`, `node_id`, ...). The length clamp still applies, so a
@@ -174,7 +200,9 @@ export async function apiCommand(args, ctx) {
174
200
  const stripNoisyKeys = !callerShapedOutput && !full;
175
201
  const truncateValues = !full;
176
202
  // Try to parse as JSON, strip noisy fields, encode to TOON; fall back to raw output
177
- const raw = await ghExec(ghArgs, ctx);
203
+ const raw = stdinBody !== undefined
204
+ ? await ghExecWithStdin(ghArgs, stdinBody, ctx)
205
+ : await ghExec(ghArgs, ctx);
178
206
  try {
179
207
  const data = JSON.parse(raw);
180
208
  return encode(shapeOutput(data, stripNoisyKeys, truncateValues));
@@ -185,41 +213,71 @@ export async function apiCommand(args, ctx) {
185
213
  const truncated = !full && trimmed.length > RAW_OUTPUT_TRUNCATION_LIMIT;
186
214
  const result = {
187
215
  api_response: {
188
- body: truncated ? trimmed.slice(0, RAW_OUTPUT_TRUNCATION_LIMIT) : trimmed,
216
+ body: truncated
217
+ ? trimmed.slice(0, RAW_OUTPUT_TRUNCATION_LIMIT)
218
+ : trimmed,
189
219
  truncated,
190
220
  },
191
221
  };
192
222
  if (truncated) {
193
- result.api_response.original_length = trimmed.length;
223
+ result.api_response.original_length =
224
+ trimmed.length;
194
225
  }
195
226
  return encode(result);
196
227
  }
197
228
  }
198
229
  /** Fields from raw GitHub API responses that are noisy/useless for agents */
199
230
  const NOISY_KEYS = new Set([
200
- 'avatar_url', 'gravatar_id', 'followers_url', 'following_url',
201
- 'gists_url', 'starred_url', 'subscriptions_url', 'organizations_url',
202
- 'repos_url', 'events_url', 'received_events_url', 'labels_url',
203
- 'comments_url', 'events_url', 'timeline_url', 'performed_via_github_app',
204
- 'node_id', 'url', 'repository_url', 'html_url',
205
- 'reactions', 'user_view_type', 'site_admin',
206
- 'issue_dependencies_summary', 'sub_issues_summary', 'pinned_comment',
207
- 'score', 'permissions', 'verification', '_links',
231
+ "avatar_url",
232
+ "gravatar_id",
233
+ "followers_url",
234
+ "following_url",
235
+ "gists_url",
236
+ "starred_url",
237
+ "subscriptions_url",
238
+ "organizations_url",
239
+ "repos_url",
240
+ "events_url",
241
+ "received_events_url",
242
+ "labels_url",
243
+ "comments_url",
244
+ "events_url",
245
+ "timeline_url",
246
+ "performed_via_github_app",
247
+ "node_id",
248
+ "url",
249
+ "repository_url",
250
+ "html_url",
251
+ "reactions",
252
+ "user_view_type",
253
+ "site_admin",
254
+ "issue_dependencies_summary",
255
+ "sub_issues_summary",
256
+ "pinned_comment",
257
+ "score",
258
+ "permissions",
259
+ "verification",
260
+ "_links",
208
261
  ]);
209
262
  /** Keys ending in _url that are template URLs agents never use */
210
263
  function isTemplateUrlKey(key) {
211
- if (!key.endsWith('_url'))
264
+ if (!key.endsWith("_url"))
212
265
  return false;
213
266
  // Keep a few meaningful URL keys
214
267
  const KEEP_URL_KEYS = new Set([
215
- 'diff_url', 'patch_url', 'clone_url', 'ssh_url', 'git_url', 'svn_url',
216
- 'commit_url', // useful for linking to specific commits
268
+ "diff_url",
269
+ "patch_url",
270
+ "clone_url",
271
+ "ssh_url",
272
+ "git_url",
273
+ "svn_url",
274
+ "commit_url", // useful for linking to specific commits
217
275
  ]);
218
276
  return !KEEP_URL_KEYS.has(key);
219
277
  }
220
278
  /** Collapse repo/repository objects to essential fields only */
221
279
  function collapseRepo(obj) {
222
- if ('full_name' in obj) {
280
+ if ("full_name" in obj) {
223
281
  const collapsed = { full_name: obj.full_name };
224
282
  if (obj.default_branch)
225
283
  collapsed.default_branch = obj.default_branch;
@@ -233,7 +291,7 @@ function collapseRepo(obj) {
233
291
  function truncateString(value) {
234
292
  if (value.length <= STRING_VALUE_TRUNCATION_LIMIT)
235
293
  return value;
236
- return value.slice(0, STRING_VALUE_TRUNCATION_LIMIT) + '... (truncated)';
294
+ return value.slice(0, STRING_VALUE_TRUNCATION_LIMIT) + "... (truncated)";
237
295
  }
238
296
  /** Clean and truncate a long string value (e.g. bodies, comments, blobs). */
239
297
  function clampString(value) {
@@ -256,7 +314,7 @@ function shapeOutput(obj, stripNoisyKeys, truncateValues, depth = 0) {
256
314
  if (Array.isArray(obj)) {
257
315
  return obj.map((item) => shapeOutput(item, stripNoisyKeys, truncateValues, depth + 1));
258
316
  }
259
- if (obj !== null && typeof obj === 'object') {
317
+ if (obj !== null && typeof obj === "object") {
260
318
  const record = obj;
261
319
  const result = {};
262
320
  for (const [key, value] of Object.entries(record)) {
@@ -269,12 +327,17 @@ function shapeOutput(obj, stripNoisyKeys, truncateValues, depth = 0) {
269
327
  if (isTemplateUrlKey(key))
270
328
  continue;
271
329
  // Strip nested user objects down to just login
272
- if (key === 'user' && value && typeof value === 'object' && 'login' in value) {
330
+ if (key === "user" &&
331
+ value &&
332
+ typeof value === "object" &&
333
+ "login" in value) {
273
334
  result[key] = value.login;
274
335
  continue;
275
336
  }
276
337
  // Collapse repo/repository objects to essential fields
277
- if ((key === 'repo' || key === 'repository') && value && typeof value === 'object') {
338
+ if ((key === "repo" || key === "repository") &&
339
+ value &&
340
+ typeof value === "object") {
278
341
  result[key] = collapseRepo(value);
279
342
  continue;
280
343
  }
@@ -282,7 +345,7 @@ function shapeOutput(obj, stripNoisyKeys, truncateValues, depth = 0) {
282
345
  }
283
346
  return result;
284
347
  }
285
- if (typeof obj === 'string') {
348
+ if (typeof obj === "string") {
286
349
  if (!truncateValues)
287
350
  return obj;
288
351
  return stripNoisyKeys ? clampString(obj) : truncateString(obj);
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/commands/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;oEAW4C,CAAC;AAErE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhF,oFAAoF;AACpF,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB,qFAAqF;AACrF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAEhE,gFAAgF;AAChF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC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C,CAAC;gBACD,MAAM,CAAC,GAAG,CAAC,GAAI,KAAiC,CAAC,KAAK,CAAC;gBACvD,SAAS;YACX,CAAC;YACD,uDAAuD;YACvD,IACE,CAAC,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,YAAY,CAAC;gBACxC,KAAK;gBACL,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;gBACD,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAgC,CAAC,CAAC;gBAC7D,SAAS;YACX,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CACvB,KAAK,EACL,cAAc,EACd,cAAc,EACd,KAAK,GAAG,CAAC,CACV,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,cAAc;YAAE,OAAO,GAAG,CAAC;QAChC,OAAO,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -2,16 +2,14 @@ export declare const SKILL_DESCRIPTION: string;
2
2
  export declare const SKILL_AUTHOR = "Kun Chen (kunchenguid)";
3
3
  export declare const HERMES_TAGS: string[];
4
4
  export declare const HERMES_CATEGORY = "devops";
5
+ export declare const MAX_SKILL_MARKDOWN_CHARS = 2500;
5
6
  /**
6
- * Extract the `commands[N]:` block from the top-level help so the skill's
7
- * command list can never drift from what `gh-axi --help` prints.
8
- */
9
- export declare function extractCommandsBlock(): string;
10
- /**
11
- * Render the installable SKILL.md for the gh-axi skill. The body is built
12
- * from the same shared guidance the CLI prints (description and top-level
13
- * help), rewriting invocations to non-interactive `npx -y gh-axi ...` so the
14
- * CLI comes along on demand.
7
+ * Render the installable SKILL.md for the gh-axi skill.
8
+ *
9
+ * This is a discovery stub, not a copy of CLI guidance. Installed skills go
10
+ * stale; `gh-axi` (dashboard), `gh-axi --help`, and `gh-axi <command> --help`
11
+ * do not. Keep the body to what gh-axi is, when to reach for it, and pointers
12
+ * at those commands.
15
13
  *
16
14
  * @returns full SKILL.md contents including YAML frontmatter
17
15
  */
package/dist/src/skill.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DESCRIPTION, TOP_HELP } from "./cli.js";
1
+ import { DESCRIPTION } from "./cli.js";
2
2
  // Trigger string Claude Code (and other agents) match against to auto-load the skill.
3
3
  // Kept terse and outcome-focused so it fires on "needs GitHub" intents.
4
4
  export const SKILL_DESCRIPTION = "Operate GitHub through the gh-axi CLI - issues, pull requests, stacked PRs, workflow runs, workflows, " +
@@ -18,30 +18,25 @@ export const HERMES_TAGS = [
18
18
  "projects",
19
19
  ];
20
20
  export const HERMES_CATEGORY = "devops";
21
+ // Hard cap so a future regeneration cannot silently re-inflate the stub with
22
+ // CLI-owned instructions. Dashboard, `--help`, and per-command help are the
23
+ // source of truth.
24
+ export const MAX_SKILL_MARKDOWN_CHARS = 2500;
21
25
  function yamlDoubleQuote(value) {
22
26
  return JSON.stringify(value);
23
27
  }
24
28
  /**
25
- * Extract the `commands[N]:` block from the top-level help so the skill's
26
- * command list can never drift from what `gh-axi --help` prints.
27
- */
28
- export function extractCommandsBlock() {
29
- const match = TOP_HELP.match(/^(commands\[\d+\]:\n(?: {2}.*\n)+)/m);
30
- if (!match) {
31
- throw new Error("Could not find commands block in TOP_HELP");
32
- }
33
- return match[1].trimEnd();
34
- }
35
- /**
36
- * Render the installable SKILL.md for the gh-axi skill. The body is built
37
- * from the same shared guidance the CLI prints (description and top-level
38
- * help), rewriting invocations to non-interactive `npx -y gh-axi ...` so the
39
- * CLI comes along on demand.
29
+ * Render the installable SKILL.md for the gh-axi skill.
30
+ *
31
+ * This is a discovery stub, not a copy of CLI guidance. Installed skills go
32
+ * stale; `gh-axi` (dashboard), `gh-axi --help`, and `gh-axi <command> --help`
33
+ * do not. Keep the body to what gh-axi is, when to reach for it, and pointers
34
+ * at those commands.
40
35
  *
41
36
  * @returns full SKILL.md contents including YAML frontmatter
42
37
  */
43
38
  export function createSkillMarkdown() {
44
- return `---
39
+ const markdown = `---
45
40
  name: gh-axi
46
41
  description: ${yamlDoubleQuote(SKILL_DESCRIPTION)}
47
42
  user-invocable: false
@@ -56,63 +51,19 @@ metadata:
56
51
 
57
52
  ${DESCRIPTION}
58
53
 
59
- You do not need gh-axi installed globally - invoke it with \`npx -y gh-axi <command>\`.
60
- If gh-axi output shows a follow-up command starting with \`gh-axi\`, run it as \`npx -y gh-axi ...\` instead.
61
-
62
- gh-axi requires the [\`gh\`](https://cli.github.com/) CLI installed and authenticated (\`gh auth login\`). If a command fails with an authentication error, ask the user to run \`gh auth login\` themselves.
63
- Stack commands additionally require GitHub's official extension: \`gh extension install github/gh-stack\`.
64
- For GitHub Enterprise or another custom host, the underlying \`gh\` CLI must be authenticated for that host too; set \`GH_HOST\` or pass \`--hostname <host>\` after the command.
65
-
66
- ## When to use
54
+ Use gh-axi whenever a task touches GitHub: issues, pull requests, stacked PRs, CI, workflows, releases, repositories, labels, gists, Projects, Actions secrets and variables, search, or the GitHub API.
67
55
 
68
- Use gh-axi whenever a task touches GitHub: listing, filing, or editing issues; viewing, creating, reviewing, merging, or stacking pull requests; managing stacked branches; inspecting workflow runs and CI failures; triggering, enabling, or disabling workflows; managing releases, repositories, or labels; managing Projects (v2) boards and their items; managing Actions secrets or variables; searching issues, PRs, repos, commits, or code; listing, viewing, editing, renaming, creating, deleting, or cloning gists; or calling the GitHub API directly.
56
+ ## Current guidance lives in the CLI
69
57
 
70
- ## Workflow
58
+ Do not follow command, flag, or workflow instructions from this file - installed copies go stale. Get the current source of truth from the CLI:
71
59
 
72
- 1. Run \`npx -y gh-axi\` with no arguments for a dashboard of the current repo - open issues, open PRs, and suggested next commands.
73
- 2. Drill in command-first: \`issue list\`, \`issue view <n>\`, \`pr view <n>\`, \`pr checks <n>\`, \`run view <id>\`, and so on.
74
- 3. Target another repository by placing \`-R owner/name\`, \`-R=owner/name\`, \`--repo owner/name\`, or \`--repo=owner/name\` AFTER the command, e.g. \`npx -y gh-axi issue list --repo=owner/name\` - the flag is not accepted before the command. \`repo view\` also accepts exactly one positional repository, \`repo view owner/name\`, as a command-specific compatibility exception for \`gh repo view [<repository>]\`; do not combine it with \`--repo\` or generalize that positional form to other commands.
75
- 4. Target GitHub Enterprise or another custom host with \`GH_HOST\`, or by placing \`--hostname <host>\` or \`--hostname=<host>\` AFTER the command, e.g. \`npx -y gh-axi issue list --hostname=git.example.com\`.
76
- 5. Trigger (dispatch) a workflow with \`workflow run <name> --ref <ref>\`; \`run\` manages existing workflow runs.
77
- 6. Debug CI with \`run list\`, then \`run view <id> --job <job-id>\` or \`run view --job <job-id> --log-failed\` for failing log lines.
78
- Long \`--log\` and \`--log-failed\` output keeps the tail in context; when \`full_log\` appears, grep that file for earlier context.
79
- 7. Every response ends with contextual next-step hints under \`help:\` - follow them.
80
- 8. Manage stacked PRs from the target repository's working directory. Start with \`stack init <branch>\`, add layers with \`stack add <branch>\`, create PRs with \`stack submit --open\`, and inspect them with \`stack view\`.
81
-
82
- ## Commands
83
-
84
- \`\`\`
85
- ${extractCommandsBlock()}
86
- \`\`\`
87
-
88
- Installed copies also inherit the SDK built-in \`update\` command.
89
- Run \`gh-axi update --check\` to compare the installed version with npm, or \`gh-axi update\` to upgrade.
90
- When using \`npx -y gh-axi\`, npx already resolves the package on demand.
91
-
92
- Run \`npx -y gh-axi --help\` for global flags, or \`npx -y gh-axi <command> --help\` for per-command usage.
93
-
94
- ## Tips
95
-
96
- - Output is TOON-encoded and token-efficient; pipe through grep/head only when a list is very long.
97
- - Truncated workflow logs keep the final 20,000 characters and may include a temp \`full_log\` path for targeted grep searches.
98
- - Most mutations are idempotent and report what changed. Stack branch creation and partial pushes require checking the reported status before retrying.
99
- - Stack operations are cwd-bound and do not accept \`-R\`, \`--repo\`, or \`GH_REPO\`. They preserve the official extension's recovery exits and may partially push branches; inspect the reported status before retrying.
100
- - gh-axi keeps stack operations headless: \`stack view\` always uses JSON, \`stack submit\` always uses \`--auto\`, and \`stack merge <stack-or-pr>\` always uses \`--yes\`. Interactive \`gh stack modify\` and \`gh stack switch\` are intentionally not exposed.
101
- - For multi-line markdown bodies, comments, or release notes, write the text to a UTF-8 file and pass \`--body-file <path>\` or the release \`--notes-file <path>\` alias on commands that support file-backed text.
102
- - Label, assignee, reviewer, and project flags repeat: pass the flag once per value, e.g. \`issue edit 42 --add-label bug --add-label chore\`, and every value is applied. A repeated flag with a missing or blank value is rejected, never silently dropped.
103
- - Secret values are stdin-only: \`echo -n "<value>" | npx -y gh-axi secret set <name>\`.
104
- - Do not pass secrets with \`--body\` or \`-b\`; flags are visible in the \`gh-axi\` process argv.
105
- - Scope a secret to a deployment environment with \`--env\`/\`-e <environment>\` on \`secret list\`, \`set\`, and \`delete\`; omit it for repository scope. Other \`gh secret\` scopes (\`--org\`, \`--user\`, \`--app\`) are rejected, not silently ignored.
106
- - Variable values may use \`--body\`/\`-b\` or stdin because Actions variables are not secret.
107
- - For multi-line variable values, pipe stdin to \`npx -y gh-axi variable set <name>\`; \`--body\`/\`-b\` is for inline values only.
108
- - Projects (v2) are owner-scoped: pass \`--owner <login>\`, or omit it to use the current repo owner and then \`@me\`.
109
- - Projects calls need the \`project\` or \`read:project\` OAuth scope; if scope errors occur, ask the user to run the \`gh auth refresh -s ...\` command shown by gh-axi.
110
- - Use \`gist list\` to list your GitHub Gists; filter by visibility with \`--public\` or \`--secret\`, and add extra fields with \`--fields url,owner,created\`. Use \`gist view <id|url>\` to fetch a gist's metadata and file content; pass \`--files\` for names only, \`-f/--filename <name>\` for a single file, or \`--full\` to disable truncation.
111
- - Use \`gist edit <id|url>\` to update a gist's files or description: pipe content via stdin with \`--filename <name>\` to replace or add a file, \`--add <path>\` to add from disk, \`--remove <name>\` to remove, and \`--desc <text>\` to update the description. \`gist edit\` never opens $EDITOR.
112
- - Use \`gist rename <id|url> <old> <new>\` to rename a file within a gist.
113
- - Use \`gist create\` to create a gist. Visibility is required: pass \`--public\` or \`--secret\` (omitting either, or passing both, is an error). Use positional paths (\`gist create a.py b.py\`) or repeatable \`--file\` flags; do not mix the two. Pipe content with \`--filename <name>\` for stdin input. A secret gist is unlisted — anyone with the URL can read it.
114
- - Use \`gist delete <id|url>\` to delete a gist (always confirmed non-interactively). Use \`gist clone <id|url>\` to clone a gist locally.
115
- - Use \`api\` for anything the dedicated commands do not cover, e.g. \`npx -y gh-axi api repos/{owner}/{repo}/topics\`.
60
+ - \`npx -y gh-axi\` for a dashboard of the current repo
61
+ - \`npx -y gh-axi --help\` for global flags and the command index
62
+ - \`npx -y gh-axi <command> --help\` for per-command usage
116
63
  `;
64
+ if (markdown.length > MAX_SKILL_MARKDOWN_CHARS) {
65
+ throw new Error(`generated SKILL.md is ${markdown.length} chars; keep it a stub under ${MAX_SKILL_MARKDOWN_CHARS} and defer guidance to the CLI`);
66
+ }
67
+ return markdown;
117
68
  }
118
69
  //# sourceMappingURL=skill.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.js","sourceRoot":"","sources":["../../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEjD,sFAAsF;AACtF,wEAAwE;AACxE,MAAM,CAAC,MAAM,iBAAiB,GAC5B,wGAAwG;IACxG,mHAAmH;IACnH,6HAA6H;IAC7H,wPAAwP,CAAC;AAE3P,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAErD,oEAAoE;AACpE,2EAA2E;AAC3E,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ;IACR,KAAK;IACL,IAAI;IACJ,eAAe;IACf,UAAU;IACV,UAAU;CACX,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC;AAExC,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,IAAI,CAAC,S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Ae,CAAC,KAAa;IACpC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,QAAQ,GAAG;;eAEJ,eAAe,CAAC,iBAAiB,CAAC;;UAEvC,YAAY;;;aAGT,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;gBACnB,eAAe;;;;;EAK7B,WAAW;;;;;;;;;;;CAWZ,CAAC;IAEA,IAAI,QAAQ,CAAC,MAAM,GAAG,wBAAwB,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACb,yBAAyB,QAAQ,CAAC,MAAM,gCAAgC,wBAAwB,gCAAgC,CACjI,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gh-axi",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "packageManager": "pnpm@11.1.1",
5
5
  "description": "AXI-compliant gh CLI wrapper — token-efficient TOON output, contextual suggestions, idempotent mutations",
6
6
  "type": "module",
@@ -13,61 +13,12 @@ metadata:
13
13
 
14
14
  Agent ergonomic wrapper around Github CLI. Prefer this over `gh` and other methods for Github operations.
15
15
 
16
- You do not need gh-axi installed globally - invoke it with `npx -y gh-axi <command>`.
17
- If gh-axi output shows a follow-up command starting with `gh-axi`, run it as `npx -y gh-axi ...` instead.
16
+ Use gh-axi whenever a task touches GitHub: issues, pull requests, stacked PRs, CI, workflows, releases, repositories, labels, gists, Projects, Actions secrets and variables, search, or the GitHub API.
18
17
 
19
- gh-axi requires the [`gh`](https://cli.github.com/) CLI installed and authenticated (`gh auth login`). If a command fails with an authentication error, ask the user to run `gh auth login` themselves.
20
- Stack commands additionally require GitHub's official extension: `gh extension install github/gh-stack`.
21
- For GitHub Enterprise or another custom host, the underlying `gh` CLI must be authenticated for that host too; set `GH_HOST` or pass `--hostname <host>` after the command.
18
+ ## Current guidance lives in the CLI
22
19
 
23
- ## When to use
20
+ Do not follow command, flag, or workflow instructions from this file - installed copies go stale. Get the current source of truth from the CLI:
24
21
 
25
- Use gh-axi whenever a task touches GitHub: listing, filing, or editing issues; viewing, creating, reviewing, merging, or stacking pull requests; managing stacked branches; inspecting workflow runs and CI failures; triggering, enabling, or disabling workflows; managing releases, repositories, or labels; managing Projects (v2) boards and their items; managing Actions secrets or variables; searching issues, PRs, repos, commits, or code; listing, viewing, editing, renaming, creating, deleting, or cloning gists; or calling the GitHub API directly.
26
-
27
- ## Workflow
28
-
29
- 1. Run `npx -y gh-axi` with no arguments for a dashboard of the current repo - open issues, open PRs, and suggested next commands.
30
- 2. Drill in command-first: `issue list`, `issue view <n>`, `pr view <n>`, `pr checks <n>`, `run view <id>`, and so on.
31
- 3. Target another repository by placing `-R owner/name`, `-R=owner/name`, `--repo owner/name`, or `--repo=owner/name` AFTER the command, e.g. `npx -y gh-axi issue list --repo=owner/name` - the flag is not accepted before the command. `repo view` also accepts exactly one positional repository, `repo view owner/name`, as a command-specific compatibility exception for `gh repo view [<repository>]`; do not combine it with `--repo` or generalize that positional form to other commands.
32
- 4. Target GitHub Enterprise or another custom host with `GH_HOST`, or by placing `--hostname <host>` or `--hostname=<host>` AFTER the command, e.g. `npx -y gh-axi issue list --hostname=git.example.com`.
33
- 5. Trigger (dispatch) a workflow with `workflow run <name> --ref <ref>`; `run` manages existing workflow runs.
34
- 6. Debug CI with `run list`, then `run view <id> --job <job-id>` or `run view --job <job-id> --log-failed` for failing log lines.
35
- Long `--log` and `--log-failed` output keeps the tail in context; when `full_log` appears, grep that file for earlier context.
36
- 7. Every response ends with contextual next-step hints under `help:` - follow them.
37
- 8. Manage stacked PRs from the target repository's working directory. Start with `stack init <branch>`, add layers with `stack add <branch>`, create PRs with `stack submit --open`, and inspect them with `stack view`.
38
-
39
- ## Commands
40
-
41
- ```
42
- commands[16]:
43
- (none)=dashboard, issue, pr, stack, run, workflow, release, repo, label, gist, project, secret, variable, search, api, setup
44
- ```
45
-
46
- Installed copies also inherit the SDK built-in `update` command.
47
- Run `gh-axi update --check` to compare the installed version with npm, or `gh-axi update` to upgrade.
48
- When using `npx -y gh-axi`, npx already resolves the package on demand.
49
-
50
- Run `npx -y gh-axi --help` for global flags, or `npx -y gh-axi <command> --help` for per-command usage.
51
-
52
- ## Tips
53
-
54
- - Output is TOON-encoded and token-efficient; pipe through grep/head only when a list is very long.
55
- - Truncated workflow logs keep the final 20,000 characters and may include a temp `full_log` path for targeted grep searches.
56
- - Most mutations are idempotent and report what changed. Stack branch creation and partial pushes require checking the reported status before retrying.
57
- - Stack operations are cwd-bound and do not accept `-R`, `--repo`, or `GH_REPO`. They preserve the official extension's recovery exits and may partially push branches; inspect the reported status before retrying.
58
- - gh-axi keeps stack operations headless: `stack view` always uses JSON, `stack submit` always uses `--auto`, and `stack merge <stack-or-pr>` always uses `--yes`. Interactive `gh stack modify` and `gh stack switch` are intentionally not exposed.
59
- - For multi-line markdown bodies, comments, or release notes, write the text to a UTF-8 file and pass `--body-file <path>` or the release `--notes-file <path>` alias on commands that support file-backed text.
60
- - Label, assignee, reviewer, and project flags repeat: pass the flag once per value, e.g. `issue edit 42 --add-label bug --add-label chore`, and every value is applied. A repeated flag with a missing or blank value is rejected, never silently dropped.
61
- - Secret values are stdin-only: `echo -n "<value>" | npx -y gh-axi secret set <name>`.
62
- - Do not pass secrets with `--body` or `-b`; flags are visible in the `gh-axi` process argv.
63
- - Scope a secret to a deployment environment with `--env`/`-e <environment>` on `secret list`, `set`, and `delete`; omit it for repository scope. Other `gh secret` scopes (`--org`, `--user`, `--app`) are rejected, not silently ignored.
64
- - Variable values may use `--body`/`-b` or stdin because Actions variables are not secret.
65
- - For multi-line variable values, pipe stdin to `npx -y gh-axi variable set <name>`; `--body`/`-b` is for inline values only.
66
- - Projects (v2) are owner-scoped: pass `--owner <login>`, or omit it to use the current repo owner and then `@me`.
67
- - Projects calls need the `project` or `read:project` OAuth scope; if scope errors occur, ask the user to run the `gh auth refresh -s ...` command shown by gh-axi.
68
- - Use `gist list` to list your GitHub Gists; filter by visibility with `--public` or `--secret`, and add extra fields with `--fields url,owner,created`. Use `gist view <id|url>` to fetch a gist's metadata and file content; pass `--files` for names only, `-f/--filename <name>` for a single file, or `--full` to disable truncation.
69
- - Use `gist edit <id|url>` to update a gist's files or description: pipe content via stdin with `--filename <name>` to replace or add a file, `--add <path>` to add from disk, `--remove <name>` to remove, and `--desc <text>` to update the description. `gist edit` never opens $EDITOR.
70
- - Use `gist rename <id|url> <old> <new>` to rename a file within a gist.
71
- - Use `gist create` to create a gist. Visibility is required: pass `--public` or `--secret` (omitting either, or passing both, is an error). Use positional paths (`gist create a.py b.py`) or repeatable `--file` flags; do not mix the two. Pipe content with `--filename <name>` for stdin input. A secret gist is unlisted — anyone with the URL can read it.
72
- - Use `gist delete <id|url>` to delete a gist (always confirmed non-interactively). Use `gist clone <id|url>` to clone a gist locally.
73
- - Use `api` for anything the dedicated commands do not cover, e.g. `npx -y gh-axi api repos/{owner}/{repo}/topics`.
22
+ - `npx -y gh-axi` for a dashboard of the current repo
23
+ - `npx -y gh-axi --help` for global flags and the command index
24
+ - `npx -y gh-axi <command> --help` for per-command usage