Introduction

When developing DeepSeek Harness (DSH) plugins or agents, you often need to programmatically retrieve package metadata from npm or PyPI. Manual lookups or direct external API calls add latency and disrupt workflows. Below is a plugin designed specifically for this purpose.

What It Is

This is a DSH plugin that registers the pkg_info tool, maintained by ZhijiangTang. It standardizes npm and PyPI package metadata queries into structured JSON objects for programmatic use by models and Code Mode. The plugin has zero dependencies, is pure ESM, and requires no build.

Core Features

  1. Query npm package metadata: includes name, version, description, license, author, homepage, repository, number of versions, dependencies, and more.
  2. Query PyPI package metadata: includes name, version, summary, license, author, homepage, number of published releases, dependency list, and more.
  3. Error handling: never throws exceptions. 404 errors, network errors, timeouts, and JSON parsing failures are collapsed into structured objects.

Installation and Enablement

Before installing, review the source code and license. The installation command is as follows:

dsh plugin --profile <name> add dsh-pkg-info

Typical Usage

Call the pkg_info tool. The registry parameter supports npm or pypi. The name parameter is required. The version parameter supports a specific version or tags such as latest/next (npm defaults to latest). PyPI project names are case-insensitive.

Examples:

// 查 npm 最新版
{ "registry": "npm", "name": "yaml" }
// 查 npm 指定版本
{ "registry": "npm", "name": "yaml", "version": "2.5.0" }
// 查 PyPI 最新版
{ "registry": "pypi", "name": "requests" }
// 查 PyPI 指定版本
{ "registry": "pypi", "name": "requests", "version": "2.28.1" }

Use Cases and Notes

Suitable for agents that need package metadata. The plugin runs with the permissions of the current dsh process and requires the network:outbound permission. Review the source code and license before installing.

Conclusion

After the steps above, you can integrate package lookup functionality. Directory: https://www.skillhub.cn/plugins/ZhijiangTang/dsh-pkg-info, GitHub: https://github.com/ZhijiangTang/dsh-pkg-info.