gh-axi 0.1.34 → 0.1.36

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 (70) hide show
  1. package/README.md +40 -24
  2. package/dist/src/args.d.ts +16 -3
  3. package/dist/src/args.js +61 -7
  4. package/dist/src/args.js.map +1 -1
  5. package/dist/src/attach.d.ts +16 -0
  6. package/dist/src/attach.js +56 -0
  7. package/dist/src/attach.js.map +1 -0
  8. package/dist/src/body.d.ts +8 -1
  9. package/dist/src/body.js +28 -0
  10. package/dist/src/body.js.map +1 -1
  11. package/dist/src/cli.d.ts +1 -1
  12. package/dist/src/cli.js +66 -25
  13. package/dist/src/cli.js.map +1 -1
  14. package/dist/src/commands/api.d.ts +1 -1
  15. package/dist/src/commands/api.js +26 -6
  16. package/dist/src/commands/api.js.map +1 -1
  17. package/dist/src/commands/discussion.d.ts +4 -0
  18. package/dist/src/commands/discussion.js +303 -0
  19. package/dist/src/commands/discussion.js.map +1 -0
  20. package/dist/src/commands/gist.js +24 -8
  21. package/dist/src/commands/gist.js.map +1 -1
  22. package/dist/src/commands/issue.d.ts +2 -1
  23. package/dist/src/commands/issue.js +254 -39
  24. package/dist/src/commands/issue.js.map +1 -1
  25. package/dist/src/commands/label.d.ts +1 -0
  26. package/dist/src/commands/label.js +1 -1
  27. package/dist/src/commands/label.js.map +1 -1
  28. package/dist/src/commands/pr.d.ts +2 -1
  29. package/dist/src/commands/pr.js +275 -58
  30. package/dist/src/commands/pr.js.map +1 -1
  31. package/dist/src/commands/project.d.ts +1 -0
  32. package/dist/src/commands/project.js +1 -1
  33. package/dist/src/commands/project.js.map +1 -1
  34. package/dist/src/commands/release.d.ts +2 -1
  35. package/dist/src/commands/release.js +81 -43
  36. package/dist/src/commands/release.js.map +1 -1
  37. package/dist/src/commands/repo.d.ts +2 -1
  38. package/dist/src/commands/repo.js +96 -23
  39. package/dist/src/commands/repo.js.map +1 -1
  40. package/dist/src/commands/run.d.ts +2 -1
  41. package/dist/src/commands/run.js +2 -2
  42. package/dist/src/commands/run.js.map +1 -1
  43. package/dist/src/commands/search.d.ts +2 -1
  44. package/dist/src/commands/search.js +3 -1
  45. package/dist/src/commands/search.js.map +1 -1
  46. package/dist/src/commands/variable.d.ts +1 -0
  47. package/dist/src/commands/variable.js +1 -1
  48. package/dist/src/commands/variable.js.map +1 -1
  49. package/dist/src/commands/workflow.d.ts +1 -0
  50. package/dist/src/commands/workflow.js +1 -1
  51. package/dist/src/commands/workflow.js.map +1 -1
  52. package/dist/src/comment.d.ts +10 -0
  53. package/dist/src/comment.js +24 -0
  54. package/dist/src/comment.js.map +1 -0
  55. package/dist/src/errors.d.ts +20 -0
  56. package/dist/src/errors.js +126 -0
  57. package/dist/src/errors.js.map +1 -1
  58. package/dist/src/gh.d.ts +4 -0
  59. package/dist/src/gh.js +81 -13
  60. package/dist/src/gh.js.map +1 -1
  61. package/dist/src/skill.js +2 -2
  62. package/dist/src/skill.js.map +1 -1
  63. package/dist/src/stdin.d.ts +10 -1
  64. package/dist/src/stdin.js +15 -2
  65. package/dist/src/stdin.js.map +1 -1
  66. package/dist/src/suggestions.d.ts +2 -0
  67. package/dist/src/suggestions.js +67 -1
  68. package/dist/src/suggestions.js.map +1 -1
  69. package/package.json +1 -1
  70. package/skills/gh-axi/SKILL.md +2 -2
package/README.md CHANGED
@@ -13,6 +13,7 @@ GitHub CLI for agents — designed with [AXI](https://github.com/kunchenguid/axi
13
13
 
14
14
  Wraps the official `gh` cli with token-efficient TOON output, contextual next-step suggestions, and structured error handling.
15
15
  Built for autonomous agents that interact with GitHub via shell execution.
16
+ Diagnostics from the wrapped `gh` process stream to stderr as they arrive, so approval prompts and errors remain visible while a request is pending.
16
17
 
17
18
  ## Benchmarks
18
19
 
@@ -42,7 +43,7 @@ npx skills add kunchenguid/gh-axi --skill gh-axi -g
42
43
 
43
44
  That is the entire setup - no npm install needed.
44
45
  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
- You still need [`gh`](https://cli.github.com/) installed and authenticated via `gh auth login` (Node 20+ required).
46
+ You still need [`gh`](https://cli.github.com/) installed and authenticated via `gh auth login` (Node 20+ required). gh-axi adds no new minimum `gh` version for existing commands. Only `--attach` on issue and pull request create/edit/comment requires **gh >= 2.99.0**; older `gh` returns a structured error before any mutation runs. Set `GH_BIN` to point at a specific `gh` binary.
46
47
  Stacked PR commands also require GitHub's official extension: `gh extension install github/gh-stack`.
47
48
  For GitHub Enterprise or another custom host, authenticate `gh` for that host and either pass `--hostname <host>` after the command or set `GH_HOST`.
48
49
 
@@ -86,6 +87,7 @@ gh-axi # dashboard - live state, no args needed
86
87
  gh-axi issue list # list issues in current repo
87
88
  gh-axi issue subissue list 16 # list sub-issues for issue #16
88
89
  gh-axi pr view 42 # view pull request #42
90
+ gh-axi discussion view 66 --comments # read a discussion with replies nested under each comment
89
91
  gh-axi stack init model api ui # create or adopt a stack of branches
90
92
  gh-axi stack submit --open # create ready-for-review stacked PRs without prompts
91
93
  gh-axi stack view # inspect the current stack as token-efficient TOON
@@ -117,9 +119,13 @@ gh-axi update # upgrade a global install
117
119
 
118
120
  For multi-line issue, PR, review, or comment text, write Markdown to a UTF-8 file and pass `--body-file <path>` on the relevant command.
119
121
  For releases, `--body` and `--body-file` are aliases for release notes, alongside `--notes` and `--notes-file`.
122
+ Any of these file flags also accepts `-` to read the Markdown from piped stdin (`cat body.md | gh-axi pr comment 42 --body-file -`); an interactive terminal or empty pipe is rejected instead of waited on.
120
123
  For multi-line variable values, pipe stdin to `gh-axi variable set <name>`; `--body`/`-b` is for inline values only.
121
124
 
125
+ `--attach <path>` is repeatable on `issue` and `pr` `create`, `edit`, and `comment` (not `pr review`). It uploads a local image or video through the same `gh --attach` mechanism (requires **gh >= 2.99.0**) and inlines it in the Markdown body. If the body already references the local path, `gh` replaces that reference with the uploaded URL; otherwise it appends the attachment. Alt text is `path#alt` for images; videos cannot take alt text. Supported types: PNG, JPEG, GIF, WebP, SVG, MP4, MOV, WebM. Size limits match GitHub's web upload: 10 MB for images and GIFs, 10 MB for video on Free, 100 MB for video on paid plans. GitHub Enterprise Server is not supported in this gh release. Successful output names each attached file and only the `user-attachments` asset URLs uploaded by that invocation. Override the wrapped `gh` binary with `GH_BIN`.
126
+
122
127
  The label, assignee, reviewer, and project flags of `issue create`/`edit` and `pr create`/`edit` are repeatable: pass the flag once per value and every value reaches `gh`.
128
+ `gh-axi pr create` reports the `base` and `head` the PR was created with, so omitting `--base` surfaces that the PR targets the default branch; if the follow-up ref lookup fails, `base` prints as `null` and the branch name is unavailable.
123
129
  `issue list` and `pr list` accept repeated `--label` filters the same way.
124
130
  A repeated flag with a missing or empty value (`--add-label` with nothing after it, or `--add-label=`) fails with a validation error instead of being silently dropped.
125
131
 
@@ -131,18 +137,23 @@ Long `run view --log` and `run view --log-failed` output shows the last 20,000 c
131
137
  When truncation happens, gh-axi best-effort saves the complete log to a temp file, includes it as `full_log`, and prints a `help:` hint telling agents to grep that file for earlier context.
132
138
  `gh-axi run` manages existing workflow runs; use `gh-axi workflow run <name> --ref <ref>` to trigger (dispatch) a workflow.
133
139
 
134
- `gh-axi pr checks <number>` and the `checks` summary of `gh-axi pr view <number>` bucket every entry of the PR's status-check rollup as `pass`, `fail`, `skip`, or `pending`, covering both check runs (GitHub Actions and similar) and legacy commit statuses (Vercel, `ci/circleci`, and similar).
135
- Cancelled, stale, timed-out, action-required, and startup-failure check runs count as failed, so a red PR is never reported as merely unfinished.
140
+ `gh-axi pr checks <number>` and the `checks` summary of `gh-axi pr view <number>` bucket every entry of the PR's status-check rollup as `pass`, `fail`, `skip`, `pending`, or `cancel`, covering both check runs (GitHub Actions and similar) and legacy commit statuses (Vercel, `ci/circleci`, and similar).
141
+ Matching `gh pr checks`: a cancelled check run gets its own `cancelled` count instead of counting as failed (a cancelled run delivered no verdict about the code), and a stale check run counts as pending because its result no longer applies to the head commit. Timed-out, action-required, and startup-failure check runs still count as failed, so a red PR is never reported as merely unfinished.
142
+
143
+ `gh-axi pr checks <number> --failed` lists only the failing checks; the summary line still counts the full rollup. `gh-axi pr view <number> --checks` appends the same detailed rollup to the PR detail, `gh-axi pr list --fields updatedAt` adds a relative `updated_at` column, and `gh-axi pr diff` accepts `--patch` as a no-op for `gh` compatibility since its output is already patch format.
136
144
 
137
145
  `gh-axi stack` is a strict, non-interactive adapter over the official `github/gh-stack` extension. It supports `view`, `init`, `add`, `checkout`, `push`, `submit`, `sync`, `rebase`, `link`, `unstack`, `merge`, and branch navigation. It intentionally excludes the interactive `modify` and `switch` TUIs and the human-only `alias` and `feedback` utilities.
138
146
  Stack commands operate on local branches and `.git/gh-stack`, so run them from the target repository's working directory. They reject `-R`, `--repo`, and `GH_REPO` rather than pretending a remote repository is enough. `--hostname` remains available for authenticated GitHub Enterprise hosts.
139
147
  Agent-safe behavior is automatic: `stack view` requests JSON, `stack submit` adds `--auto`, and `stack merge` requires an explicit stack or PR target and adds `--yes`. Rebase conflicts and other extension exits retain their original exit codes and include recovery guidance.
140
148
 
141
149
  `gh-axi secret set <name>` reads the value only from piped stdin because secret flags would be visible in the `gh-axi` process argv.
150
+ It rejects `--body`/`-b`. An interactive terminal with no value throws immediately instead of waiting. Secret values never appear in argv, stdout, or error text: an unknown flag is echoed by name only, with any `=value` stripped.
142
151
  `gh-axi secret list` never prints values, matching `gh secret list`.
152
+ `gh secret list` and `gh variable list` have no `--limit` or other pagination flag, so `gh-axi secret list` and `gh-axi variable list` return every result in one call.
143
153
  `gh-axi secret list`, `set`, and `delete` accept `--env`/`-e <environment>` to scope a secret to a deployment environment; without it the repository scope is used.
144
- Other `gh secret` scopes (`--org`, `--user`, `--app`) are rejected with a clear error rather than silently falling back to the repository scope.
154
+ A missing or empty `--env`, conflicting `--env` flags, `--env-file`, other `gh secret` scopes (`--org`, `--user`, `--app`), and any unknown flag are rejected rather than silently falling back to the repository scope.
145
155
  `gh-axi variable` accepts `--body`/`-b` or piped stdin, and variable values are shown in `list` output because variables are not secret.
156
+ A `variable set --body` value is visible in the `gh-axi` process argv, but it is piped to `gh variable set` so the child process does not receive it in argv.
146
157
  `gh-axi project` wraps GitHub Projects (v2) and requires the `project` (or `read:project`) OAuth scope; if a call fails on a missing scope, gh-axi tells you the `gh auth refresh -s <scope>` command to run.
147
158
  `--owner` defaults to the current repo's owner, falling back to explicit `@me` for the authenticated user.
148
159
 
@@ -151,39 +162,42 @@ Gist visibility is fixed at creation; a secret gist is unlisted (anyone with the
151
162
  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
163
  To create a gist from piped content, use `--filename <name>` together with a pipe (`echo "..." | gh-axi gist create --filename foo.txt --public`).
153
164
 
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`.
165
+ `gh-axi api` accepts `-X <method>` and `-X=<method>` as alternatives to the positional HTTP method, plus `--field`, `--raw-field`, `--header`, `--input <file>`, `--paginate`, `--jq <expression>`, `--template <format>`, and `--full`.
155
166
  Use `--input <file>` to send a raw JSON request body, or `--input -` to relay piped stdin byte for byte.
156
167
  `--input -` rejects an interactive terminal instead of waiting for input.
168
+ `--raw-field <key=value>` (repeatable) forwards to `gh api --raw-field` and always sends the value as a JSON string, while `--field` is typed like `gh api -F` and turns numbers, `true`, `false` and `null` into JSON values. Use `--raw-field content=+1` for a value such as a `+1` reaction that must stay a string.
157
169
  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`.
158
170
  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.
171
+ When a bare (non-JSON) `--jq`/`--template` result still exceeds the raw output limit, it is clamped and ends with `... (truncated)` so the cut is visible; pass `--full` to lift the cap.
159
172
  `--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`.
160
173
 
161
174
  ### Commands
162
175
 
163
- | Command | Description |
164
- | ---------- | --------------------------------------------------------------------------- |
165
- | `issue` | Issues — list, view, create, edit, close, reopen, comment, subissue |
166
- | `pr` | Pull requests — list, view, create, merge, review, checks |
167
- | `stack` | Stacked branches and PRs - create, submit, sync, rebase, merge, navigate |
168
- | `run` | Existing workflow runs - list, view, watch, rerun, cancel, delete, download |
169
- | `workflow` | Workflows - list, view, run (trigger), enable, disable |
170
- | `release` | Releases — list, view, create, edit, delete |
171
- | `repo` | Repositories — list, view, create, edit, clone, fork |
172
- | `label` | Labels — list, create, edit, delete |
173
- | `gist` | Gists — list, view, edit, rename, create, delete, clone |
174
- | `project` | Projects (v2) - list, view, create, edit, close, copy, items, fields |
175
- | `secret` | Actions secrets — list, set, delete |
176
- | `variable` | Actions variables — list, set, delete |
177
- | `search` | Search issues, PRs, repos, commits, code |
178
- | `api` | Raw GitHub API access |
179
- | `setup` | Install optional agent session hooks |
180
- | `update` | Built-in self-update command inherited from `axi-sdk-js` |
176
+ | Command | Description |
177
+ | ------------ | --------------------------------------------------------------------------- |
178
+ | `issue` | Issues — list, view, create, edit, close, reopen, comment, subissue |
179
+ | `pr` | Pull requests — list, view, create, merge, review, checks |
180
+ | `discussion` | Discussions (gh preview) - list, view with nested replies, comment or reply |
181
+ | `stack` | Stacked branches and PRs - create, submit, sync, rebase, merge, navigate |
182
+ | `run` | Existing workflow runs - list, view, watch, rerun, cancel, delete, download |
183
+ | `workflow` | Workflows - list, view, run (trigger), enable, disable |
184
+ | `release` | Releases — list, view, create, edit, delete |
185
+ | `repo` | Repositories — list, view, create, edit, clone, fork |
186
+ | `label` | Labels — list, create, edit, delete |
187
+ | `gist` | Gists — list, view, edit, rename, create, delete, clone |
188
+ | `project` | Projects (v2) - list, view, create, edit, close, copy, items, fields |
189
+ | `secret` | Actions secrets — list, set, delete |
190
+ | `variable` | Actions variables — list, set, delete |
191
+ | `search` | Search issues, PRs, repos, commits, code |
192
+ | `api` | Raw GitHub API access |
193
+ | `setup` | Install optional agent session hooks |
194
+ | `update` | Built-in self-update command inherited from `axi-sdk-js` |
181
195
 
182
196
  ### Global flags
183
197
 
184
198
  - `--help` — show help for any command
185
199
  - `-v`, `-V`, `--version` — show the installed `gh-axi` version
186
- - `--hostname <host>` / `--hostname=<host>` — target a custom GitHub host; explicit flags win over `GH_HOST`
200
+ - `--hostname <host>` / `--hostname=<host>` - target a custom GitHub host; explicit flags win over `GH_HOST`. The flag must follow the command. gh-axi strips it before invoking `gh` and sets `GH_HOST` for that child only when the flag is present, leaving an existing `GH_HOST` untouched otherwise. `src/host.ts` `resolveHost()` (flag, then `GH_HOST`, then `github.com`) is the host used when building or parsing URLs.
187
201
 
188
202
  Repository and host targeting are command-first too:
189
203
 
@@ -213,6 +227,8 @@ pnpm run test:watch # Run tests in watch mode
213
227
 
214
228
  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
229
  The generated skill intentionally defers all command guidance to the CLI dashboard and help output so installed copies do not duplicate stale instructions.
230
+ `gh-axi update` is not implemented in this repo. `axi-sdk-js` registers it as a built-in and resolves the npm package name from the nearest `package.json`. The SDK also appends a `built-in:` section to top-level `--help` at runtime, so `TOP_HELP` in `src/cli.ts` is only a prefix of the help users see.
231
+ `src/version.ts` imports Node builtins only. `bin/gh-axi.ts` answers a bare `-v`, `-V`, or `--version` from that leaf module and loads the command graph only for every other invocation. Do not add a wall-clock timing assertion to `test/version-fast-path.test.ts`. Compiled CLI tests share `dist`; `test/global-setup.ts` builds it, including on watch reruns. Do not rebuild from an individual suite while other workers may be running those tests.
216
232
  The npm package includes `skills/gh-axi/`, so published releases ship the same installable Agent Skill documented in Quick Start.
217
233
 
218
234
  ## License
@@ -1,11 +1,24 @@
1
1
  /** Get a flag's value from --flag value or --flag=value without modifying args. */
2
2
  export declare function getFlag(args: string[], name: string): string | undefined;
3
3
  /** Get a flag's value from --flag value or --flag=value and remove it from args. */
4
- export declare function takeFlag(args: string[], flag: string): string | undefined;
4
+ export declare function takeFlag(args: string[], flag: string, protectedFlags?: string[]): string | undefined;
5
5
  /** Check if a boolean flag is present. */
6
6
  export declare function hasFlag(args: string[], flag: string): boolean;
7
- /** Check if a boolean flag is present and remove it from args. */
7
+ /**
8
+ * Check if a boolean flag is present and remove it from args. Value forms
9
+ * (`--flag=true`) are rejected rather than silently ignored, matching the
10
+ * repo convention that a boolean flag never takes a value.
11
+ */
8
12
  export declare function takeBoolFlag(args: string[], flag: string): boolean;
13
+ /**
14
+ * Like takeFlag, but throws VALIDATION_ERROR when the flag is present with a
15
+ * missing or blank value, rather than silently returning undefined for it.
16
+ * A following option token (`--source --push`) is treated as a missing value,
17
+ * not consumed as one; use `--flag=value` for a dash-leading value.
18
+ */
19
+ export declare function takeRequiredFlag(args: string[], flag: string): string | undefined;
20
+ /** Like takeRequiredFlag, but rejects repeats and only scans before `--`. */
21
+ export declare function takeSingleRequiredFlag(args: string[], flag: string): string | undefined;
9
22
  /**
10
23
  * Collect all values for a repeatable flag in --flag value or --flag=value form
11
24
  * without modifying args. Throws VALIDATION_ERROR if any occurrence has a
@@ -13,7 +26,7 @@ export declare function takeBoolFlag(args: string[], flag: string): boolean;
13
26
  */
14
27
  export declare function getAllFlags(args: string[], flag: string): string[];
15
28
  /** Like getAllFlags, but also removes every occurrence from args. */
16
- export declare function takeAllFlags(args: string[], flag: string): string[];
29
+ export declare function takeAllFlags(args: string[], flag: string, protectedFlags?: string[]): string[];
17
30
  /** Append a repeatable flag once per value onto a gh argv array. */
18
31
  export declare function pushRepeated(ghArgs: string[], flag: string, values: string[]): void;
19
32
  /** Get the first positional arg (non-flag) starting from startIndex. */
package/dist/src/args.js CHANGED
@@ -19,12 +19,15 @@ export function getFlag(args, name) {
19
19
  return undefined;
20
20
  }
21
21
  /** Get a flag's value from --flag value or --flag=value and remove it from args. */
22
- export function takeFlag(args, flag) {
22
+ export function takeFlag(args, flag, protectedFlags) {
23
23
  const equalsPrefix = flagEqualsPrefix(flag);
24
24
  for (let i = 0; i < args.length; i++) {
25
25
  const arg = args[i];
26
26
  if (arg === flag) {
27
27
  const val = args[i + 1];
28
+ if (val !== undefined && protectedFlags?.includes(val)) {
29
+ throw new AxiError(`${flag} requires a value; got ${val}, which is a flag. Use ${flag}=<value> for a dash-leading value.`, "VALIDATION_ERROR");
30
+ }
28
31
  args.splice(i, 2);
29
32
  return val;
30
33
  }
@@ -40,8 +43,16 @@ export function takeFlag(args, flag) {
40
43
  export function hasFlag(args, flag) {
41
44
  return args.includes(flag);
42
45
  }
43
- /** Check if a boolean flag is present and remove it from args. */
46
+ /**
47
+ * Check if a boolean flag is present and remove it from args. Value forms
48
+ * (`--flag=true`) are rejected rather than silently ignored, matching the
49
+ * repo convention that a boolean flag never takes a value.
50
+ */
44
51
  export function takeBoolFlag(args, flag) {
52
+ const eq = args.findIndex((a) => a.startsWith(flag + "="));
53
+ if (eq !== -1) {
54
+ throw new AxiError(`${flag} does not take a value, got "${args[eq]}"`, "VALIDATION_ERROR");
55
+ }
45
56
  const idx = args.indexOf(flag);
46
57
  if (idx === -1)
47
58
  return false;
@@ -53,14 +64,55 @@ function requireFlagValue(value, flag) {
53
64
  throw new AxiError(`${flag} requires a value`, "VALIDATION_ERROR");
54
65
  return value;
55
66
  }
56
- function collectAllFlags(args, flag, consume) {
67
+ /**
68
+ * Like takeFlag, but throws VALIDATION_ERROR when the flag is present with a
69
+ * missing or blank value, rather than silently returning undefined for it.
70
+ * A following option token (`--source --push`) is treated as a missing value,
71
+ * not consumed as one; use `--flag=value` for a dash-leading value.
72
+ */
73
+ export function takeRequiredFlag(args, flag) {
74
+ const equalsPrefix = flagEqualsPrefix(flag);
75
+ for (let i = 0; i < args.length; i++) {
76
+ const arg = args[i];
77
+ if (arg === flag) {
78
+ const val = args[i + 1];
79
+ if (val === undefined || val.startsWith("-"))
80
+ throw new AxiError(`${flag} requires a value`, "VALIDATION_ERROR");
81
+ args.splice(i, 2);
82
+ return requireFlagValue(val, flag);
83
+ }
84
+ if (arg.startsWith(equalsPrefix)) {
85
+ args.splice(i, 1);
86
+ return requireFlagValue(arg.slice(equalsPrefix.length), flag);
87
+ }
88
+ }
89
+ return undefined;
90
+ }
91
+ /** Like takeRequiredFlag, but rejects repeats and only scans before `--`. */
92
+ export function takeSingleRequiredFlag(args, flag) {
93
+ const end = args.indexOf("--");
94
+ const optionCount = end === -1 ? args.length : end;
95
+ const options = args.slice(0, optionCount);
96
+ const value = takeRequiredFlag(options, flag);
97
+ const equalsPrefix = flagEqualsPrefix(flag);
98
+ if (options.some((arg) => arg === flag || arg.startsWith(equalsPrefix))) {
99
+ throw new AxiError(`${flag} may only be given once`, "VALIDATION_ERROR");
100
+ }
101
+ args.splice(0, optionCount, ...options);
102
+ return value;
103
+ }
104
+ function collectAllFlags(args, flag, consume, protectedFlags) {
57
105
  const result = [];
58
106
  const equalsPrefix = flagEqualsPrefix(flag);
59
107
  let i = 0;
60
108
  while (i < args.length) {
61
109
  const arg = args[i];
62
110
  if (arg === flag) {
63
- result.push(requireFlagValue(args[i + 1] ?? "", flag));
111
+ const next = args[i + 1];
112
+ if (next !== undefined && protectedFlags?.includes(next)) {
113
+ throw new AxiError(`${flag} requires a value; got ${next}, which is a flag. Use ${flag}=<value> for a dash-leading value.`, "VALIDATION_ERROR");
114
+ }
115
+ result.push(requireFlagValue(next ?? "", flag));
64
116
  if (consume)
65
117
  args.splice(i, 2);
66
118
  else
@@ -88,8 +140,8 @@ export function getAllFlags(args, flag) {
88
140
  return collectAllFlags(args, flag, false);
89
141
  }
90
142
  /** Like getAllFlags, but also removes every occurrence from args. */
91
- export function takeAllFlags(args, flag) {
92
- return collectAllFlags(args, flag, true);
143
+ export function takeAllFlags(args, flag, protectedFlags) {
144
+ return collectAllFlags(args, flag, true, protectedFlags);
93
145
  }
94
146
  /** Append a repeatable flag once per value onto a gh argv array. */
95
147
  export function pushRepeated(ghArgs, flag, values) {
@@ -136,7 +188,9 @@ export function rejectUnknownFlags(args, known, command, sub) {
136
188
  const tok = args[i];
137
189
  if (tok === "--")
138
190
  break;
139
- if (!tok.startsWith("-"))
191
+ // A bare `-` is gh's stdin sentinel (`--body-file -`), a positional value
192
+ // rather than a flag.
193
+ if (tok === "-" || !tok.startsWith("-"))
140
194
  continue;
141
195
  const name = tok.split("=", 1)[0];
142
196
  if (name === "--help" || name === "-h")
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,GAAG,IAAI,GAAG,CAAC;AACpB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,IAAc,EAAE,IAAY;IAClD,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM;gBAAE,OAAO,SAAS,CAAC;YAC3C,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,OAAO,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,oFAAoF;AACpF,MAAM,U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CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,eAAe,OAAO,IAAI,GAAG,KAAK,IAAI,EAAE,EACpF,kBAAkB,EAClB,CAAC,UAAU,OAAO,IAAI,GAAG,UAAU,EAAE,UAAU,OAAO,IAAI,GAAG,SAAS,CAAC,CACxE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const ATTACH_MIN_GH_VERSION = "2.99.0";
2
+ export declare const ATTACH_FLAG = "--attach";
3
+ export declare const ATTACH_BODY_OPTIONS: {
4
+ valueBoundaryFlags: string[];
5
+ };
6
+ export declare function attachBodyOptions(required: boolean): {
7
+ required: boolean;
8
+ valueBoundaryFlags: string[];
9
+ };
10
+ export declare function hasAttachmentFlag(args: string[]): boolean;
11
+ export declare function extractAttachmentUrls(body: string): string[];
12
+ export declare function collectAttachments(args: string[], mode: "get" | "take"): string[];
13
+ export declare function pushAttachments(ghArgs: string[], specs: string[]): void;
14
+ export declare function preserveAttachMutation<T>(mutationState: string, operation: () => Promise<T>): Promise<T>;
15
+ export declare function newAttachmentUrls(body: string | undefined, baselineBody?: string | undefined): string[];
16
+ export declare function renderAttachOutput(specs: string[], body: string | undefined, baselineBody?: string | undefined): string;
@@ -0,0 +1,56 @@
1
+ import { getAllFlags, pushRepeated, takeAllFlags } from "./args.js";
2
+ import { MutationFollowupError } from "./errors.js";
3
+ import { field, renderList } from "./toon.js";
4
+ export const ATTACH_MIN_GH_VERSION = "2.99.0";
5
+ export const ATTACH_FLAG = "--attach";
6
+ const ASSET_URL_RE = /https:\/\/[^\s)]+\/user-attachments\/assets\/[A-Za-z0-9-]+/g;
7
+ export const ATTACH_BODY_OPTIONS = {
8
+ valueBoundaryFlags: [ATTACH_FLAG],
9
+ };
10
+ export function attachBodyOptions(required) {
11
+ return { required, valueBoundaryFlags: [ATTACH_FLAG] };
12
+ }
13
+ export function hasAttachmentFlag(args) {
14
+ const equalsPrefix = `${ATTACH_FLAG}=`;
15
+ return args.some((arg) => arg === ATTACH_FLAG || arg.startsWith(equalsPrefix));
16
+ }
17
+ export function extractAttachmentUrls(body) {
18
+ return body.match(ASSET_URL_RE) ?? [];
19
+ }
20
+ export function collectAttachments(args, mode) {
21
+ return mode === "take"
22
+ ? takeAllFlags(args, ATTACH_FLAG)
23
+ : getAllFlags(args, ATTACH_FLAG);
24
+ }
25
+ export function pushAttachments(ghArgs, specs) {
26
+ pushRepeated(ghArgs, ATTACH_FLAG, specs);
27
+ }
28
+ export async function preserveAttachMutation(mutationState, operation) {
29
+ try {
30
+ return await operation();
31
+ }
32
+ catch (error) {
33
+ throw MutationFollowupError.from(mutationState, error);
34
+ }
35
+ }
36
+ export function newAttachmentUrls(body, baselineBody = "") {
37
+ const seenUrls = new Set(extractAttachmentUrls(baselineBody ?? ""));
38
+ return extractAttachmentUrls(body ?? "").filter((url) => {
39
+ if (seenUrls.has(url))
40
+ return false;
41
+ seenUrls.add(url);
42
+ return true;
43
+ });
44
+ }
45
+ export function renderAttachOutput(specs, body, baselineBody = "") {
46
+ if (specs.length === 0)
47
+ return "";
48
+ const files = specs.map((file) => ({ file }));
49
+ const urls = newAttachmentUrls(body, baselineBody).map((url) => ({ url }));
50
+ const blocks = [renderList("attachments", files, [field("file")])];
51
+ if (urls.length > 0) {
52
+ blocks.push(renderList("asset_urls", urls, [field("url")]));
53
+ }
54
+ return blocks.join("\n");
55
+ }
56
+ //# sourceMappingURL=attach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach.js","sourceRoot":"","sources":["../../src/attach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG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alHint?: string;
12
12
  }
13
13
  /**
14
- * Resolve a command body from inline text or a UTF-8 file and remove the flags.
14
+ * Read a body from piped stdin for the `-` sentinel (gh's own convention).
15
+ * AXI commands must never hang waiting for input, so an interactive TTY is
16
+ * refused before any read.
17
+ */
18
+ export declare function readBodyStdin(flag: string, suggestions: string[]): string;
19
+ /**
20
+ * Resolve a command body from inline text, a UTF-8 file, or piped stdin (a
21
+ * file flag value of `-`) and remove the flags.
15
22
  *
16
23
  * Optional bodies accept at most one source. Required bodies enforce exactly
17
24
  * one source and raise validation errors for missing, conflicting, or
package/dist/src/body.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import { AxiError } from "./errors.js";
3
+ import { isStdinTTY, readStdinSync } from "./stdin.js";
3
4
  function defaultSuggestions(label) {
4
5
  return [
5
6
  `Use --body "..." for inline ${label}, or --body-file <path> for markdown from a file`,
@@ -45,7 +46,34 @@ function takeFlagMatches(args, flags, valueBoundaryFlags) {
45
46
  }
46
47
  return matches;
47
48
  }
49
+ /**
50
+ * Read a body from piped stdin for the `-` sentinel (gh's own convention).
51
+ * AXI commands must never hang waiting for input, so an interactive TTY is
52
+ * refused before any read.
53
+ */
54
+ export function readBodyStdin(flag, suggestions) {
55
+ const pipeExample = `Example: cat body.md | gh-axi <command> ${flag} -`;
56
+ if (isStdinTTY()) {
57
+ throw new AxiError(`${flag} - requires content piped via stdin; no pipe was detected`, "VALIDATION_ERROR", [pipeExample, ...suggestions]);
58
+ }
59
+ let content;
60
+ try {
61
+ content = readStdinSync();
62
+ }
63
+ catch (error) {
64
+ const code = error && typeof error === "object" && "code" in error
65
+ ? String(error.code)
66
+ : "UNKNOWN";
67
+ throw new AxiError(`Could not read ${flag} - from stdin (${code})`, "VALIDATION_ERROR", suggestions);
68
+ }
69
+ if (content === "") {
70
+ throw new AxiError(`${flag} -: no content received on stdin; nothing was piped`, "VALIDATION_ERROR", [pipeExample, ...suggestions]);
71
+ }
72
+ return content;
73
+ }
48
74
  function readBodyFile(flag, path, suggestions) {
75
+ if (path === "-")
76
+ return readBodyStdin(flag, suggestions);
49
77
  try {
50
78
  return readFileSync(path, "utf8");
51
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"body.js","sourceRoot":"","sources":["../../src/body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA4BvC,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO;QACL,+BAA+B,KAAK,kDAAkD;KACvF,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAyB;IAC/C,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AACpD,CAAC;AAED,SAAS,eAAe,CAAC,GAAuB,EAAE,KAAe;IAC/D,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,eAAe,CACtB,IAAc,EACd,KAAe,EACf,kBAA4B;IAE5B,MAAM,OAAO,GAAoB,EAAE,CAAC;IAEpC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,CAAC;YAChC,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;gBACjB,MAAM,IAAI,GAAG,IAAI,CAAC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A4B,CAAC;IAC1E,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,iCAAiC,CAAC;IACvE,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;QAC7B,iDAAiD;QACjD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,CACL,OAAO;gBACP,cAAc;gBACd,IAAI,CAAC,MAAM;gBACX,oBAAoB;gBACpB,YAAY;gBACZ,GAAG,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,CACL,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC;QACxB,oBAAoB;QACpB,OAAO,CAAC,MAAM;QACd,iBAAiB;QACjB,QAAQ;QACR,GAAG,CACJ,CAAC;AACJ,CAAC"}
package/dist/src/cli.d.ts CHANGED
@@ -4,6 +4,6 @@ type MainOptions = {
4
4
  argv?: string[];
5
5
  stdout?: CliStdout;
6
6
  };
7
- export declare const TOP_HELP = "usage: gh-axi [command] [args] [flags]\ncommands[16]:\n (none)=dashboard, issue, pr, stack, run, workflow, release, repo, label, gist, project, secret, variable, search, api, setup\nflags[4]:\n -R/--repo <OWNER/NAME> (after command), --hostname <host> (after command) or GH_HOST env, both flags accept space or equals form, --help, -v/-V/--version\nexamples:\n gh-axi\n gh-axi issue list --state open\n gh-axi issue list -R owner/name\n gh-axi issue list --repo=owner/name\n gh-axi issue list --hostname git.example.com\n gh-axi pr view 42\n gh-axi stack view\n gh-axi secret list\n gh-axi setup hooks\n";
7
+ export declare const TOP_HELP = "usage: gh-axi [command] [args] [flags]\ncommands[17]:\n (none)=dashboard, issue, pr, discussion, stack, run, workflow, release, repo, label, gist, project, secret, variable, search, api, setup\nflags[4]:\n -R/--repo <OWNER/NAME> (after command), --hostname <host> (after command) or GH_HOST env, both flags accept space or equals form, --help, -v/-V/--version\nrequires:\n gh >= 2.99.0 for --attach on issue/pr create, edit, and comment (set GH_BIN to override the gh binary)\nexamples:\n gh-axi\n gh-axi issue list --state open\n gh-axi issue list -R owner/name\n gh-axi issue list --repo=owner/name\n gh-axi issue list --hostname git.example.com\n gh-axi pr view 42\n gh-axi discussion view 66 --comments\n gh-axi stack view\n gh-axi secret list\n gh-axi setup hooks\n";
8
8
  export declare function main(options?: MainOptions): Promise<void>;
9
9
  export {};