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

@yodaos-pkg/aix-cli

v0.13.0

Published

Command-line tool for packing, validating, and inspecting AIX artifacts (AI eXecutable packages for AI agents)

Readme

@yodaos-pkg/aix-cli

English

用于打包、查看、安装和预览 AIX(AI eXecutable)Agent 包的命令行工具。

目录

安装

npm install -g @yodaos-pkg/aix-cli

包管理命令

aix pack <INPUT_DIR>

将目录打包为 .aix,校验 JSON,将支持的文本转换为 UTF-8,生成 UUID v4 格式的 VERSION,并写入 META-INF/aix/manifest.json。

打包时创建或复用 <项目>/.aix/agent-id,将规范化后的 ID 写入 Manifest 的 agent_id 字段。重新打包会更新 VERSION,但保持 Agent 身份不变;本地 .aix/ 目录不进入归档。跨源码检出或 CI 构建保持身份时,需要共享同一份 .aix/agent-id。 删除该文件后,下次打包或目录命令会生成新身份。

aix pack ./my-agent
aix pack ./my-agent -o my-app.aix
aix pack ./my-agent --engine '^0.14.0'
aix pack ./my-agent --log-time

JS/TS 默认压缩且不修改源文件。--optimize 额外优化 JSON、PNG 和 JPEG:

aix pack ./my-agent --optimize
aix pack ./my-agent -O --opt-level 3

未传 --engine 时依次使用 app.json.engine 和 *。.aixignore 使用 .gitignore 语法;--log-time 为打包日志添加时间。

aix check <INPUT_DIR>

执行静态检查且不生成归档。检查 app.json、Page 与 Widget 入口、本地组件、JS/TS 语法、Page schema.data 的 JSON Schema,以及权限需求明确的 API 调用。存在 error 时退出码为 1,warning 不影响退出码。--format json 输出结构化诊断。动态权限使用及宿主组件可能仍需人工确认。

aix check ./my-agent
aix check ./my-agent --format json

文本模式在 stderr 展示检查阶段,终端中显示动态进度。加载命令模块之前即显示启动状态,后续阶段在同一进度行覆盖它。最终清单逐项保留 JSON/文本、App/Page/Widget/组件结构、JS/TS 语法、权限及 Page JSON Schema 五项检查的结果,并显示实际检查数量和诊断数量。每项分别标明通过、警告、失败或跳过;无适用输入或被无效输入阻断的检查会注明跳过原因。检查在 Worker 中运行,因此 源码分析期间进度仍会刷新。JSON 模式不输出进度,stdout 保持为结构化诊断。

JS/TS 语法检查覆盖 .ts、.mts、.cts 和 Ink <script lang="ts"> 块,并保留原始文件行列。暂不进行 TypeScript 语义检查、导入解析或编译选项校验,不加载类型环境,也不执行或编译项目代码。

完整检查引擎与 Web SDK 共用,CLI 负责读取目录和格式化诊断;SDK 支持 onProgress 回调及逐项检查结果,检查引擎本身不访问文件系统或网络。

Page Schema 按 $schema 指定的草案校验,默认使用 2020-12,覆盖嵌套关键字、正则表达式和本地引用。缺少或为 null 的 schema.data 仍被接受。不会下载外部引用,无法解析的引用会报错。这项检查针对声明,不校验运行时数据。无效 Schema 使用诊断编号 AIX047。

aix show <INPUT>

无需 ADB,打印最终 Agent Definition JSON。show 与 install 使用同一个解析器。

aix show ./my-agent
aix show ./bundle.aix --compact
aix show ./my-agent -o ./agent.json

aix list <AIX_FILE>

列出归档条目和大小,aix ls 是别名。

aix list bundle.aix
aix ls bundle.aix

aix optimize <AIX_FILE>

优化已有包中的 JSON、PNG 和 JPEG:

aix optimize input.aix -o output.aix --level 2

设备命令

所有设备命令均支持 -s, --serial <serial>。单台在线授权设备自动选择;多台设备显示交互选择器;非交互环境必须传 --serial。

当前阶段会显示 spinner。中间阶段完成后收敛为一行 ✔,只有最新结果保留详细信息。

aix device [ACTION]

aix device
aix device set-dev
aix device unset-dev

只读形式显示 Developer Mode、Widget 就绪状态和布局,以及已安装的 .aix Agents。切换 Developer Mode 会重载所有 Widget,动态 Widget 需要重新启动。

aix install <INPUT>

打包项目或使用已有 .aix,然后通过 ADB 提交到 AIUI DEVELOP。

aix install ./my-agent
aix install ./bundle.aix
aix install ./my-agent --definition ./agent.json --serial <serial>

目录复用 .aix/agent-id,归档优先使用 Manifest 的 agent_id,仅旧包缺少身份字段时回退到 VERSION。项目打包后,两种输入会解析为相同的 develop.rokid.agent.<id>;optimize 也会保留该身份。agent.json 可覆盖生成的元数据,但不能覆盖 agentId。命令校验 Apply 和手机上传结果;手机确认不代表云端完成索引。

aix uninstall <INPUT>

按项目目录、.aix 文件或 Agent ID 删除单个 DEVELOP Agent:

aix uninstall ./my-agent
aix uninstall ./bundle.aix
aix uninstall develop.rokid.mobility.ride --serial <serial>

设备必须确认本地清理完成且派发已接受。命令不验证云端删除,也不保证关闭已打开的页面。

aix launch-page <INPUT> [PATH]

打开已安装 Agent 的页面,输入可以是项目目录或 .aix 文件:

aix launch-page ./my-agent
aix launch-page ./bundle.aix
aix launch-page ./my-agent pages/index/index

单文件调试前,连接已通过 ADB 授权的设备,并执行 aix device set-dev 开启 AIUI 开发者模式,然后运行:

aix launch-page ./counter.ink
aix launch-page ./counter.ink --card --params '{"count":7}'
aix launch-page ./counter.ink --params-file ./params.json --serial DEVICE_SERIAL

默认全屏显示,--card 改为卡片。使用 --params <JSON> 或 --params-file <FILE> 传入初始参数,参数必须是 JSON 对象;使用 --serial <SERIAL> 选择设备。

.ink 文件需要非空、采用 UTF-8 编码且不超过 128 KiB,包含唯一的 <page> 块。<style> 和 <script setup> 可选,lang="ts" 支持 TypeScript。单文件输入不能追加 [PATH],不支持 Widget。

修改文件后,重新执行同一命令即可查看变化。页面会重新启动,内存状态也会重置。

aix launch-widget <INPUT> <PATH>

aix launch-widget ./my-agent widgets/order/index
aix launch-widget ./my-agent widgets/order/index --position 2

尺寸来自 app.json.widgets[].family。兼容的 placements 会保留;位置冲突时替换相交的可叠加 Widget;没有空间时清理旧的可叠加 placements。常驻 Widget 永远不会被自动删除。

必要时执行 prepare -> push widget-config.json -> widget-apply -> open。运行时 placement 丢失时会重新提交布局并重试一次 Open。

aix widget-layout [show]

aix widget-layout
aix widget-layout show
aix widget-layout --clear
aix widget-layout --clear --yes

Show 只读。Clear 保留网格、清空两个模块数组,并在未传 --yes 时要求确认。

预览命令

aix preview <INPUT>

使用 @yodaos-pkg/ink 预览归档或源码目录:

aix preview bundle.aix
aix preview ./my-agent
aix preview bundle.aix --launch
aix preview bundle.aix --launch --launch-target current

默认启动本地服务器并打印 URL。blank 视口为 480x352,current 为 448x150。

导出静态 HTML,不启动服务器:

aix preview bundle.aix --html-out ./artifacts/preview.html

--html-out 不能与 --launch 同时使用。实时 WebSocket 重载使用:

aix preview ./my-agent --dev
aix preview ./my-agent --dev --launch

aix runtime

aix runtime versions
aix runtime current
aix runtime select
  • versions:列出稳定版本和当前选择;
  • current:只打印解析后的版本;
  • select:交互选择并保存到 ~/.aix/runtime.json。

通过 AIX_NPM_REGISTRY=npm(默认)或 AIX_NPM_REGISTRY=npmmirror 选择 registry。

开发

npm install
npm run build
node dist/cli.js --help

构建会将 Rust 引擎编译为 Node.js WASM,再打包 TypeScript CLI。打包、优化和读取逻辑与 Rust/Web 表面共享。

许可证

MIT