agc-cli

module
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT

README

agc-cli agc-cli

AppGallery Connect 命令中心 — 在终端管理你的华为应用。

CI Go Platform Release License Sponsor

简体中文 · English · 官网

用 Go 编写的 AppGallery Connect CLI:查询应用、构建发布请求、调用测试、商品和报表 API,在终端或 CI 中完成操作。默认输出结构化 JSON,供脚本和 AI Agent 使用。

快速开始

需要应用 ID 和 Service Account JSON,可在 AppGallery Connect 管理应用和凭据。macOS 可使用 Homebrew;已安装 Node.js 18+ 的 Windows、macOS、Linux CI 也可使用 NPM:

brew tap createitv/tap && brew install agc-cli
# 跨平台 CI:npm install --global @createitv/agc-cli

agc auth login --service-account-file ~/.agc/service-account.json --name production
agc auth whoami
agc init --app-id YOUR_APP_ID --default-profile production

# 预览查询;添加 --dry-run=false 才会发送请求
agc publishing app-info-query --invoke --query appId=YOUR_APP_ID --query lang=zh-CN

多账号、Windows/Linux 安装和 CI 环境变量见使用指南。从源码构建见贡献指南。项目初始化自动选择凭据 profile,应用参数仍需显式填写;接口需要 client_id 时用 --header client_id=YOUR_CLIENT_ID 提供。

为 AI Agent 设计

接口定义带有 affordances 命令模板与 _links REST 链接,Agent 可以发现下一步操作,无需记住完整命令树。例如 agc publishing app-info-query --pretty 的输出节选:

{
  "data": {
    "id": "app-info-query",
    "method": "GET",
    "path": "/api/publish/v2/app-info",
    "affordances": {
      "show": "agc publishing app-info-query --pretty",
      "invoke": "agc publishing app-info-query --invoke"
    }
  }
}

默认 JSON;人工浏览可加 --output table 或 --output markdown。agc web-server 提供本地 REST API。命令模板需要补齐参数,当前不会根据远程业务状态判断能否提交。详见 Agent 与 REST 使用说明。

仓库还提供可供 Codex、Claude Code 等 Agent 安装的任务型 Agent Skills,涵盖通用使用、鉴权、发布、邀请测试、报表和 CI/CD。

功能覆盖

领域 可以做什么
应用与发布 查询和更新应用资料、软件包信息、多语言描述,构建提交审核和发布时间请求 → 发布流程
上传 发现上传地址、分片和确认上传接口;完整二进制/multipart 上传尚需外部工具 → 上传说明
测试 调用测试版本、测试用户、群组、邀请码和反馈接口 → agc testing
商品与订阅 调用商品、价格、促销和多语言展示接口 → agc pms
签名与设备 调用鸿蒙证书、Provisioning Profile、设备、ACL 和指纹接口 → agc provisioning
评论与报表 查询评分与评论、管理回复、请求报表和保存原始响应 → agc comments / agc reports
项目与域名 查询团队、项目、SDK 配置,调用元服务域名配置接口 → agc projects / agc domains
游戏与资源包 查看游戏回调协议和资源包预下载接口 → agc gameplay / agc game-items / agc resources
REST 与 Web 浏览接口注册表,预览和调用本地 REST,导出 OpenAPI → 本地使用

注册表包含 13 个 API 家族、159 个条目,支持通用请求构建与调用;各接口的字段、权限和前置条件以其 sourceUrl 华为文档为准。上传编排和本地 Hvigor 构建执行器尚未完成。

所有文档见文档索引。所有命令与参数用 agc --help、agc <家族> <接口> --help 查看;agc endpoints --pretty 列出接口定义和官方参考链接。

更多

赞助

如果 agc-cli 为你的开发或自动化工作节省了时间,可以通过 GitHub Sponsors 支持项目的持续维护、跨平台测试和文档更新。

许可证

MIT。

Cloud development management

The CLI exposes 102 cloud-development operations, including reviewed management contracts. See management usage and limitations. Huawei live write validation remains pending.

Directories

Path Synopsis
cmd
agc command
internal
managementtest
Package managementtest contains independent source-based fixtures for offline CLI and REST transport assertions.
Package managementtest contains independent source-based fixtures for offline CLI and REST transport assertions.
pkg
cloudfunctions
Package cloudfunctions implements the native Go workflows from the Huawei AGCLI source.
Package cloudfunctions implements the native Go workflows from the Huawei AGCLI source.
hvigor
Package hvigor executes local HarmonyOS builds without shell interpolation.
Package hvigor executes local HarmonyOS builds without shell interpolation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL