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

o2-cli

v0.0.21

Published

O2 前端开发命令行工具

Readme

O2-Cli

o2-cli 是 O2 前端组开发的命令行工具,可以减少许多重复工作量

安装

# (不推荐)使用 npx 的方式调用, 由于 npx 有缺陷, 推荐使用 pnpx
pnpx o2-cli [指令]

# (推荐)全局安装
yarn global add o2-cli
o2-cli [指令]

常用指令

page

使用 o2-cli page 指令,可以创建一个页面(可自选模板),缩写 o2-cli pg

  • 中台:第一步是选择子包和模板,而后根据选择的模板,会有不同的后续处理流程
    • 使用预设模板:预设模板用于快速搭建页面框架,模板没有指定字段的功能,如果想在生成代码时指定页面上的字段,请使用后文的“根据 JSON 生成”功能
    • 根据 JSON 生成:输入 JSON 文件路径即可
    • 使用 AI 生成:输入文档文件路径即可,目前只能解析 markdown 之类纯文本文件
  • 商城:与中台端操作基本一致,只是模板较少,且没有根据 JSON 生成、AI 生成等功能

支持中台、商城端

package

使用 o2-cli package 指令,可以创建一个子包,缩写 o2-cli pkg

输入指令后将启动一个创建子包的向导,根据提示填入对应信息即可

支持中台、商城端

permission

使用 o2-cli permission 指令,可以扫描并生成按钮权限,缩写 o2-cli perm

输入指令后将启动一个扫描向导,根据提示选择扫描模式即可

如果不想启动扫描向导(如想要将此功能嵌入 CI/CD)请添加如下参数

  • -a 表示启用脚本模式(不启动向导直接进入扫描流程)
  • -p [逗号分隔字符串] 表示想要扫描的子包(不填默认扫描所有子包)
  • -f 扫描并改造生成 H0 可以识别的文件(0.0.7 版本默认开启不支持关闭)
  • -F 扫描并生成 H0 可以识别的打平路由文件(0.0.7 版本默认开启不支持关闭)
  • 计划添加 -c 扫描并导出权限到一个 CSV 文件
  • 计划添加 -r 扫描并导出错误报告到一个 CSV 文件
  • 计划添加 -A (优先级低)路径别名解析, 逗号分隔字符串, 默认值 @/:src/

仅支持中台端

ls

使用 o2-cli ls 指令列出当前工程里有哪些子包

支持中台、商城端