AppGallery Connect, mapped for the terminal

Move every release through one red line.

A Go command center for discovering, dry-running, and invoking AppGallery Connect APIs—with stable JSON for people, CI, and coding agents.

21 API families286 registered interfaces3 output formats
agc / productionreference mode
agcTerminalJSONAgentScript
One command surface. Your workflow.
AUTHPS256 / OAuth
PROFILEproject-bound
PACKAGEupload + status
RELEASEinvoke by choice

$ agc auth check --pretty

{
  "data": {
    "name": "production",
    "mode": "service-account",
    "active": true
  },
  "affordances": {
    "next": "agc publishing endpoints"
  }
}

project profile resolved · dry-run on

Dry-run firstNothing is sent until you opt in.
Agent-readableJSON envelopes include next actions.
One surfaceCLI, local REST, and web share a registry.

Install agc CLI

Use the package manager for your system.

Use NPM for one unattended command across Windows, macOS, and Linux CI. Native Homebrew and Scoop packages remain available for developer workstations.

Windows · macOS · Linux CI
$ npm install --global @createitv/agc-cli && agc version
macOS Homebrew command
$ brew tap createitv/tap && brew install agc-cli && agc version
Windows Scoop command
PS> if (!(Get-Command scoop -ErrorAction SilentlyContinue)) { Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force; irm get.scoop.sh | iex }; scoop bucket add createitv https://github.com/Createitv/scoop-bucket; scoop install agc-cli; agc version
NPM: Node.js 18+ No postinstall download Five checksum-verified platform binaries

Agent Skills

Give your coding agent a map of AppGallery Connect.

Six portable Skills follow the task-oriented asc-cli pattern. Install all of them, choose one workflow, inspect the source, or contribute improvements through GitHub.

Contribute a Skill
Install all six for Codex$ agc skills install --agent codex --global
agc-cli-usage

General command discovery, dry-run review, authorized execution, and remote verification.

agc skills install --name agc-cli-usage --agent codex --global
agc-auth

Credential profiles, whoami, OAuth team lookup, and authorization diagnosis.

agc skills install --name agc-auth --agent codex --global
agc-publishing

Metadata, packages, review submission, staged rollout, and release-state verification.

agc skills install --name agc-publishing --agent codex --global
agc-testing

Test versions, groups, testers, invitation links, feedback, and promotion.

agc skills install --name agc-testing --agent codex --global
agc-reports

Distribution, install, revenue, retention, and HarmonyOS service report exports.

agc skills install --name agc-reports --agent codex --global
agc-cicd

Pinned cross-platform installation, protected credentials, dry-run gates, and CI verification.

agc skills install --name agc-cicd --agent codex --global

The release rail

Context flows forward. Secrets do not.

Each stage owns one job. Credentials remain local, project context remains portable, and destructive API calls require an explicit switch.

01

AUTH

PS256 / OAuth

02

PROFILE

project-bound

03

PACKAGE

upload + status

04

RELEASE

invoke by choice

Automatic profile binding

Choose once per project. Override only when you mean it.

Bind production in .agc/project.json. Commands resolve the profile in a predictable order, while --profile staging remains available for one-off work.

  1. 1CLI override--profile staging
  2. 2Project default.agc/project.json
  3. 3Active account~/.agc/credentials.json
.agc/project.json project safe
{
  "appId": "123456789",
  "projectId": "987654321",
  "packageName": "com.example.app",
  "profile": "production"
}
No client keys or private keys are stored here.

Interface registry

Discover the API before writing the request.

Every entry carries its method, path, parameter locations, CLI command, REST route, and dry-run path.

Selected family / storage

Cloud Storage

registered

File upload/download, metadata and listing with server REST.

DISCOVERagc storage endpoints --output table
STATUSagc storage status --pretty
LOCAL REST/api/v1/storage
6 typed interface entries

All endpoints 6

Expand an endpoint for registered parameters and commands. Consult its reference for full schemas, responses, and permissions.

PUT上传文件upload-file/{bucket_name}/{object_name}

此接口用于上传文件。

Developer-to-Huawei API

Registered parameters
ParameterLocationRequiredTypeDescription
object_namepathYesstringStorage instance or object path; percent-encoded exactly once.
bucket_namepathYesstringStorage instance or object path; percent-encoded exactly once.
client_idheaderNostring客户端ID,获取方法参考创建API客户端。
productIdheaderYesstring项目ID,查询方法可参见查询项目ID。
AuthorizationheaderNostring认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。
X-Agc-File-SizeheaderNostring文件大小,断点续传时为必选。
X-Agc-File-OffsetheaderNostring文件偏移量,断点续传的起始位置非零时为必选。
X-Agc-Sha256headerNostring文件的SHA256值,断点续传时为必选。
X-Agc-Content-TypeheaderNostring文件类型。 默认值:application/octet-stream
X-Agc-Content-DispositionheaderNostring文件打开方式。
X-Agc-Content-EncodingheaderNostringHTTP标准头部Content-Encoding。
X-Agc-Cache-ControlheaderNostringHTTP标准头部Cache-Control。
X-Agc-Content-LanguageheaderNostringHTTP标准头部Content-Language。
X-Agc-meta-*headerNostring可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头部出现。 X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。例如,您传入的是“X-Agc-meta-test: test metadata”,保存的数据实例为“test: test metadata”。 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。
X-Agc-Trace-IdheaderNostring单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。
filefileYesstring—

Request body: file

Inspect definition

agc storage upload-file --pretty

Local REST definition

/api/v1/storage/endpoints/upload-file

Dry run (supply required parameters first)

agc storage upload-file --invoke --dry-run=true --body body.json
Read endpoint reference ↗
GET下载文件download-file/{bucket_name}/{object_name}

此接口用于使用用户身份认证方式下载文件。

Developer-to-Huawei API

Registered parameters
ParameterLocationRequiredTypeDescription
object_namepathYesstringStorage instance or object path; percent-encoded exactly once.
bucket_namepathYesstringStorage instance or object path; percent-encoded exactly once.
AuthorizationheaderNostring认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。
client_idheaderNostring客户端ID,获取方法参考创建API客户端。
productIdheaderYesstring项目ID,查询方法可参见查询项目ID。
RangeheaderNostringHTTP标准协议头,用于指定第一个字节和最后一个字节的位置,告诉服务器想获取的文件范围。如未指定,则获取整个文件。 例如一个文件有900个字节,其范围为0-899,则: Range: bytes=500- 表示读取该文件的500-899字节。 Range: bytes=500-699 表示读取该文件的500-699字节。
If-Modified-SinceheaderNostring一个条件式请求首部。 服务器只在所请求的资源在给定的时间之后对内容进行过修改的情况下才会将资源返回,状态码为200 。如果请求的资源在给定的时间之后未经修改,则返回一个不带消息主体的304响应。 格式:<day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT 举例:Mon, 10 Apr 2023 07:28:00 GMT 说明 If-Modified-Since只可以用在GET或HEAD请求中。当与If-None-Match 一同出现时,If-Modified-Since会被忽略,除非服务器不支持If-None-Match。
If-None-MatchheaderNostring一个条件式请求首部。 对于GET和HEAD方法,当且仅当服务器上没有任何资源的ETag属性值与这个首部中列出的相匹配时,服务器端会才返回所请求的资源,响应码为200 ,否则返回304。其他方法暂不实现。 格式:If-None-Match: "<etag_value>" 不支持通配符*,不支持弱比较算法。
X-Agc-Trace-IdheaderNostring单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。

Inspect definition

agc storage download-file --pretty

Local REST definition

/api/v1/storage/endpoints/download-file

Dry run (supply required parameters first)

agc storage download-file --invoke --dry-run=true
Read endpoint reference ↗
DELETE删除文件delete-file/{bucket_name}/{object_name}

此接口用于删除文件。

Developer-to-Huawei API

Registered parameters
ParameterLocationRequiredTypeDescription
object_namepathYesstringStorage instance or object path; percent-encoded exactly once.
bucket_namepathYesstringStorage instance or object path; percent-encoded exactly once.
AuthorizationheaderNostring认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。
client_idheaderNostring客户端ID,获取方法参考创建API客户端。
productIdheaderYesstring项目ID,查询方法可参见查询项目ID。
X-Agc-Trace-IdheaderNostring单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。

Inspect definition

agc storage delete-file --pretty

Local REST definition

/api/v1/storage/endpoints/delete-file

Dry run (supply required parameters first)

agc storage delete-file --invoke --dry-run=true
Read endpoint reference ↗
GET获取文件元数据get-metadata/{bucket_name}/{object_name}?metadata=query

此接口用于获取文件元数据。

Developer-to-Huawei API

Registered parameters
ParameterLocationRequiredTypeDescription
object_namepathYesstringStorage instance or object path; percent-encoded exactly once.
bucket_namepathYesstringStorage instance or object path; percent-encoded exactly once.
AuthorizationheaderNostring认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。
client_idheaderNostring客户端ID,获取方法参考创建API客户端。
productIdheaderYesstring项目ID,查询方法可参见查询项目ID。
X-Agc-Trace-IdheaderNostring单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。

Inspect definition

agc storage get-metadata --pretty

Local REST definition

/api/v1/storage/endpoints/get-metadata

Dry run (supply required parameters first)

agc storage get-metadata --invoke --dry-run=true
Read endpoint reference ↗
GET修改文件元数据update-metadata/{bucket_name}/{object_name}?metadata=update

此接口用于修改文件元数据。

Developer-to-Huawei API

Registered parameters
ParameterLocationRequiredTypeDescription
object_namepathYesstringStorage instance or object path; percent-encoded exactly once.
bucket_namepathYesstringStorage instance or object path; percent-encoded exactly once.
AuthorizationheaderNostring认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。
client_idheaderNostring客户端ID,获取方法参考创建API客户端。
productIdheaderYesstring项目ID,查询方法可参见查询项目ID。
X-Agc-Trace-IdheaderNostring单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。
X-Agc-Content-TypeheaderNostring文件类型。 默认值:application/octet-stream
X-Agc-Content-DispositionheaderNostring文件打开方式。
X-Agc-Content-EncodingheaderNostringHTTP标准头部Content-Encoding。
X-Agc-Cache-ControlheaderNostringHTTP标准头部Cache-Control。
X-Agc-Content-LanguageheaderNostringHTTP标准头部Content-Language。
X-Agc-meta-*headerNostring可以在请求中加入以“X-Agc-meta-”开头的消息头,用于加入自定义的元数据,以便对文件进行自定义管理。当用户获取此文件或查询此文件元数据时,加入的自定义元数据将会在返回消息的头中出现。 示例:X-Agc-meta-test: test metadata 保存实例为:test: test metadata 说明 元数据名称相同则覆盖。自定义的部署不区分大小写,最后记录均为小写的方式。X-Agc-meta-仅标记此header是传递元数据,并非元数据key的一部分。 目录对象不支持自定义元数据,所以此接口不支持目录对象。

Inspect definition

agc storage update-metadata --pretty

Local REST definition

/api/v1/storage/endpoints/update-metadata

Dry run (supply required parameters first)

agc storage update-metadata --invoke --dry-run=true
Read endpoint reference ↗
GET列举文件list-files/{bucket_name}

此接口用于列举文件。

Developer-to-Huawei API

Registered parameters
ParameterLocationRequiredTypeDescription
bucket_namepathYesstringStorage instance or object path; percent-encoded exactly once.
client_idheaderNostring客户端ID,获取方法参考创建API客户端。
productIdheaderYesstring项目ID,查询方法可参见查询项目ID。
AuthorizationheaderNostring认证信息,格式为“Authorization: Bearer ${access_token}”。access_token为获取Token中获取的access_token。
X-Agc-Trace-IdheaderNostring单个文件请求的Traceid。可不填或者随机生成,用于日志打印跟踪。
max-keysqueryNostring指定返回文件个数的最大值,默认值为50,取值范围为[1,1000]。 超出范围时,按照默认值进行处理。 如果因为max-keys的设置无法一次完成列举,返回结果会附加NextMarker元素作为下一次列举的marker。
markerqueryNostring指定返回哪个标识符之后的文件,按照文件Key的UTF-8字典顺序排序。
prefixqueryNostring列举以指定的字符串prefix开头的文件。
delimiterqueryNostring将文件名按照特定字符分割的分割符。 注意 当前仅支持传空值或正斜杠(/),正斜杠(/)编码后为%2F。 如果指定了prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从prefix到第一个delimiter之间相同的部分会形成一条CommonPrefixes。 如果未携带prefix参数,按delimiter对所有文件名进行分割,多个文件分割后从文件名开始到第一个delimiter之间相同的部分形成一条CommonPrefixes。

Inspect definition

agc storage list-files --pretty

Local REST definition

/api/v1/storage/endpoints/list-files

Dry run (supply required parameters first)

agc storage list-files --invoke --dry-run=true
Read endpoint reference ↗

What is agc-cli, and who is it for?

agc-cli is an open-source Go command-line tool for Huawei AppGallery Connect, maintained by Createitv. Its installed command is agc. It organizes API discovery, credential profiles, request previews, and API invocation into reusable commands for HarmonyOS and Huawei app developers who manage app metadata, testers, products, and reports.

Project and guides: GitHub · Usage guide · Issues

Frequently asked questions

Is agc-cli an official Huawei tool?

No. agc-cli is an independent open-source project maintained by Createitv under the MIT license. It organizes endpoints using Huawei AppGallery Connect API references and is not an official Huawei product or support service.

How do I install agc-cli on macOS, Windows, or Linux?

With Node.js 18+, all three systems can run npm install --global @createitv/agc-cli. Homebrew remains available on macOS and Scoop on Windows. Run agc version to verify installation.

Is agc-cli free, and do I need an account?

agc-cli is free to use and modify under the MIT license. Calling Huawei APIs requires your own AppGallery Connect account, credentials, and permissions. Huawei service pricing and limits remain subject to Huawei terms. Browsing the endpoint reference or inspecting CLI definitions does not require login.

How do I query app information for the first time?

Save credentials with agc auth login --service-account-file ~/.agc/service-account.json --name production, then bind the project with agc init --app-id YOUR_APP_ID --default-profile production. Preview with agc publishing app-info-query --invoke --query appId=YOUR_APP_ID --query lang=en-US. Add --dry-run=false after checking the request. Supply a client_id header explicitly when required.

Are all 156 endpoints production-verified?

No. The registry contains 156 entries across 13 API families; this is registry coverage, not production verification of every endpoint. Registered parameters and command surfaces are shown here. Consult each endpoint reference for full request and response schemas, permissions, and business prerequisites.

Does the default dry run change my app?

No. Endpoint commands with --invoke preview the request without sending it by default. Real invocation requires --dry-run=false. Check the target app, credential profile, and parameters before executing.

Can I use agc-cli with scripts or AI agents?

Yes. JSON output supports script processing. agc capabilities and agc endpoints expose discovery; agc web-server provides local REST routes, and agc openapi exports the contract. Command templates support navigation but do not replace business-state checks or review decisions.

How do I install the agc-cli Skills for Codex or Claude?

Install agc-cli, then run agc skills list to browse the six task-oriented Skills. Run agc skills install --agent codex --global for all Skills, or add --name agc-publishing for only the publishing Skill. Individual SKILL.md files are also downloadable from the website.

Does a project profile fill all endpoint parameters automatically?

A project configuration can select its default credential profile, with --profile for explicit overrides. App IDs, languages, headers, and request bodies still need to be supplied according to each endpoint. Keep Service Account private keys and credential files out of Git.

Browse the complete API reference by family

Content updated:

Quick start

Three commands to a bound, inspectable workspace.

Use placeholders for your AppGallery Connect values. The second command is what makes the profile automatic for this project.

01

Save a credential profile

Service Account is the preferred route. Secrets stay in ~/.agc/credentials.json with restricted permissions.

$ agc auth login --service-account-file ~/.agc/service-account.json --name production
02

Bind it to the project

Save project metadata and choose a default credential profile. Supply endpoint parameters explicitly when invoking APIs.

$ agc init --app-id <app-id> --project-id <project-id> --package-name com.example.app --default-profile production
03

Inspect before invoking

Endpoint commands are dry-run first. Review the exact method and URL, then opt into the real request.

$ agc publishing app-info-query --invoke --query appId=<app-id> --dry-run=false

Local command center

The browser is a window into the same registry.

Start the local REST server when you want live capability data. Without it, this site stays useful as a complete reference surface.

agc web-server --addr :8421
GET/api/v1/capabilitiesfamilies + affordances
GET/api/v1/endpointsall interface entries
GET/api/v1/openapi.jsonmachine-readable contract
POST/api/v1/:family/endpoints/:id/invokedry-run by default