Skip to main content

ChatNPM

ChatNPM: ChatArch npm registry and package maintenance helper

文档:https://arch.gh.wzhecnu.cn/ChatNPM/

快速开始

pip install chatnpm
chatnpm --tree
chatnpm --tree-brief
chatnpm package inspect npm --format json
chatnpm trusted audit . --format json
printf '%s\n' 'Open https://www.npmjs.com/login/abc to use your security key' | chatnpm auth parse-output --format json
python -m pytest -q
python -m build

真实 CLI 树

chatnpm --tree 显示参数签名;chatnpm --tree-brief 保留相同节点和用途说明,但省略参数签名。两者均由 ChatStyle 从真实 Click 注册面生成。

chatnpm
├── --help  # Show this message and exit.
├── --version  # Show the version and exit.
├── --tree  # Print the registered CLI tree and exit.
├── --tree-brief  # Print the registered CLI tree without parameter signatures and exit.
├── auth  # Parse npm authentication handoff prompts.
│   └── parse-output [--format OUTPUT-FORMAT]  # Parse npm CLI output from stdin into a card-handoff payload.
├── package  # Inspect public npm registry metadata; read-only network access.
│   └── inspect <PACKAGE> [--version PACKAGE-VERSION] [--registry REGISTRY] [--format OUTPUT-FORMAT]  # Read public package metadata; sends one request and never outputs auth values.
└── trusted  # Audit npm Trusted Publishing evidence; read-only filesystem access.
    └── audit [PATH] [--format OUTPUT-FORMAT]  # Read package/workflow evidence under PATH; no account access or secret output.

npm 发布元数据只读检查

chatnpm package inspect <package> 会读取公开 npm registry packument,输出安全摘要:

  • package / version / scope
  • public maintainers count and names from registry metadata
  • repository and safe publishConfig summary
  • dist integrity/signature/attestation presence
  • provenance evidence when dist.attestations is present
  • local GitHub Actions evidence for npm OIDC / npm publish --provenance through chatnpm trusted audit

npm 的公开 registry 不提供类似 PyPI 项目设置页的 Trusted Publisher 表格,因此 ChatNPM 会明确报告:

Trusted Publishing settings: not exposed by public npm registry

这不是失败,也不是推断没有 Trusted Publishing;它只表示公开读回只能验证 registry provenance/attestation evidence,不能读取 npm 账号/包设置里的 trusted-publishing 配置。

CLI 规范

这个包使用 chatstyle>=0.2.0,<0.3.0 的 add_tree_option() 生成完整和简洁命令树,不维护包内 renderer。ChatNPM 没有 env/profile/config 行为,因此不依赖 ChatEnv。

目录结构

  • src/:包源码
  • tests/:CLI、registry、trusted publishing、docs/workflow contract 测试
  • docs/:长期维护文档,由 MkDocs Material + i18n 构建

开发说明

扩展前先阅读 DEVELOP.md 和 AGENTS.md。

Metadata

Release files for ChatNPM 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ChatNPM 0.1.5
File Size Uploaded
chatnpm-0.1.5.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ChatNPM 0.1.5
File Interpreter ABI Platform
chatnpm-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 28.7 kB

Release files / chatnpm-0.1.5.tar.gz

Download URL chatnpm-0.1.5.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e999462cd147420ba4a3f07e4c160bb87ee4915fc0c7e9c35e660914d54dc9f5
BLAKE2b-256 checksum
How to use checksums
d9f3915c2cc436c50b5878396959f354488734ac7ff84686d20da8df56e63de6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release files / chatnpm-0.1.5-py3-none-any.whl

Download URL chatnpm-0.1.5-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fef3521e4f1ffb4adcd4fdb42b8dac3e21c1dc8cf221df12a25b318c0a26c76
BLAKE2b-256 checksum
How to use checksums
b1742fbee3cbbfc467f497e2019c80595df6db17563e949202ec4bcbb2699e8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page