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 +18 -2
- package/dist/bin/gh-axi.js +2 -2
- package/dist/bin/gh-axi.js.map +1 -1
- package/dist/src/cli.d.ts +2 -2
- package/dist/src/cli.js +56 -109
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/home.d.ts +0 -6
- package/dist/src/commands/home.js +0 -33
- package/dist/src/commands/home.js.map +1 -1
- package/dist/src/commands/issue.d.ts +2 -2
- package/dist/src/commands/issue.js +392 -218
- package/dist/src/commands/issue.js.map +1 -1
- package/dist/src/commands/search.d.ts +1 -1
- package/dist/src/commands/search.js +180 -137
- package/dist/src/commands/search.js.map +1 -1
- package/dist/src/errors.d.ts +3 -8
- package/dist/src/errors.js +25 -35
- package/dist/src/errors.js.map +1 -1
- package/package.json +3 -2
- package/dist/src/hooks.d.ts +0 -11
- package/dist/src/hooks.js +0 -168
- package/dist/src/hooks.js.map +0 -1
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/
|
|
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
|
package/dist/bin/gh-axi.js
CHANGED
package/dist/bin/gh-axi.js.map
CHANGED
|
@@ -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,
|
|
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
|
|
2
|
-
export declare function main(
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
repoFlag = args[
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
82
|
+
return { repoFlag, strippedArgs: stripped };
|
|
136
83
|
}
|
|
137
84
|
//# sourceMappingURL=cli.js.map
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAoB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,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,C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QAAQ,EAAE,CAAC;gBACzB,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5B,CAAC;YAED,KAAK,EAAE,CAAC;YACR,SAAS;QACX,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,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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<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>;
|