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

@mingto/mt-cli

v6.2.27

Published

明途脚手架工具

Readme

@mingto/mt-cli

明途脚手架工具 - 提供项目初始化、版本发布、依赖更新和 hosts 管理等功能的命令行工具。

安装

使用 pnpm 进行全局安装:

pnpm install -g @mingto/mt-cli

使用

全局安装后使用

安装完成后,您可以在命令行中使用 mt-cli 命令:

mt-cli --help

使用 npx(推荐)

无需全局安装,直接使用 npx 运行:

# 查看帮助
npx @mingto/mt-cli --help

# 创建新项目
npx @mingto/mt-cli init my-project

# 发布版本
npx @mingto/mt-cli up

# 管理 hosts 文件
npx @mingto/mt-cli hosts

调试模式

所有命令支持 --debug-D 选项,启用后会输出详细的调试日志:

mt-cli up --debug
mt-cli up -D
mt-cli init --debug
mt-cli update --debug

可用命令

项目初始化 (init)

创建新项目,支持多种模板选择。

# 创建新项目(交互式)
mt-cli init [project-name]

# 指定模板创建
mt-cli init my-project --template nuxt3

# 启用调试模式
mt-cli init my-project --debug

可用选项:

  • -t, --template [template] - 指定模板名称
  • -f, --force - 如果目录已存在,强制覆盖
  • -D, --debug - 输出详细日志

支持的模板:

  • nuxt3 - Nuxt3 模板
  • custom-ability - 自定义能力模板
  • h5-vue3 - H5 Vue3 模板
  • pc-vue3 - PC Vue3 模板

版本发布 (up)

自动化版本发布流程,包括构建、测试和发布到 npm。

mt-cli up

# 启用调试模式
mt-cli up --debug

可用选项:

  • -d, --debug - 输出详细日志

发布流程:

  1. 切换 npm 镜像到 tencent
  2. 清空 node_modulesdist 目录
  3. 安装依赖 (pnpm i)
  4. 构建项目 (npm run build)
  5. 切换 npm 镜像到 npm
  6. 选择版本更新类型(Patch/Minor/Major/Custom)
  7. 更新 package.json 版本号
  8. 发布到 npm

依赖更新 (update)

自动检测并更新项目中的 @mingto 相关依赖包到最新版本。

# 交互式检查更新
mt-cli update

# 跳过确认直接更新
mt-cli update --yes

# 启用调试模式
mt-cli update --debug

可用选项:

  • -y, --yes - 跳过确认,直接更新所有包
  • -D, --debug - 输出详细日志

功能特性:

  • 自动识别 package.json 中的 @mingto 依赖
  • 对比当前版本与 npm 最新版本
  • 批量更新依赖包
  • 支持的包列表:
    • @mingto/aws-obs-server - AWS OBS 服务
    • @mingto/huawei-obs-server - 华为 OBS 服务
    • @mingto/huoshan-tts - 火山引擎 TTS
    • @mingto/microsoft-lat - 微软 LAT
    • @mingto/microsoft-tts - 微软 TTS
    • @mingto/minio-obs-server - MinIO OBS 服务
    • @mingto/mt-sse - SSE 请求工具
    • @mingto/mt-ui - UI 组件库
    • @mingto/obs-server - OBS 服务
    • @mingto/text-stream-slicer - 文本流切片
    • @mingto/tools - 工具集
    • @mingto/type-writer - 打字机效果
    • @mingto/version-polling - 版本轮询
    • @mingto/xunfei-lat - 讯飞 LAT
    • @mingto/xunfei-tts - 讯飞 TTS

版本号升级 (upgraded)

专门用于更新 public/manifest.json 中的版本号,并可选提交到 Git。

# 更新 manifest.json 版本号
mt-cli upgraded

# 更新版本号但不进行 Git 操作
mt-cli upgraded --no-git

# 启用调试模式
mt-cli upgraded --debug

可用选项:

  • --no-git - 跳过 Git 提交和推送操作
  • -D, --debug - 输出详细日志

功能流程:

  1. 读取 public/manifest.json
  2. 选择版本更新类型(Patch/Minor/Major/Custom)
  3. 更新 manifest.json 文件
  4. (可选) 自动执行 git add, git commit, git push

Hosts 文件管理 (hosts)

管理 Windows/Mac 系统的 hosts 文件,支持多环境域名配置。

# 交互式配置 hosts
mt-cli hosts

# 命令行指定配置
mt-cli hosts --domain myapp --env development

# 启用调试模式
mt-cli hosts --debug

可用选项:

  • -d, --domain [domain] - 指定空间域名(4-20位字母、数字或连字符)
  • -e, --env [env] - 指定运行环境
  • -D, --debug - 输出详细日志

支持的环境:

| 环境 | IP 地址 | 端口 | Base 路径 | |------|---------|------|-----------| | localhost | 127.0.0.1 | 3000 | / | | development | 172.168.80.30 | 80 | /chat/ |

示例:

# 配置本地开发环境
mt-cli hosts -d myapp -e localhost
# 效果:127.0.0.1 mt01.cn 和 127.0.0.1 myapp.mt01.cn
# 访问:http://mt01.cn:3000/ 或 http://myapp.mt01.cn:3000/

# 配置测试环境
mt-cli hosts -d myapp -e development
# 效果:172.168.80.30 mt01.cn 和 172.168.80.30 myapp.mt01.cn
# 访问:http://myapp.mt01.cn:80/chat/

本地资源处理 (local)

扫描项目中的本地图片引用,自动上传至 OBS 并替换源码路径。

注意:该命令依赖项目根目录下的 local.config.json 配置文件。

mt-cli local

# 启用调试模式
mt-cli local --debug

可用选项:

  • -D, --debug - 输出详细日志

功能特性:

  • 自动扫描 .vue, .ts, .tsx, .js, .jsx, .html 等文件中的图片引用
  • 支持匹配 src="", url(), from "" 等引用格式
  • 支持 @/ 路径别名解析
  • 一键上传图片至 OBS 并去重
  • 自动替换源码中的引用路径为远程 URL
  • 支持文件名冲突自动重命名(添加时间戳)
  • 可选删除本地原始文件

支持的图片格式:

.jpg, .png, .jpeg, .gif, .webp, .svg

配置文件 (local.config.json) 示例:

{
  "paths": {
    "@/*": ["./src/*"]
  },
  "include": ["./src/**/*.{vue,ts,tsx,js,jsx,html}"],
  "exclude": [],
  "renameSameFile": true,
  "deleteOriginal": false,
  "uploadDir": "web_image"
}

配置说明:

  • paths - 路径别名映射,用于解析 @/ 等别名
  • include - 需要扫描的文件模式
  • exclude - 需要排除的文件模式
  • renameSameFile - 遇到文件名冲突时自动重命名(添加时间戳)
  • deleteOriginal - 上传成功后删除本地原始文件
  • uploadDir - 上传目标目录(web_image, wechat_image, app_image, szr_head, szr_video)

文件上传 (upload)

将本地文件快速上传至指定的远程存储目录。

# 交互式上传
mt-cli upload

# 命令行指定参数上传
mt-cli upload --dir web_image --file "C:\path\to\image.png"

# 启用调试模式
mt-cli upload --debug

可用选项:

  • -d, --dir <dir> - 目标目录标识
  • -f, --file <file> - 本地文件的绝对路径
  • -D, --debug - 输出详细日志

支持的目录:

| 目录标识 | 说明 | |---------|------| | web_image | 数字人 web 图片 | | wechat_image | 数字人微信图片 | | app_image | 数字人 app 图片 | | szr_head | 数字人头像 | | szr_video | 数字人视频 |

支持的文件格式:

.jpg, .png, .jpeg, .gif, .webp, .mp4

示例:

# 上传图片
mt-cli upload --dir web_image --file "C:\Users\admin\image.png"

# 上传视频
mt-cli upload --dir szr_video --file "C:\Users\admin\video.mp4"

许可证

MIT