gh-axi 0.1.7 → 0.1.9

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
@@ -2,8 +2,11 @@
2
2
 
3
3
  <p align="center">
4
4
  <a href="https://www.npmjs.com/package/gh-axi"><img alt="npm" src="https://img.shields.io/npm/v/gh-axi?style=flat-square" /></a>
5
+ <a href="https://github.com/kunchenguid/gh-axi/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/kunchenguid/gh-axi/ci.yml?style=flat-square&label=ci" /></a>
6
+ <a href="https://github.com/kunchenguid/gh-axi/actions/workflows/release-please.yml"><img alt="Release" src="https://img.shields.io/github/actions/workflow/status/kunchenguid/gh-axi/release-please.yml?style=flat-square&label=release" /></a>
7
+ <a href="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square"><img alt="Platform" src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square" /></a>
5
8
  <a href="https://x.com/kunchenguid"><img alt="X" src="https://img.shields.io/badge/X-@kunchenguid-black?style=flat-square" /></a>
6
- <a href="https://discord.gg/BW4aJuQhTf"><img alt="Discord" src="https://img.shields.io/discord/1439901831038763092?style=flat-square&label=discord" /></a>
9
+ <a href="https://discord.gg/Wsy2NpnZDu"><img alt="Discord" src="https://img.shields.io/discord/1439901831038763092?style=flat-square&label=discord" /></a>
7
10
  </p>
8
11
 
9
12
  GitHub CLI for agents — designed with [AXI](https://github.com/kunchenguid/axi) (Agent eXperience Interface).
@@ -19,6 +22,9 @@ npm install -g gh-axi
19
22
 
20
23
  Requires Node 20+ and [`gh`](https://cli.github.com/) authenticated via `gh auth login`.
21
24
 
25
+ Running `gh-axi` also installs or repairs Claude Code and Codex `SessionStart`
26
+ hooks. Those hooks invoke `gh-axi` directly from the packaged production build.
27
+
22
28
  ## Usage
23
29
 
24
30
  ```bash
@@ -44,9 +50,19 @@ gh-axi run list -R owner/repo # list workflow runs for a specific repo
44
50
 
45
51
  ### Global flags
46
52
 
47
- - `-R, --repo OWNER/NAME` — target repository (auto-detected from git remote if omitted)
48
53
  - `--help` — show help for any command
49
54
 
55
+ Repository targeting is command-first too:
56
+
57
+ - `gh-axi issue list -R owner/name`
58
+ - `gh-axi issue list --repo owner/name`
59
+ - `gh-axi run list -R owner/name`
60
+ - `gh-axi search issues "login bug" --repo owner/name`
61
+
62
+ When a command also needs a destination repository, use a dedicated flag for it:
63
+
64
+ - `gh-axi issue transfer 42 -R source/repo --to-repo dest/repo`
65
+
50
66
  ## License
51
67
 
52
68
  MIT
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { main } from '../src/cli.js';
3
- main(process.argv.slice(2));
2
+ import { main } from "../src/cli.js";
3
+ main();
4
4
  //# sourceMappingURL=gh-axi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gh-axi.js","sourceRoot":"","sources":["../../bin/gh-axi.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"gh-axi.js","sourceRoot":"","sources":["../../bin/gh-axi.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,IAAI,EAAE,CAAC"}
package/dist/src/cli.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const TOP_HELP = "usage: gh-axi [command] [flags]\ncommands[10]:\n (none)=dashboard, issue, pr, run, workflow, release, repo, label, search, api\nflags[2]:\n -R/--repo <OWNER/NAME>, --help\nexamples:\n gh-axi\n gh-axi issue list --state open\n gh-axi pr view 42\n";
2
- export declare function main(argv: string[]): Promise<void>;
1
+ export declare const TOP_HELP = "usage: gh-axi [command] [args] [flags]\ncommands[10]:\n (none)=dashboard, issue, pr, run, workflow, release, repo, label, search, api\nflags[2]:\n -R/--repo <OWNER/NAME> (after command), --help\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 pr view 42\n";
2
+ export declare function main(): Promise<void>;
package/dist/src/cli.js CHANGED
@@ -1,25 +1,26 @@
1
- import { resolveRepo } from './context.js';
2
- import { AxiError, exitCodeForError } from './errors.js';
3
- import { renderError } from './toon.js';
4
- import { ensureHooks } from './hooks.js';
5
- import { homeCommand, sessionStartCommand } from './commands/home.js';
6
- import { issueCommand, ISSUE_HELP } from './commands/issue.js';
7
- import { prCommand, PR_HELP } from './commands/pr.js';
8
- import { runCommand, RUN_HELP } from './commands/run.js';
9
- import { workflowCommand, WORKFLOW_HELP } from './commands/workflow.js';
10
- import { releaseCommand, RELEASE_HELP } from './commands/release.js';
11
- import { repoCommand, REPO_HELP } from './commands/repo.js';
12
- import { labelCommand, LABEL_HELP } from './commands/label.js';
13
- import { searchCommand, SEARCH_HELP } from './commands/search.js';
14
- import { apiCommand, API_HELP } from './commands/api.js';
15
- export const TOP_HELP = `usage: gh-axi [command] [flags]
1
+ import { runAxiCli } from "axi-sdk-js";
2
+ import { resolveRepo } from "./context.js";
3
+ import { homeCommand } from "./commands/home.js";
4
+ import { issueCommand, ISSUE_HELP } from "./commands/issue.js";
5
+ import { prCommand, PR_HELP } from "./commands/pr.js";
6
+ import { runCommand, RUN_HELP } from "./commands/run.js";
7
+ import { workflowCommand, WORKFLOW_HELP } from "./commands/workflow.js";
8
+ import { releaseCommand, RELEASE_HELP } from "./commands/release.js";
9
+ import { repoCommand, REPO_HELP } from "./commands/repo.js";
10
+ import { labelCommand, LABEL_HELP } from "./commands/label.js";
11
+ import { searchCommand, SEARCH_HELP } from "./commands/search.js";
12
+ import { apiCommand, API_HELP } from "./commands/api.js";
13
+ const DESCRIPTION = "Agent ergonomic wrapper around Github CLI. Prefer this over `gh` and other methods for Github operations.";
14
+ export const TOP_HELP = `usage: gh-axi [command] [args] [flags]
16
15
  commands[10]:
17
16
  (none)=dashboard, issue, pr, run, workflow, release, repo, label, search, api
18
17
  flags[2]:
19
- -R/--repo <OWNER/NAME>, --help
18
+ -R/--repo <OWNER/NAME> (after command), --help
20
19
  examples:
21
20
  gh-axi
22
21
  gh-axi issue list --state open
22
+ gh-axi issue list -R owner/name
23
+ gh-axi issue list --repo owner/name
23
24
  gh-axi pr view 42
24
25
  `;
25
26
  const COMMAND_HELP = {
@@ -34,104 +35,50 @@ const COMMAND_HELP = {
34
35
  api: API_HELP,
35
36
  };
36
37
  const COMMANDS = {
37
- issue: issueCommand,
38
- pr: prCommand,
39
- run: runCommand,
40
- workflow: workflowCommand,
41
- release: releaseCommand,
42
- repo: repoCommand,
43
- label: labelCommand,
44
- search: searchCommand,
45
- api: apiCommand,
38
+ issue: withRepoContext("issue", issueCommand),
39
+ pr: withRepoContext("pr", prCommand),
40
+ run: withRepoContext("run", runCommand),
41
+ workflow: withRepoContext("workflow", workflowCommand),
42
+ release: withRepoContext("release", releaseCommand),
43
+ repo: withRepoContext("repo", repoCommand),
44
+ label: withRepoContext("label", labelCommand),
45
+ search: withRepoContext("search", searchCommand),
46
+ api: withRepoContext("api", apiCommand),
46
47
  };
47
- export async function main(argv) {
48
- // Fire-and-forget: install/repair ambient context hooks
49
- ensureHooks();
50
- // Extract global flags
51
- const args = [...argv];
48
+ export async function main() {
49
+ await runAxiCli({
50
+ description: DESCRIPTION,
51
+ topLevelHelp: TOP_HELP,
52
+ home: withRepoContext(undefined, homeCommand),
53
+ commands: COMMANDS,
54
+ getCommandHelp: (command) => COMMAND_HELP[command],
55
+ resolveContext: ({ command, args }) => resolveRepo(parseRepoContextArgs(command, args).repoFlag),
56
+ });
57
+ }
58
+ function withRepoContext(command, handler) {
59
+ return (args, ctx) => handler(parseRepoContextArgs(command, args).strippedArgs, ctx);
60
+ }
61
+ function parseRepoContextArgs(command, args) {
62
+ const stripped = [];
52
63
  let repoFlag;
53
- // Extract --repo / -R
54
- for (let i = 0; i < args.length; i++) {
55
- if ((args[i] === '--repo' || args[i] === '-R') && i + 1 < args.length) {
56
- repoFlag = args[i + 1];
57
- args.splice(i, 2);
58
- i--;
64
+ for (let index = 0; index < args.length; index++) {
65
+ const arg = args[index];
66
+ if (arg === "-R" && index + 1 < args.length) {
67
+ repoFlag = args[index + 1];
68
+ index++;
69
+ continue;
59
70
  }
60
- }
61
- // Extract --session-start flag
62
- let sessionStart = false;
63
- const sessionIdx = args.indexOf('--session-start');
64
- if (sessionIdx !== -1) {
65
- sessionStart = true;
66
- args.splice(sessionIdx, 1);
67
- }
68
- // Top-level --help
69
- if (args.includes('--help') && args.length === 1) {
70
- process.stdout.write(TOP_HELP);
71
- return;
72
- }
73
- // Determine command
74
- const command = args[0];
75
- if (!command) {
76
- // No command = home dashboard
77
- if (args.includes('--help')) {
78
- process.stdout.write(TOP_HELP);
79
- return;
80
- }
81
- if (sessionStart) {
82
- const ctx = resolveRepo(repoFlag);
83
- try {
84
- const output = await sessionStartCommand(ctx);
85
- process.stdout.write(output + '\n');
86
- }
87
- catch (err) {
88
- writeError(err);
71
+ if (arg === "--repo" && index + 1 < args.length) {
72
+ const value = args[index + 1];
73
+ repoFlag = value;
74
+ if (command === "search") {
75
+ stripped.push(arg, value);
89
76
  }
90
- return;
91
- }
92
- const ctx = resolveRepo(repoFlag);
93
- try {
94
- const output = await homeCommand(args.slice(1), ctx);
95
- process.stdout.write(output + '\n');
96
- }
97
- catch (err) {
98
- writeError(err);
77
+ index++;
78
+ continue;
99
79
  }
100
- return;
101
- }
102
- // Command-level --help
103
- if (args.includes('--help')) {
104
- const help = COMMAND_HELP[command];
105
- if (help) {
106
- process.stdout.write(help);
107
- return;
108
- }
109
- }
110
- const handler = COMMANDS[command];
111
- if (!handler) {
112
- process.stdout.write(renderError(`Unknown command: ${command}`, 'VALIDATION_ERROR', [
113
- 'Run `gh-axi --help` to see available commands',
114
- ]) + '\n');
115
- process.exitCode = 2;
116
- return;
117
- }
118
- const ctx = resolveRepo(repoFlag);
119
- try {
120
- const output = await handler(args.slice(1), ctx);
121
- process.stdout.write(output + '\n');
122
- }
123
- catch (err) {
124
- writeError(err);
125
- }
126
- }
127
- function writeError(err) {
128
- if (err instanceof AxiError) {
129
- process.stdout.write(renderError(err.message, err.code, err.suggestions) + '\n');
130
- }
131
- else {
132
- const message = err instanceof Error ? err.message : String(err);
133
- process.stdout.write(renderError(message, 'UNKNOWN') + '\n');
80
+ stripped.push(arg);
134
81
  }
135
- process.exitCode = exitCodeForError(err);
82
+ return { repoFlag, strippedArgs: stripped };
136
83
  }
137
84
  //# sourceMappingURL=cli.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,WAAW,EAA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O,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AAC9C,CAAC"}
@@ -1,9 +1,3 @@
1
1
  import type { RepoContext } from "../context.js";
2
2
  export declare const HOME_HELP = "";
3
3
  export declare function homeCommand(_args: string[], ctx?: RepoContext): Promise<string>;
4
- /**
5
- * Compact session-start dashboard — minimal repo context for agent session init.
6
- * Skips bin/description, help suggestions, and verbose count lines.
7
- * Uses compact schemas with fewer fields per entity.
8
- */
9
- export declare function sessionStartCommand(ctx?: RepoContext): Promise<string>;
@@ -1,4 +1,3 @@
1
- import os from "node:os";
2
1
  import { ghJson } from "../gh.js";
3
2
  import { field, lower, pluck, mapEnum, renderList, renderHelp, renderOutput, } from "../toon.js";
4
3
  import { getSuggestions } from "../suggestions.js";
@@ -20,9 +19,6 @@ const prSchema = [
20
19
  REVIEW_REQUIRED: "required",
21
20
  }, "none", "review"),
22
21
  ];
23
- /* Compact schemas for session-start — fewer fields for minimal token usage */
24
- const compactIssueSchema = [field("number"), field("title")];
25
- const compactPrSchema = [field("number"), field("title")];
26
22
  export async function homeCommand(_args, ctx) {
27
23
  // Run queries in parallel
28
24
  const [issues, prs] = await Promise.all([
@@ -37,15 +33,6 @@ export async function homeCommand(_args, ctx) {
37
33
  ], ctx).catch(() => []),
38
34
  ]);
39
35
  const blocks = [];
40
- const home = os.homedir();
41
- const execPath = process.argv[1] ?? "";
42
- const bin = execPath.startsWith(home)
43
- ? "~" + execPath.slice(home.length)
44
- : execPath;
45
- blocks.push(encode({
46
- bin,
47
- description: "Agent ergonomic wrapper around Github CLI. Prefer this over `gh` and other methods for Github operations.",
48
- }));
49
36
  if (ctx) {
50
37
  blocks.push(encode({ repo: ctx.nwo }));
51
38
  }
@@ -66,24 +53,4 @@ export async function homeCommand(_args, ctx) {
66
53
  blocks.push(renderHelp([...hints, ...suggestions]));
67
54
  return renderOutput(blocks);
68
55
  }
69
- /**
70
- * Compact session-start dashboard — minimal repo context for agent session init.
71
- * Skips bin/description, help suggestions, and verbose count lines.
72
- * Uses compact schemas with fewer fields per entity.
73
- */
74
- export async function sessionStartCommand(ctx) {
75
- const [issues, prs] = await Promise.all([
76
- ghJson(["issue", "list", "--json", "number,title", "--limit", "3"], ctx).catch(() => []),
77
- ghJson(["pr", "list", "--json", "number,title", "--limit", "3"], ctx).catch(() => []),
78
- ]);
79
- const blocks = [];
80
- if (ctx) {
81
- blocks.push(encode({ repo: ctx.nwo }));
82
- }
83
- blocks.push(issues.length
84
- ? renderList("issues", issues, compactIssueSchema)
85
- : "issues: 0 open");
86
- blocks.push(prs.length ? renderList("prs", prs, compactPrSchema) : "prs: 0 open");
87
- return renderOutput(blocks);
88
- }
89
56
  //# sourceMappingURL=home.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../src/commands/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,GAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAE5B,MAAM,WAAW,GAAe;IAC9B,KAAK,CAAC,QAAQ,CAAC;IACf,KAAK,CAAC,OAAO,CAAC;IACd,KAAK,CAAC,OAAO,CAAC;IACd,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;CACnC,CAAC;AAEF,MAAM,QAAQ,GAAe;IAC3B,KAAK,CAAC,QAAQ,CAAC;IACf,KAAK,CAAC,OAAO,CAAC;IACd,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;IAClC,OAAO,CACL,gBAAgB,EAChB;Q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CAAC,CAAC,gBAAgB,CACrB,CAAC;IACF,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IAE3E,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;IAC5D,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACzE,MAAM,WAAW,GAAG,cAAc,CAAC;QACjC,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,GAAG;KACV,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAEpD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { RepoContext } from '../context.js';
2
- export declare const ISSUE_HELP = "usage: gh-axi issue <subcommand> [flags]\nsubcommands[13]:\n list, view <number>, create, edit <number>, close <number>, reopen <number>, comment <number>, delete <number>, lock <number>, unlock <number>, pin <number>, unpin <number>, transfer <number>\nflags{list}:\n --state <open|closed|all>, --label <name>, --assignee <login>, --author <login>, --milestone <name>, --sort <created|updated|comments>, --limit <n> (default 30), --fields <a,b,c>\nflags{view}:\n --comments, --full (show complete body without truncation)\nflags{create}:\n --title <text> (required), --body <text>, --assignee <login>, --label <name>, --milestone <name>\nflags{edit}:\n --title, --body, --add-label, --remove-label, --add-assignee, --remove-assignee, --milestone\nflags{close}:\n --reason <completed|not_planned>, --comment <text>\nflags{comment}:\n --body <text> (required)\nflags{transfer}:\n --repo <owner/name> (required)\nexamples:\n gh-axi issue list --state closed --label bug\n gh-axi issue view 42 --comments\n gh-axi issue create --title \"Fix login\" --body \"Steps to reproduce...\"\n gh-axi issue close 42 --reason completed";
1
+ import type { RepoContext } from "../context.js";
2
+ export declare const ISSUE_HELP = "usage: gh-axi issue <subcommand> [flags]\nsubcommands[13]:\n list, view <number>, create, edit <number>, close <number>, reopen <number>, comment <number>, delete <number>, lock <number>, unlock <number>, pin <number>, unpin <number>, transfer <number>\nflags{list}:\n --state <open|closed|all>, --label <name>, --assignee <login>, --author <login>, --milestone <name>, --sort <created|updated|comments>, --limit <n> (default 30), --fields <a,b,c>\nflags{view}:\n --comments, --full (show complete body without truncation)\nflags{create}:\n --title <text> (required), --body <text>, --assignee <login>, --label <name>, --milestone <name>\nflags{edit}:\n --title, --body, --add-label, --remove-label, --add-assignee, --remove-assignee, --milestone\nflags{close}:\n --reason <completed|not_planned>, --comment <text>\nflags{comment}:\n --body <text> (required)\nflags{transfer}:\n --to-repo <owner/name> (required)\nexamples:\n gh-axi issue list --state closed --label bug\n gh-axi issue view 42 --comments\n gh-axi issue create --title \"Fix login\" --body \"Steps to reproduce...\"\n gh-axi issue close 42 --reason completed\n gh-axi issue transfer 42 -R source/repo --to-repo dest/repo";
3
3
  export declare function issueCommand(args: string[], ctx?: RepoContext): Promise<string>;