dependency-updater

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Dependency Updater

依赖项更新工具

Smart dependency management for any language with automatic detection and safe updates.

适用于任意语言的智能依赖管理工具,支持自动检测与安全更新。

Quick Start

快速开始

update my dependencies
The skill auto-detects your project type and handles the rest.

update my dependencies
该工具会自动检测你的项目类型并处理后续操作。

Triggers

触发指令

TriggerExample
Update dependencies"update dependencies", "update deps"
Check outdated"check for outdated packages"
Fix dependency issues"fix my dependency problems"
Security audit"audit dependencies for vulnerabilities"
Diagnose deps"diagnose dependency issues"

触发指令示例
更新依赖项"update dependencies", "update deps"
检查过期依赖"check for outdated packages"
修复依赖问题"fix my dependency problems"
安全审计"audit dependencies for vulnerabilities"
诊断依赖项"diagnose dependency issues"

Supported Languages

支持的语言

LanguagePackage FileUpdate ToolAudit Tool
Node.jspackage.json
taze
npm audit
Pythonrequirements.txt, pyproject.toml
pip-review
safety
,
pip-audit
Gogo.mod
go get -u
govulncheck
RustCargo.toml
cargo update
cargo audit
RubyGemfile
bundle update
bundle audit
Javapom.xml, build.gradle
mvn versions:*
mvn dependency:*
.NET*.csproj
dotnet outdated
dotnet list package --vulnerable

语言包文件更新工具审计工具
Node.jspackage.json
taze
npm audit
Pythonrequirements.txt, pyproject.toml
pip-review
safety
,
pip-audit
Gogo.mod
go get -u
govulncheck
RustCargo.toml
cargo update
cargo audit
RubyGemfile
bundle update
bundle audit
Javapom.xml, build.gradle
mvn versions:*
mvn dependency:*
.NET*.csproj
dotnet outdated
dotnet list package --vulnerable

Quick Reference

快速参考

Update TypeVersion ChangeAction
FixedNo
^
or
~
Skip (intentionally pinned)
PATCH
x.y.z
x.y.Z
Auto-apply
MINOR
x.y.z
x.Y.0
Auto-apply
MAJOR
x.y.z
X.0.0
Prompt user individually

更新类型版本变更操作
固定版本
^
~
符号
跳过(为有意固定的版本)
PATCH 版本
x.y.z
x.y.Z
自动应用
MINOR 版本
x.y.z
x.Y.0
自动应用
MAJOR 版本
x.y.z
X.0.0
逐个询问用户

Workflow

工作流程

User Request
┌─────────────────────────────────────────────────────┐
│ Step 1: DETECT PROJECT TYPE                         │
│ • Scan for package files (package.json, go.mod...) │
│ • Identify package manager                          │
├─────────────────────────────────────────────────────┤
│ Step 2: CHECK PREREQUISITES                         │
│ • Verify required tools are installed               │
│ • Suggest installation if missing                   │
├─────────────────────────────────────────────────────┤
│ Step 3: SCAN FOR UPDATES                            │
│ • Run language-specific outdated check              │
│ • Categorize: MAJOR / MINOR / PATCH / Fixed         │
├─────────────────────────────────────────────────────┤
│ Step 4: AUTO-APPLY SAFE UPDATES                     │
│ • Apply MINOR and PATCH automatically               │
│ • Report what was updated                           │
├─────────────────────────────────────────────────────┤
│ Step 5: PROMPT FOR MAJOR UPDATES                    │
│ • AskUserQuestion for each MAJOR update             │
│ • Show current → new version                        │
├─────────────────────────────────────────────────────┤
│ Step 6: APPLY APPROVED MAJORS                       │
│ • Update only approved packages                     │
├─────────────────────────────────────────────────────┤
│ Step 7: FINALIZE                                    │
│ • Run install command                               │
│ • Run security audit                                │
└─────────────────────────────────────────────────────┘

用户请求
┌─────────────────────────────────────────────────────┐
│ 步骤1:检测项目类型                         │
│ • 扫描包文件(package.json、go.mod等) │
│ • 识别包管理器                          │
├─────────────────────────────────────────────────────┤
│ 步骤2:检查前置条件                         │
│ • 验证所需工具已安装               │
│ • 若缺失则建议安装                   │
├─────────────────────────────────────────────────────┤
│ 步骤3:扫描更新                            │
│ • 运行对应语言的过期依赖检查              │
│ • 分类:MAJOR / MINOR / PATCH / 固定版本         │
├─────────────────────────────────────────────────────┤
│ 步骤4:自动应用安全更新                     │
│ • 自动应用MINOR和PATCH版本更新               │
│ • 报告已更新的内容                           │
├─────────────────────────────────────────────────────┤
│ 步骤5:询问大版本更新                    │
│ • 针对每个MAJOR版本更新询问用户             │
│ • 显示当前版本 → 新版本                        │
├─────────────────────────────────────────────────────┤
│ 步骤6:应用已批准的大版本更新                       │
│ • 仅更新已获批准的包                     │
├─────────────────────────────────────────────────────┤
│ 步骤7:完成                                    │
│ • 运行安装命令                               │
│ • 执行安全审计                                │
└─────────────────────────────────────────────────────┘

Commands by Language

各语言对应的命令

Node.js (npm/yarn/pnpm)

Node.js (npm/yarn/pnpm)

bash
undefined
bash
undefined

Check prerequisites

检查前置条件

scripts/check-tool.sh taze "npm install -g taze"
scripts/check-tool.sh taze "npm install -g taze"

Scan for updates

扫描更新

taze
taze

Apply minor/patch

应用minor/patch版本更新

taze minor --write
taze minor --write

Apply specific majors

应用指定的大版本更新

taze major --write --include pkg1,pkg2
taze major --write --include pkg1,pkg2

Monorepo support

单仓库支持

taze -r # recursive
taze -r # 递归扫描

Security

安全检查

npm audit npm audit fix
undefined
npm audit npm audit fix
undefined

Python

Python

bash
undefined
bash
undefined

Check outdated

检查过期依赖

pip list --outdated
pip list --outdated

Update all (careful!)

更新所有依赖(谨慎操作!)

pip-review --auto
pip-review --auto

Update specific

更新指定依赖

pip install --upgrade package-name
pip install --upgrade package-name

Security

安全检查

pip-audit safety check
undefined
pip-audit safety check
undefined

Go

Go

bash
undefined
bash
undefined

Check outdated

检查过期依赖

go list -m -u all
go list -m -u all

Update all

更新所有依赖

go get -u ./...
go get -u ./...

Tidy up

整理依赖

go mod tidy
go mod tidy

Security

安全检查

govulncheck ./...
undefined
govulncheck ./...
undefined

Rust

Rust

bash
undefined
bash
undefined

Check outdated

检查过期依赖

cargo outdated
cargo outdated

Update within semver

在语义化版本范围内更新

cargo update
cargo update

Security

安全检查

cargo audit
undefined
cargo audit
undefined

Ruby

Ruby

bash
undefined
bash
undefined

Check outdated

检查过期依赖

bundle outdated
bundle outdated

Update all

更新所有依赖

bundle update
bundle update

Update specific

更新指定依赖

bundle update --conservative gem-name
bundle update --conservative gem-name

Security

安全检查

bundle audit
undefined
bundle audit
undefined

Java (Maven)

Java (Maven)

bash
undefined
bash
undefined

Check outdated

检查过期依赖

mvn versions:display-dependency-updates
mvn versions:display-dependency-updates

Update to latest

更新至最新版本

mvn versions:use-latest-releases
mvn versions:use-latest-releases

Security

安全检查

mvn dependency:tree mvn dependency-check:check
undefined
mvn dependency:tree mvn dependency-check:check
undefined

.NET

.NET

bash
undefined
bash
undefined

Check outdated

检查过期依赖

dotnet list package --outdated
dotnet list package --outdated

Update specific

更新指定依赖

dotnet add package PackageName
dotnet add package PackageName

Security

安全检查

dotnet list package --vulnerable

---
dotnet list package --vulnerable

---

Diagnosis Mode

诊断模式

When dependencies are broken, run diagnosis:
当依赖项出现问题时,运行诊断功能:

Common Issues & Fixes

常见问题与修复方案

IssueSymptomsFix
Version Conflict"Cannot resolve dependency tree"Clean install, use overrides/resolutions
Peer Dependency"Peer dependency not satisfied"Install required peer version
Security Vuln
npm audit
shows issues
npm audit fix
or manual update
Unused DepsBloated bundleRun
depcheck
(Node) or equivalent
Duplicate DepsMultiple versions installedRun
npm dedupe
or equivalent
问题症状修复方案
版本冲突"Cannot resolve dependency tree"清理后重新安装,使用覆盖/解析配置
对等依赖缺失"Peer dependency not satisfied"安装所需的对等依赖版本
安全漏洞
npm audit
显示问题
执行
npm audit fix
或手动更新
未使用的依赖包体积臃肿运行
depcheck
(Node.js)或对应工具
重复依赖安装了多个版本执行
npm dedupe
或对应工具

Emergency Fixes

紧急修复命令

bash
undefined
bash
undefined

Node.js - Nuclear reset

Node.js - 彻底重置

rm -rf node_modules package-lock.json npm cache clean --force npm install
rm -rf node_modules package-lock.json npm cache clean --force npm install

Python - Clean virtualenv

Python - 清理虚拟环境

rm -rf venv python -m venv venv source venv/bin/activate pip install -r requirements.txt
rm -rf venv python -m venv venv source venv/bin/activate pip install -r requirements.txt

Go - Reset modules

Go - 重置模块

rm go.sum go mod tidy

---
rm go.sum go mod tidy

---

Security Audit

安全审计

Run security checks for any project:
bash
undefined
为任意项目运行安全检查:
bash
undefined

Node.js

Node.js

npm audit npm audit --json | jq '.metadata.vulnerabilities'
npm audit npm audit --json | jq '.metadata.vulnerabilities'

Python

Python

pip-audit safety check
pip-audit safety check

Go

Go

govulncheck ./...
govulncheck ./...

Rust

Rust

cargo audit
cargo audit

Ruby

Ruby

bundle audit
bundle audit

.NET

.NET

dotnet list package --vulnerable
undefined
dotnet list package --vulnerable
undefined

Severity Response

漏洞严重程度应对策略

SeverityAction
CriticalFix immediately
HighFix within 24h
ModerateFix within 1 week
LowFix in next release

严重程度操作
Critical(严重)立即修复
High(高)24小时内修复
Moderate(中)1周内修复
Low(低)在下一版本中修复

Anti-Patterns

反模式(需避免)

AvoidWhyInstead
Update fixed versionsIntentionally pinnedSkip them
Auto-apply MAJORBreaking changesPrompt user
Batch MAJOR promptsLoses contextPrompt individually
Skip lock fileIrreproducible buildsAlways commit lock files
Ignore security alertsVulnerabilitiesAddress by severity

需避免的操作原因替代方案
更新固定版本这些版本是有意固定的跳过此类版本
自动应用MAJOR版本更新可能包含破坏性变更询问用户
批量询问MAJOR版本更新丢失上下文信息逐个询问
跳过锁文件提交导致构建无法复现始终提交锁文件
忽略安全警报存在漏洞风险根据严重程度处理

Verification Checklist

验证清单

After updates:
  • Updates scanned without errors
  • MINOR/PATCH auto-applied
  • MAJOR updates prompted individually
  • Fixed versions untouched
  • Lock file updated
  • Install command ran
  • Security audit passed (or issues noted)

<details> <summary><strong>Deep Dive: Project Detection</strong></summary>
The skill auto-detects project type by scanning for package files:
File FoundLanguagePackage Manager
package.json
Node.jsnpm/yarn/pnpm
requirements.txt
Pythonpip
pyproject.toml
Pythonpip/poetry
Pipfile
Pythonpipenv
go.mod
Gogo modules
Cargo.toml
Rustcargo
Gemfile
Rubybundler
pom.xml
JavaMaven
build.gradle
Java/KotlinGradle
*.csproj
.NETdotnet
Detection order matters for monorepos:
  1. Check current directory first
  2. Then check for workspace/monorepo patterns
  3. Offer to run recursively if applicable
</details> <details> <summary><strong>Deep Dive: Node.js with taze</strong></summary>
更新完成后:
  • 更新扫描无错误
  • MINOR/PATCH版本已自动应用
  • MAJOR版本更新已逐个询问用户
  • 固定版本未被修改
  • 锁文件已更新
  • 已运行安装命令
  • 安全审计通过(或已记录问题)

<details> <summary><strong>深度解析:项目检测机制</strong></summary>
该工具通过扫描包文件自动检测项目类型:
检测到的文件语言包管理器
package.json
Node.jsnpm/yarn/pnpm
requirements.txt
Pythonpip
pyproject.toml
Pythonpip/poetry
Pipfile
Pythonpipenv
go.mod
Gogo modules
Cargo.toml
Rustcargo
Gemfile
Rubybundler
pom.xml
JavaMaven
build.gradle
Java/KotlinGradle
*.csproj
.NETdotnet
单仓库检测顺序:
  1. 首先检查当前目录
  2. 然后检查工作区/单仓库模式
  3. 若适用,提供递归扫描选项
</details> <details> <summary><strong>深度解析:Node.js 与 taze</strong></summary>

Prerequisites

前置条件

bash
undefined
bash
undefined

Install taze globally (recommended)

全局安装taze(推荐)

npm install -g taze
npm install -g taze

Or use npx

或使用npx

npx taze
undefined
npx taze
undefined

Smart Update Flow

智能更新流程

bash
undefined
bash
undefined

1. Scan all updates

1. 扫描所有更新

taze
taze

2. Apply safe updates (minor + patch)

2. 应用安全更新(minor + patch版本)

taze minor --write
taze minor --write

3. For each major, prompt user:

3. 针对每个大版本更新,询问用户:

"Update @types/node from ^20.0.0 to ^22.0.0?"

"Update @types/node from ^20.0.0 to ^22.0.0?"

If yes, add to approved list

若用户同意,添加至批准列表

4. Apply approved majors

4. 应用已批准的大版本更新

taze major --write --include approved-pkg1,approved-pkg2
taze major --write --include approved-pkg1,approved-pkg2

5. Install

5. 安装依赖

npm install # or pnpm install / yarn
undefined
npm install # 或 pnpm install / yarn
undefined

Auto-Approve List

自动批准列表

Some packages have frequent major bumps but are backward-compatible:
PackageReason
lucide-react
Icon library, majors are additive
@types/*
Type definitions, usually safe
</details> <details> <summary><strong>Deep Dive: Version Strategies</strong></summary>
部分包的大版本更新频繁但保持向后兼容:
原因
lucide-react
图标库,大版本更新仅添加新内容
@types/*
类型定义,通常安全
</details> <details> <summary><strong>深度解析:版本策略</strong></summary>

Semantic Versioning

语义化版本控制

MAJOR.MINOR.PATCH (e.g., 2.3.1)

MAJOR: Breaking changes - requires code changes
MINOR: New features - backward compatible
PATCH: Bug fixes - backward compatible
MAJOR.MINOR.PATCH(示例:2.3.1)

MAJOR:破坏性变更 - 需要修改代码
MINOR:新增功能 - 向后兼容
PATCH:修复Bug - 向后兼容

Range Specifiers

版本范围指定符

SpecifierMeaningExample
^1.2.3
Minor + Patch OK
>=1.2.3 <2.0.0
~1.2.3
Patch only
>=1.2.3 <1.3.0
1.2.3
Exact (fixed)Only
1.2.3
>=1.2.3
At leastAny
>=1.2.3
*
AnyLatest (dangerous)
指定符含义示例
^1.2.3
允许Minor和Patch更新
>=1.2.3 <2.0.0
~1.2.3
仅允许Patch更新
>=1.2.3 <1.3.0
1.2.3
精确版本(固定)
1.2.3
>=1.2.3
至少该版本所有
>=1.2.3
的版本
*
任意版本最新版本(危险)

Recommended Strategy

推荐策略

json
{
  "dependencies": {
    "critical-lib": "1.2.3",      // Exact for critical
    "stable-lib": "~1.2.3",       // Patch only for stable
    "modern-lib": "^1.2.3"        // Minor OK for active
  }
}
</details> <details> <summary><strong>Deep Dive: Conflict Resolution</strong></summary>
json
{
  "dependencies": {
    "critical-lib": "1.2.3",      // 关键库使用精确版本
    "stable-lib": "~1.2.3",       // 稳定库仅允许Patch更新
    "modern-lib": "^1.2.3"        // 活跃库允许Minor更新
  }
}
</details> <details> <summary><strong>深度解析:冲突解决</strong></summary>

Node.js Conflicts

Node.js 依赖冲突

Diagnosis:
bash
npm ls package-name      # See dependency tree
npm explain package-name # Why installed
yarn why package-name    # Yarn equivalent
Resolution with overrides:
json
// package.json
{
  "overrides": {
    "lodash": "^4.18.0"
  }
}
Resolution with resolutions (Yarn):
json
{
  "resolutions": {
    "lodash": "^4.18.0"
  }
}
诊断命令:
bash
npm ls package-name      // 查看依赖树
npm explain package-name // 查看安装原因
yarn why package-name    // Yarn 对应命令
使用覆盖配置解决:
json
// package.json
{
  "overrides": {
    "lodash": "^4.18.0"
  }
}
使用解析配置解决(Yarn):
json
{
  "resolutions": {
    "lodash": "^4.18.0"
  }
}

Python Conflicts

Python 依赖冲突

Diagnosis:
bash
pip check
pipdeptree -p package-name
Resolution:
bash
undefined
诊断命令:
bash
pip check
pipdeptree -p package-name
解决方法:
bash
// 使用虚拟环境
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

// 或使用约束文件
pip install -c constraints.txt -r requirements.txt
</details>

Use virtual environment

脚本参考

python -m venv venv source venv/bin/activate pip install -r requirements.txt
脚本用途
scripts/check-tool.sh
验证工具是否已安装
scripts/run-taze.sh
使用正确参数运行taze

Or use constraints

相关工具

pip install -c constraints.txt -r requirements.txt

</details>

---
工具语言用途
tazeNode.js智能依赖更新工具
npm-check-updatesNode.jstaze的替代工具
pip-reviewPython交互式pip更新工具
cargo-editRustCargo依赖管理工具
bundler-auditRuby安全审计工具

Script Reference

ScriptPurpose
scripts/check-tool.sh
Verify tool is installed
scripts/run-taze.sh
Run taze with proper flags

Related Tools

ToolLanguagePurpose
tazeNode.jsSmart dependency updates
npm-check-updatesNode.jsAlternative to taze
pip-reviewPythonInteractive pip updates
cargo-editRustCargo dependency management
bundler-auditRubySecurity auditing