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

@mdframe/forge-create

v0.1.1

Published

Interactive Forge project generator CLI.

Readme

Forge Create CLI

用于交互式生成 Forge 客户工程,并可选择初始化 MySQL 数据库。

本地使用

node src/cli.mjs ./md-psi-system \
  --template-source /Users/yaomindong/Desktop/project/mdframe/forge-project

全局安装

发布到 npm 后,可以像安装 @openai/codex 一样全局安装:

npm install -g @mdframe/forge-create
forge-create --help

也可以直接使用另一个命令别名:

create-forge --help

@mdframe/forge-create 中的 @mdframe 是 npm scope。发布前需要确认当前 npm 账号拥有这个 scope;如果要使用公司或个人 scope,请先修改 package.json 里的 name

交互模式支持方向键操作:

  • 单选: / 移动,Enter 确认。
  • 多选: / 移动,Space 勾选或取消,Enter 确认。
  • 返回上一步:在单选/多选页面按 bEsc;在文本输入页面输入 :back

非交互生成

node src/cli.mjs ./md-psi-system \
  --template-source /Users/yaomindong/Desktop/project/mdframe/forge-project \
  --subsystem minimal-admin \
  --include business-core \
  --project-name md-psi-system \
  --display-name 内蒙古商品进销存管理系统 \
  --base-package con.mdframe \
  --group-id con.mdframe \
  --database-name psi_admin \
  --strip-module-prefix md \
  --force \
  --yes

子系统

CLI 现在按业务子系统选择初始化模块。--subsystem 优先级高于 --preset--preset 可传子系统 ID;未与子系统同名的模板原始 preset 也继续支持。

| 子系统 ID | 说明 | | --- | --- | | minimal-admin | 最小后台:系统管理、代码生成、定时任务模块、消息管理、多租户。 | | ai-data-platform | 企业级 AI 数据分析平台:系统管理、AI 代码生成、定时任务、消息管理、多租户、数据模块、report 模块、AI 模块、forge-plugin-external。 | | ai-lowcode-platform | 企业级 AI 低代码平台:系统管理、AI 代码生成、定时任务、消息管理、多租户、AI 模块。 | | full | 全量系统:保留模板支持的全部后端子模块和前端工程。 |

初始化数据库

生成完成后可以追加 --init-db,CLI 会调用生成工程中的统一脚本:

<project>/<artifact-prefix>-server/scripts/db/init-db.sh

示例:

node src/cli.mjs ./md-psi-system \
  --template-source /Users/yaomindong/Desktop/project/mdframe/forge-project \
  --subsystem minimal-admin \
  --project-name md-psi-system \
  --display-name 内蒙古商品进销存管理系统 \
  --base-package con.mdframe \
  --group-id con.mdframe \
  --database-name psi_admin \
  --strip-module-prefix md \
  --init-db \
  --db-host 127.0.0.1 \
  --db-port 3306 \
  --db-user root \
  --db-password your_password

如需执行按模块收集的 SQL,增加 --with-module

NPX 形态

方式一:直接从 Git 仓库运行

把本仓库推到 Git 后,其他人不需要先 clone,可以直接用 npx --package 从 Git 安装并执行 forge-create

公共仓库示例:

npx --yes \
  --package git+https://github.com/<org>/forge-create-cli.git \
  forge-create --help

指定分支或 tag:

npx --yes \
  --package "git+https://github.com/<org>/forge-create-cli.git#v0.1.0" \
  forge-create --help

私有仓库可以用 SSH 地址,前提是用户本机已经配置好 Git SSH Key:

npx --yes \
  --package git+ssh://[email protected]/<org>/forge-create-cli.git \
  forge-create --help

从 Git 生成项目

CLI 仓库只负责交互和调度,真正的 Forge 模板源需要通过 --template-git--template-source 指定。推荐把 forge-project 模板仓库也推到 Git,然后这样使用:

npx --yes \
  --package git+https://github.com/<org>/forge-create-cli.git \
  forge-create ./md-psi-system \
  --template-git https://github.com/<org>/forge-project.git \
  --template-ref main \
  --subsystem minimal-admin \
  --include business-core \
  --project-name md-psi-system \
  --display-name 内蒙古商品进销存管理系统 \
  --base-package con.mdframe \
  --group-id con.mdframe \
  --database-name psi_admin \
  --strip-module-prefix md

如果使用私有模板仓库:

npx --yes \
  --package git+ssh://[email protected]/<org>/forge-create-cli.git \
  forge-create ./md-psi-system \
  --template-git [email protected]:<org>/forge-project.git \
  --template-ref main

方式二:发布到 npm 后运行

不想全局安装时,可以用 npx 临时运行:

npx @mdframe/forge-create ./md-psi-system

带模板 Git 源:

npx @mdframe/forge-create ./md-psi-system \
  --template-git https://github.com/<org>/forge-project.git \
  --template-ref v1.0.0

发布前检查

npm run check
npm run pack:dry-run

发布到 npm

首次发布 scoped public 包:

npm login --registry=https://registry.npmjs.org/
npm publish --access public --registry=https://registry.npmjs.org/

后续版本发布:

npm version patch
npm publish

发布后验证:

npm install -g @mdframe/forge-create
forge-create --help

最常用的完整生成命令:

forge-create ./md-psi-system \
--template-git https://github.com/<org>/forge-project.git \
--template-ref main \
--subsystem minimal-admin \
--project-name md-psi-system \
--display-name 商品进销存管理系统 \
--base-package con.mdframe \
--group-id con.mdframe \
--database-name psi_admin \
--strip-module-prefix md \
--force \
--yes

如果模板在本地:

forge-create ./md-psi-system \
--template-source /Users/yaomindong/Desktop/project/mdframe/forge-project \
--subsystem minimal-admin \
--project-name md-psi-system \
--display-name 商品进销存管理系统 \
--base-package con.mdframe \
--group-id con.mdframe \
--database-name psi_admin \
--strip-module-prefix md \
--force \
--yes

可选子系统:

--subsystem minimal-admin
--subsystem ai-data-platform
--subsystem ai-lowcode-platform
--subsystem full

带数据库初始化:

forge-create ./md-psi-system \
--template-git https://github.com/<org>/forge-project.git \
--template-ref main \
--subsystem minimal-admin \
--project-name md-psi-system \
--display-name 商品进销存管理系统 \
--base-package con.mdframe \
--group-id con.mdframe \
--database-name psi_admin \
--strip-module-prefix md \
--force \
--yes \
--init-db \
--db-host 127.0.0.1 \
--db-port 3306 \
--db-user root \
--db-password your_password

如果 npx~/.npm 权限问题,可以临时指定 cache:

npm_config_cache=/tmp/forge-create-npm-cache npx --yes \
  --package git+https://github.com/<org>/forge-create-cli.git \
  forge-create --help