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

@dylan-dong/ezent-cli

v2.0.4

Published

Ezent platform CLI for human developers and AI agents. No disk persistence — credentials come from CLI flags or env vars only.

Downloads

930

Readme

@dylan-dong/ezent-cli

Ezent 平台 CLI 工具和 AI Skill 套件,供 AI Agent 和开发者管理平台资源、生成页面、构建服务编排。

Skill 插件安装

本仓库同时是一个 Claude Code / OpenCode 插件,包含三个 skill:

| Skill | 功能 | |-------|------| | ezent:cli | 平台资源 CLI 操作 | | ezent:page-builder | 页面生成(React + Ant Design) | | ezent:orchestration-builder | 服务编排 JSON 生成与部署 |

Claude Code

/plugin marketplace add bamboomoon/ezent-cli
/plugin install ezent@ezent-marketplace

OpenCode

{
  "plugin": ["ezent@git+https://github.com/bamboomoon/ezent-cli.git"]
}

更多安装方式(GitLab、本地、开发模式等)详见 插件安装指南

CLI 安装

# 全局安装
npm install -g @dylan-dong/ezent-cli

# 或免安装执行
npx @dylan-dong/ezent-cli <command>

快速开始

1. 凭证配置

CLI 不再把凭证写入磁盘。凭证来源只有两个(优先级从高到低):

  1. 命令行参数(当次命令临时生效)
  2. 环境变量(持久生效,推荐)

方式一:临时(单次命令)

ezent --token "<your-token>" --enterprise-id "<id>" user me

方式二:持久(推荐)

加到 ~/.zshrc / ~/.bashrc

export EZENT_TOKEN="<your-token>"
export EZENT_ENTERPRISE_ID="<your-enterprise-id>"
export EZENT_APP_ID="<your-app-id>"

重开 shell 或 source ~/.zshrc,之后所有 ezent 命令自动带上这些凭证。

按项目切换(direnv

# 项目根目录
cat > .envrc <<'EOF'
export EZENT_TOKEN="project-specific-token"
export EZENT_ENTERPRISE_ID="42"
export EZENT_APP_ID="1158"
EOF
direnv allow

进入目录自动加载,离开自动卸载,不同项目互不干扰。

2. 验证

ezent whoami                   # 查看当前生效的凭证来源
ezent user me                  # 调用 API 验证

3. 使用

ezent dict list
ezent entity datasources
ezent app list

凭证来源 & 优先级

| 来源 | 对应 CLI 参数 | 对应环境变量 | 优先级 | |---|---|---|---| | 命令行参数 | --token | — | 🥇 最高 | | 环境变量 | — | EZENT_TOKEN | 🥈 | | 命令行参数 | --enterprise-id | — | 🥇 | | 环境变量 | — | EZENT_ENTERPRISE_ID | 🥈 | | 命令行参数 | --app-id | — | 🥇 | | 环境变量 | — | EZENT_APP_ID | 🥈 | | 命令行参数 | --env | — | 🥇 | | 环境变量 | — | EZENT_ENV | 🥈 | | 环境变量 | — | EZENT_BASE_URL | 覆盖构建时默认 |

ezent whoami 会打印当前每一项的值和来源(token 只显示长度,不泄露明文),便于排查"我到底用的哪个 token"。

$ ezent whoami
token         set (128 chars)  [EZENT_TOKEN env]
enterpriseId  42               [EZENT_ENTERPRISE_ID env]
appId         1158             [--app-id flag]
env           DEV              [build-time default]
baseUrl       https://ezent.cc [build-time default]

AI Agent / 多租户场景

因为凭证只从 env / flag 读,每次 /invoke 请求启动的子进程天然隔离

  • 请求 A 的子进程:EZENT_TOKEN=tokenA + EZENT_ENTERPRISE_ID=1
  • 请求 B 的子进程:EZENT_TOKEN=tokenB + EZENT_ENTERPRISE_ID=2

两个进程的 process.env 是内核保证的独立内存快照,token 不会串。不需要维护两个包、也没有"AI 悄悄 ezent config set 把 token 落盘"的风险 —— 磁盘持久化已经整条删掉。

命令列表

全局命令

| 命令 | 说明 | |---|---| | ezent whoami | 查看当前生效的凭证来源(flag / env / default) | | ezent user me | 获取当前用户信息 |

应用命令(需要 appId)

| 命令 | 说明 | |---|---| | ezent app list | 搜索应用 | | ezent app get <appId> | 获取应用详情 | | ezent dict list | 查询字典列表 | | ezent dict get <id> | 查询字典详情 | | ezent dict group list | 查询字典分组 | | ezent dict item list | 查询字典项 | | ezent dict item tree | 查询字典项树 | | ezent entity datasources | 获取数据源列表 | | ezent entity list | 获取实体模型列表 | | ezent entity columns <modelId> | 获取字段定义 | | ezent entity query | 查询实体数据 | | ezent entity insert | 插入实体数据 | | ezent entity update | 更新实体数据 | | ezent entity delete | 删除实体数据 | | ezent env list | 获取环境变量列表 | | ezent env create | 创建环境变量 | | ezent env update | 更新环境变量 | | ezent env delete | 删除环境变量 | | ezent i18n lang list | 获取已配置语言 | | ezent i18n lang support | 获取支持的语言 | | ezent i18n corpus list | 查询语料列表 | | ezent i18n corpus create | 创建语料 | | ezent orch list | 获取编排列表 | | ezent orch update <chainId> | 更新编排标题/分组/是否对外开放 | | ezent orch execute | 执行编排 | | ezent export-data list | 获取导出模板列表 | | ezent export-data create | 创建导出任务 | | ezent image categories | 获取图片分类 | | ezent image list | 获取图片列表 | | ezent print list | 获取打印模板列表 | | ezent print detail <key> | 获取打印模板详情 | | ezent workflow list | 获取工作流列表 | | ezent workflow detail | 获取工作流详情 | | ezent workflow start | 发起审批 |

每个命令均支持 --help 查看详细参数。

写操作安全门禁(0.2.0+)

所有写操作必须显式带 --yes(或短名 -y)才能执行;不带会以 exit code 2 退出并打印错误。这是给 AI Agent 和自动化脚本的兜底门禁——Skill 必须先向用户口头确认后再加 --yes 重新调用

写操作涵盖:创建 / 修改 / 删除 / 发布 / 覆盖更新 / 触发导出 / 执行已发布编排(orch execute)/ 发起审批(workflow start)。

不受影响:所有只读命令(list / get / view / detail / me / whoami 等)、orch debug(调试高频动作)。

# ✅ 允许
ezent dict delete --id 123 --yes
ezent orch release --chain-id abc --title xxx --start-node '{...}' -y

# ❌ 拒绝(exit 2)
ezent dict delete --id 123
# Error: "dict delete" is a write operation and requires --yes to execute.

1.0.0 起移除了 autoYes 持久化开关。原因:磁盘持久化已整体删除,CLI 不再落盘任何状态。日常频繁写操作请在 shell 里 alias ezent='ezent --yes',或 CI 脚本里每条显式带 --yes。这比持久化全局开关更透明、也不会影响其他 shell 会话。

环境与构建

npm run build          # 默认 DEV
npm run build:dev      # http://192.168.0.42:18100
npm run build:test     # http://192.168.0.42:18000
npm run build:prod     # https://ezent.cc

baseUrl 在构建时注入为默认值。运行时覆盖用 EZENT_BASE_URL 环境变量(见"凭证来源 & 优先级")。

环境访问规则

| 环境 | 访问范围 | |---|---| | DEV | 所有接口 | | TEST / PROD | 仅白名单内的接口 |

非白名单接口在 TEST/PROD 环境下会被 CLI 拦截,不会发送请求。

开发

# 安装依赖
npm install

# 开发模式(直接运行 TS)
npx tsx src/index.ts <command>

# 构建
npm run build

# 本地全局链接
npm link
ezent <command>

项目结构

├── .claude-plugin/             # Claude Code 插件元数据
├── .opencode/                  # OpenCode 插件支持
├── src/                        # CLI 源码
│   ├── index.ts                # 入口
│   ├── client.ts               # HTTP 客户端
│   ├── config.ts               # 配置管理
│   ├── output.ts               # 输出格式化
│   └── commands/               # 命令实现
├── skills/                     # AI Skill 定义
│   ├── cli/                    # 平台资源 CLI skill
│   ├── page-builder/           # 页面生成 skill
│   └── orchestration-builder/  # 服务编排 skill
├── docs/
│   ├── installation.md         # 插件安装指南
│   └── skill-embedding-guide.md # Skill 嵌入使用指南