mcpField
U
utoo

utoo

github.com/utooland开发1810 次安装39 周前更新
代码仓库

关于 utoo

utoo 是用于 JavaScript 项目的 npm 包管理命令行工具,供前端开发者管理依赖和运行脚本。它还支持查看包信息、执行包命令及交互式选择 monorepo 工作区。

主要功能

  1. 01安装、卸载和更新依赖
  2. 02运行 package.json 脚本
  3. 03交互选择工作区与脚本
  4. 04查看依赖树和包信息
  5. 05执行本地或远程 npm 包命令

适用场景

  1. 01安装项目依赖或添加开发依赖
  2. 02运行构建、测试和开发脚本
  3. 03在 monorepo 中选择工作区运行脚本
  4. 04检查依赖关系或查看包信息

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/utooland/skills --skill utoo

安装后在 Claude Code 中输入/utoo确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

.claude-skill.json
.gitignore
LICENSE
CONTRIBUTING.md
QUICKSTART.md
MULTI-TOOL-SUPPORT.md
reference.md
examples.md
package.json
README.md
install-skill.js
uninstall-skill.js
.github/
WELCOME.md
pull_request_template.md
.github/ISSUE_TEMPLATE/
bug_report.md
feature_request.md
.github/workflows/
release.yml
ci.yml
scripts/
config.json.example
setup.sh

详细介绍

来自项目 README

utoo - 统一前端工具链

utoo 是一个高性能的 npm 包管理工具,提供依赖安装、脚本执行、包信息查看等功能。

别名

  • utoo / ut - 主命令
  • utx - 执行命令别名(等同于 ut x)

命令速查

命令简写说明
utoo installut i安装项目依赖
utoo uninstall <pkg>ut un卸载指定依赖
utoo run <script>ut r / utoo <script>运行 package.json 中的脚本
utoo runut r交互式选择 workspace 和脚本
utoo listut ls列出依赖树
utoo view <pkg>ut v / ut info查看包信息
utoo execute <pkg>ut x / utx执行本地或远程 npm 包命令
utoo linkut ln链接本地包
utoo depsut d仅生成 package-lock.json
utoo updateut u删除 node_modules 并重新安装
utoo cleanut c清理全局包缓存
utoo rebuildut rb重建脚本钩子
utoo configut cfg管理配置

使用指南

运行脚本
# 快捷方式:直接运行 package.json 中的脚本
utoo build
utoo dev
ut test

# 交互式选择(适用于 monorepo)
utoo run
# → 会引导用户选择 workspace 和对应脚本

# 显式运行
utoo run build
ut r dev
安装依赖
# 安装所有依赖
utoo install

# 安装指定包
utoo install lodash

# 安装开发依赖
utoo install -D typescript

# 安装并保存到 package.json
utoo install react --save
查看依赖
# 查看依赖树
utoo list

# 查看指定深度
utoo list --depth=1

# 查看包信息
utoo view react
执行远程包
# 使用 utx 别名(推荐)
utx create-react-app my-app
utx vite

# 或使用完整命令
utoo execute create-react-app my-app
ut x vite

常见任务

  1. 初始化项目: 先检查是否有 package.json,然后运行 utoo install
  2. 添加新依赖: 使用 utoo install <package>
  3. 运行开发服务器: 使用 utoo dev 或 ut dev
  4. 构建项目: 使用 utoo build 或 ut build
  5. 查看依赖关系: 使用 utoo list 分析依赖树
  6. Monorepo 操作: 使用 utoo run 交互式选择 workspace 和脚本

配置管理

# 设置镜像源
utoo config set registry https://registry.npmmirror.com --global

# 查看当前配置
utoo config list

最佳实践

镜像源选择

根据网络环境选择合适的镜像源,使用 --registry 参数指定:

# 使用 npmmirror(国内推荐,速度快)
utoo install --registry https://registry.npmmirror.com
utoo install lodash --registry https://registry.npmmirror.com

# 使用 npm 官方源(国外或需要最新包时)
utoo install --registry https://registry.npmjs.org

# 更新依赖时指定镜像源
utoo update --registry https://registry.npmmirror.com
常用镜像源
镜像源URL适用场景
npmmirrorhttps://registry.npmmirror.com国内用户,速度快
npm 官方https://registry.npmjs.org需要最新包,国外网络
建议
  1. 国内用户: 优先使用 npmmirror 镜像,安装速度更快
  2. 需要最新版本: 如果 npmmirror 同步延迟,可临时切换到官方源
  3. CI/CD 环境: 建议在命令中显式指定 --registry 确保一致性

执行指令

重要:当此 skill 被调用时,你必须立即使用 Bash 工具执行 ut 命令。

执行流程
  1. 直接执行用户请求的 ut 命令
  2. 如果返回 "command not found: ut"、"command not found: utoo" 或 "command not found: utx",执行安装命令:
    curl -fsSL https://utoo.land/install | bash
    
  3. 安装完成后,重新执行用户请求的命令
命令映射
  • ARGUMENTS: test → 执行 ut test
  • ARGUMENTS: install → 执行 ut install
  • ARGUMENTS: install <pkg> → 执行 ut install <pkg>
  • ARGUMENTS: run <script> → 执行 ut run <script>
  • ARGUMENTS: <script> → 执行 ut <script>(快捷方式)

禁止使用 pnpm/npm/yarn 命令,必须使用 ut 命令。

评论

支持 Markdown