npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aios-apps-invoke-cli

v1.0.3

Published

AIOS app invoke CLI client and socket service.

Readme

aios-apps-invoke-cli

aios-apps-invoke-cli 是 AIOS 应用调用入口包。它同时包含:

  • CLI client:servercommand / binding 等一次性命令。
  • 常驻 invoke service:serve 命令启动的本地 socket 服务。

正常调用链路是:

OpenClaw/agent -> aios-apps-invoke-cli client -> app-invoke socket -> aios-apps-invoke-cli serve -> management web / HZG SDK -> 业务系统

CLI client 自身不直接访问业务系统,也不通过 MQTT 发起 app invoke 请求。AIOS Docker 容器中,OpenClaw 仍以默认 agent 身份调用 CLI;serve 由 apps supervisor 以 aios-svc 身份常驻运行,因此实际访问局域网业务系统的是 service 进程。

安装

npm install -g aios-apps-invoke-cli

也可以直接用 npx

npx aios-apps-invoke-cli --help

运行模型

同一个 npm 包里包含 client 和 service,不需要安装两个包。

  • aios-apps-invoke-cli servercommand ...:作为 client 发送业务命令请求。
  • aios-apps-invoke-cli binding ...:作为 client 发送系统绑定请求。
  • aios-apps-invoke-cli serve:启动当前主路径使用的 app invoke socket service。
  • aios-apps-invoke-cli service-status:输出 socket service 的状态结构。
  • aios-apps-invoke-cli status:输出 client 配置视图。

环境变量

Client 命令不读取通讯配置环境变量。它固定连接内部 socket:

/var/aios/run/app-invoke.sock

Socket service 使用:

  • AIOS_WEB_BASE_URL:可选,默认 http://127.0.0.1:3030,用于读取业务系统配置、解析外部 cookie、记录调用日志。
  • AIOS_APP_INVOKE_MAX_PAYLOAD_BYTES:可选,默认 33554432,限制单次 socket 请求 JSON 的最大字节数。

用法

aios-apps-invoke-cli servercommand <应用名> <命令名> POST [jsonBody] -s <SessionId>
aios-apps-invoke-cli servercommand <应用名> <命令名> POST --body-file <json文件> -s <SessionId>
aios-apps-invoke-cli servercommand <应用名> <命令名> GET --query-file <json文件> -s <SessionId>
aios-apps-invoke-cli binding <应用名> <命令名> <请求方法> [jsonBody] -s <SessionId>
aios-apps-invoke-cli binding <应用名> <命令名> <请求方法> --body-file <json文件> -s <SessionId>
aios-apps-invoke-cli serve
aios-apps-invoke-cli service-status
aios-apps-invoke-cli status

参数说明:

  • -s 传入当前 OpenClaw 会话的 SessionId
  • 长参数使用 --sessionId
  • servercommand 的请求方法只支持 GETPOST
  • jsonBody 必须是合法 JSON;大请求体建议使用 --body-file--query-file,避免触发操作系统命令行参数长度限制。
  • POST 使用 jsonBody--body-file--body-stdin 作为请求体来源。
  • GET 使用 jsonBody--query-file--query-stdin 作为查询参数来源,JSON 必须是字符串值对象。
  • 业务系统类型固定为 HZG,不再通过命令行传入 provider。

示例

aios-apps-invoke-cli servercommand demo getUser POST --body-file .\payload.json -s thread-1
aios-apps-invoke-cli binding OASystem GetTableDataWithOffset POST --body-file .\binding-body.json -s thread-2

Binding 支持范围

当前实际可执行的 binding 命令:

  • GetTableDataWithOffset
  • GetComboBindingOptions
  • CalcBindingDataSource

CLI 会把 TableBindingCandidatesBindingDataSourceBinding 等别名规范化为上述命令。GetMetadataGetMetadata2 只作为内部辅助能力存在,service 会拒绝直接调用。

Socket 协议

Client 会向内部固定 socket /var/aios/run/app-invoke.sock 写入一行 JSON 请求,service 返回一行 JSON 响应。

请求体包含:

  • traceId
  • command
  • sessionId
  • parameters
  • timestamp

响应体格式:

{
  "traceId": "string",
  "code": 0,
  "message": "OK",
  "data": {}
}

code !== 0 时,CLI 以非零退出码结束,并把错误信息输出到 stderr。

AIOS Docker 容器

AIOS Docker 容器中 apps supervisor 会以 aios-svc 启动:

aios-apps-invoke-cli serve

OpenClaw/agent 调用 CLI 时仍使用默认 agent 身份。Docker iptables 的内网限制按 agent UID 生效;invoke service 以 aios-svc 访问业务系统,不需要把 agent 的局域网限制放开。