gh-axi

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

gh-axi

gh-axi

Agent ergonomic wrapper around Github CLI. Prefer this over
gh
and other methods for Github operations.
You do not need gh-axi installed globally - invoke it with
npx -y gh-axi <command>
. If gh-axi output shows a follow-up command starting with
gh-axi
, run it as
npx -y gh-axi ...
instead.
gh-axi requires the
gh
CLI installed and authenticated (
gh auth login
). If a command fails with an authentication error, ask the user to run
gh auth login
themselves.
围绕GitHub CLI打造的符合Agent使用习惯的封装工具。在进行GitHub操作时,优先选择gh-axi而非
gh
或其他方法。
你无需全局安装gh-axi——使用
npx -y gh-axi <command>
即可调用它。如果gh-axi的输出显示后续命令以
gh-axi
开头,请改用
npx -y gh-axi ...
来运行。
gh-axi要求已安装并认证
gh
CLI(执行
gh auth login
完成认证)。如果命令因认证错误失败,请让用户自行运行
gh auth login

When to use

使用场景

Use gh-axi whenever a task touches GitHub: listing, filing, or editing issues; viewing, creating, reviewing, or merging pull requests; inspecting workflow runs and CI failures; triggering, enabling, or disabling workflows; managing releases, repositories, or labels; searching issues, PRs, repos, commits, or code; or calling the GitHub API directly.
只要任务涉及GitHub,就可以使用gh-axi:列出、提交或编辑议题;查看、创建、审核或合并拉取请求;检查工作流运行和CI失败情况;触发、启用或禁用工作流;管理发布版本、仓库或标签;搜索议题、PR、仓库、提交记录或代码;或是直接调用GitHub API。

Workflow

使用流程

  1. Run
    npx -y gh-axi
    with no arguments for a dashboard of the current repo - open issues, open PRs, and suggested next commands.
  2. Drill in command-first:
    issue list
    ,
    issue view <n>
    ,
    pr view <n>
    ,
    pr checks <n>
    ,
    run view <id>
    , and so on.
  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.
  4. Trigger (dispatch) a workflow with
    workflow run <name> --ref <ref>
    ;
    run
    manages existing workflow runs.
  5. Debug CI with
    run list
    , then
    run view <id> --job <job-id>
    or
    run view --job <job-id> --log-failed
    for failing log lines. Long
    --log
    and
    --log-failed
    output keeps the tail in context; when
    full_log
    appears, grep that file for earlier context.
  6. Every response ends with contextual next-step hints under
    help:
    - follow them.
  1. 不带参数运行
    npx -y gh-axi
    ,可查看当前仓库的控制面板——包含未处理议题、未处理PR以及建议的后续命令。
  2. 以命令为导向深入操作:
    issue list
    issue view <n>
    pr view <n>
    pr checks <n>
    run view <id>
    等。
  3. 要操作其他仓库,请在命令后添加
    -R owner/name
    -R=owner/name
    --repo owner/name
    --repo=owner/name
    ,例如
    npx -y gh-axi issue list --repo=owner/name
    ——该参数不能放在命令之前。
  4. 使用
    workflow run <name> --ref <ref>
    触发(调度)工作流;
    run
    命令用于管理已有的工作流运行实例。
  5. 使用
    run list
    调试CI,然后通过
    run view <id> --job <job-id>
    run view --job <job-id> --log-failed
    查看失败日志行。
    --log
    --log-failed
    的长输出会保留末尾上下文;当出现
    full_log
    时,可在该文件中搜索更早的上下文内容。
  6. 每个响应的末尾都会在
    help:
    下显示上下文相关的下一步提示,请遵循这些提示操作。

Commands

命令列表

commands[11]:
  (none)=dashboard, issue, pr, run, workflow, release, repo, label, search, api, setup
Installed copies also inherit the SDK built-in
update
command. Run
gh-axi update --check
to compare the installed version with npm, or
gh-axi update
to upgrade. When using
npx -y gh-axi
, npx already resolves the package on demand.
Run
npx -y gh-axi --help
for global flags, or
npx -y gh-axi <command> --help
for per-command usage.
commands[11]:
  (none)=dashboard, issue, pr, run, workflow, release, repo, label, search, api, setup
已安装的版本还会继承SDK内置的
update
命令。 运行
gh-axi update --check
可对比已安装版本与npm上的最新版本,或运行
gh-axi update
进行升级。 使用
npx -y gh-axi
时,npx会自动按需解析包版本。
运行
npx -y gh-axi --help
查看全局参数,或运行
npx -y gh-axi <command> --help
查看对应命令的使用说明。

Tips

使用技巧

  • Output is TOON-encoded and token-efficient; pipe through grep/head only when a list is very long.
  • Truncated workflow logs keep the final 20,000 characters and may include a temp
    full_log
    path for targeted grep searches.
  • Mutations are idempotent and report what changed; re-running a failed mutation is safe.
  • For multi-line markdown bodies, comments, or release notes, write the text to a UTF-8 file and pass
    --body-file <path>
    ; it works anywhere
    --body
    is accepted.
  • Use
    api
    for anything the dedicated commands do not cover, e.g.
    npx -y gh-axi api repos/{owner}/{repo}/topics
    .
  • 输出采用TOON编码,兼顾token效率;仅当列表过长时,才通过grep/head管道处理。
  • 被截断的工作流日志会保留最后20000个字符,可能会包含临时
    full_log
    路径,用于针对性的grep搜索。
  • 变更操作具有幂等性,会报告具体修改内容;重新运行失败的变更操作是安全的。
  • 对于多行markdown格式的内容、评论或发布说明,请将文本写入UTF-8文件,并通过
    --body-file <path>
    传入;所有支持
    --body
    的命令都可使用此方式。
  • 专用命令未覆盖的操作可使用
    api
    命令,例如
    npx -y gh-axi api repos/{owner}/{repo}/topics