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

@eyaeya/xgg-cli

v0.1.4

Published

Command-line tool for operating Xiaomi Gateway Geek Edition automations

Readme

@eyaeya/xgg-cli

小米中枢网关极客版命令行工具。安装后提供 xgg 命令,可登录网关、读取设备/规则/变量、编辑自动化规则图、管理变量与备份,并读取规则运行日志。

安装

npm install -g @eyaeya/xgg-cli
xgg --version
xgg --help

要求 Node.js 20.11 或更高版本。@eyaeya/xgg-cli 会自动安装匹配版本的 @eyaeya/xgg-core,不需要单独安装 core 包。

GitHub 仓库:eyaeya/xiaomi-central-hub-gateway-cli

快速使用

xgg login --code <6位登录码> --base-url http://<gateway-ip>:8086
xgg status
xgg device list --pretty
xgg rule list --pretty
xgg variable list --pretty

6 位登录码来自米家 App 的中枢网关设备页(若中枢网关是路由器或家庭屏自带的,则在对应设备内的中枢网关功能页面获取)。登录码短时有效且通常只能用一次;认证失效或退出码 3 时,请获取新码后重新 xgg login

AI Agent

Agent 使用时建议设置快照目录:

export XGG_AGENT_MODE=1
export XGG_SNAPSHOTS_DIR="$PWD/snapshots"

完整 Agent 操作说明随 CLI 包一起发布,路径为:

$(npm root -g)/@eyaeya/xgg-cli/skills/xgg-rule-authoring/SKILL.md

同一份文档也可在 GitHub 仓库中的 skills/xgg-rule-authoring/SKILL.md 查看。也可以用 skills CLI 一键安装该 Skill:

npx skills add eyaeya/xiaomi-central-hub-gateway-cli

常用流程

xgg device spec <did>
xgg rule new --name "<自动化名称>"
xgg rule node add --rule-id <rule-id> --type <type> ...
xgg rule edge add --rule-id <rule-id> --from <node:pin> --to <node:pin>
xgg rule layout <rule-id>
xgg rule validate --rule-id <rule-id>
xgg rule enable <rule-id>
xgg rule logs <rule-id> --tail 20

默认 stdout 输出 JSON,适合脚本和 Agent 解析;加 --pretty 输出人读表格。

注意

CLI 写入后,已打开的网关网页需要手动刷新才能看到新规则或变量。npm 包不包含 GitHub 仓库里的官方前端参考 bundle、fixtures、开发计划或本地探测材料。