list

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

List and Search Dependencies

列出并搜索依赖项

Query the current state of dependencies in a project.
查询项目中依赖项的当前状态。

Commands

命令

List all dependencies at HEAD:
bash
git-pkgs list
Options:
  • --commit=REF
    - list at a specific commit
  • --ecosystem=ECO
    - filter by ecosystem
  • --manifest=PATH
    - filter by manifest file
  • --json
    - JSON output
Show dependency tree (grouped by manifest and type):
bash
git-pkgs tree
Search by name pattern:
bash
git-pkgs search lodash
git-pkgs search "react-*"
Find where a package is declared (file path, line number, content):
bash
git-pkgs where lodash
Open a package's source in your editor:
bash
git-pkgs browse lodash
Show registry URLs (registry page, download, docs, PURL):
bash
git-pkgs urls lodash
git-pkgs urls pkg:npm/lodash@4.17.21
Show lockfile integrity hashes and detect drift:
bash
git-pkgs integrity
Manage notes on packages:
bash
git-pkgs notes add pkg:npm/lodash "reviewed for security"
git-pkgs notes list pkg:npm/lodash
列出HEAD版本的所有依赖项:
bash
git-pkgs list
选项:
  • --commit=REF
    - 在指定提交版本中列出依赖项
  • --ecosystem=ECO
    - 按生态系统过滤
  • --manifest=PATH
    - 按清单文件过滤
  • --json
    - 以JSON格式输出
显示依赖树(按清单文件和类型分组):
bash
git-pkgs tree
按名称模式搜索:
bash
git-pkgs search lodash
git-pkgs search "react-*"
查找包的声明位置(文件路径、行号、内容):
bash
git-pkgs where lodash
在编辑器中打开包的源代码:
bash
git-pkgs browse lodash
显示注册表URL(注册表页面、下载链接、文档、PURL):
bash
git-pkgs urls lodash
git-pkgs urls pkg:npm/lodash@4.17.21
显示锁文件完整性哈希值并检测偏移:
bash
git-pkgs integrity
管理包的备注:
bash
git-pkgs notes add pkg:npm/lodash "reviewed for security"
git-pkgs notes list pkg:npm/lodash

When to use

使用场景

  • When the user asks what dependencies are installed
  • When looking for a specific package in the project
  • When checking which manifest file declares a dependency
  • When exploring the dependency structure
  • 当用户询问已安装哪些依赖项时
  • 当在项目中查找特定包时
  • 当检查依赖项在哪个清单文件中声明时
  • 当探索依赖项结构时