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

@zhengke0110/cli

v3.1.3

Published

CLI 主程序包,提供命令行入口和命令定义。

Downloads

19

Readme

@zhengke0110/cli

CLI 主程序包,提供命令行入口和命令定义。

命令概览

| 命令 | 描述 | 功能 | | ------------- | -------------- | ------------------------------ | | init [name] | 项目初始化 | 从内置模板或 GitHub 创建新项目 | | git:init | Git 仓库初始化 | 创建远程仓库并初始化本地 Git | | git:commit | Git 提交 | 提交代码到开发分支 | | git:publish | Git 发布 | 发布版本到主分支 |

init - 项目初始化

创建一个新的项目,支持位置参数、交互式输入和多种模板源。

zhengke-cli init [name] [选项]

参数:

  • name - 项目名称(可选,支持位置参数)

选项:

  • -n, --name <name> - 项目名称(向后兼容)
  • -t, --template <template> - 指定内置模板名称
  • -g, --github - 使用 GitHub 模板搜索

使用方式:

# 推荐用法:位置参数
zhengke-cli init my-app

# 交互式输入
zhengke-cli init
? 请输入项目名称: my-app

# 向后兼容
zhengke-cli init --name my-app

# 指定内置模板
zhengke-cli init my-app --template react-ts

# 从 GitHub 搜索模板
zhengke-cli init my-app --github

Git 工作流

git:init - 仓库初始化

初始化 Git 仓库,创建远程仓库并配置本地 Git。

zhengke-cli git:init [选项]

选项:

  • -p, --platform <platform> - Git 平台(github/gitee)
  • -t, --token <token> - Git Token
  • -r, --repo <repo> - 仓库名称
  • -o, --owner <owner> - 仓库所有者
  • --type <type> - 仓库类型(user/org)
  • --private - 创建私有仓库

git:commit - 代码提交

提交代码到开发分支,专注于代码管理,不涉及版本号。

zhengke-cli git:commit [选项]

选项:

  • -m, --message <message> - 提交信息

特点:

  • 自动创建并切换到 develop 分支
  • 支持多次提交到同一开发分支
  • 不涉及版本号管理,专注代码提交

git:publish - 版本发布

发布版本到主分支,此时确定版本号。

zhengke-cli git:publish [选项]

选项:

  • --type <type> - 版本类型(major/minor/patch)

特点:

  • 合并 develop 分支到 main 分支
  • 根据 --type 参数确定版本号
  • 创建 Git 标签并推送
  • 自动清理开发分支

完整工作流示例

# 1. 初始化项目
zhengke-cli init my-project

# 2. 初始化 Git 仓库
zhengke-cli git:init

# 3. 开发阶段(可多次提交)
zhengke-cli git:commit -m "feat: add feature A"
zhengke-cli git:commit -m "fix: fix bug in feature A"
zhengke-cli git:commit -m "docs: update documentation"

# 4. 发布版本
zhengke-cli git:publish --type patch

调试模式

添加 --debug 参数启用详细日志:

zhengke-cli init --name test --debug

系统要求

  • Node.js: >= 16.0.0
  • Git: >= 2.0.0(Git 相关功能)

开发

# 构建
nx build cli

# 测试
nx test cli

# 本地运行
node dist/packages/cli/src/index.js init --name test