Skip to main content

ChatPyPI

ChatPyPI: ChatArch Python package lifecycle helper extracted from ChatTool.

快速开始

pip install -e ".[dev]"
chatpypi --help
chatpypi --version
chatpypi pkg init demo-pkg
python -m pytest -q
python -m build

当前 CLI 树

ChatPyPI 正在从单纯的包生命周期工具,扩展为“包 + 登录后 PyPI 操作”工具。当前公共树结构已经预留:

chatpypi
├── auth
│   ├── login
│   ├── logout
│   ├── whoami
│   ├── register
│   ├── verify-email
│   ├── setup-2fa
│   ├── recovery-codes
│   └── session
│       ├── show
│       ├── export
│       ├── import
│       └── clear
├── profile
│   ├── list
│   ├── show
│   ├── use
│   ├── create
│   └── delete
├── config
│   ├── list
│   ├── get
│   ├── set
│   └── unset
├── pkg
│   ├── init
│   ├── build
│   ├── check
│   ├── upload
│   └── probe
├── project
│   ├── list
│   └── show
├── publisher
│   ├── list
│   ├── pending-list
│   ├── pending-add
│   └── pending-remove
├── token
│   ├── list
│   ├── create
│   └── revoke
├── doctor
│   └── check
└── docs
    ├── links
    ├── examples
    └── open

当前实现重点:

  • pkg:包初始化、构建、检查、上传、探测
  • auth whoami / auth session show|clear:本地 session 摘要读取
  • docs:输出文档链接与示例命令

其余子命令目前作为保留入口,先把稳定 CLI 树固定下来。

旧命令仍兼容:

  • chatpypi init
  • chatpypi build
  • chatpypi check
  • chatpypi upload
  • chatpypi probe

手动 token 发布当前可直接走:

export PYPI_API_TOKEN=...
chatpypi pkg upload --project-dir ./demo-pkg --token-env PYPI_API_TOKEN

Env 配置

当前建议把 PyPI 相关变量显式放到 shell env、.env 或 profile 配置里。最小集合分两类:

  • 登录后读取 / session 复用:
    • PYPI_SESSION_FILE:本地 session JSON 文件路径
  • 手动发布:
    • PYPI_API_TOKEN:PyPI API token,配合 chatpypi pkg upload --token-env PYPI_API_TOKEN

如果后续接入浏览器协作登录 / 2FA,常见可选变量包括:

  • PYPI_USERNAME
  • PYPI_PASSWORD
  • PYPI_TOTP_SECRET

推荐约定:

  • 不要把 token、密码直接写进命令行参数;
  • --token-env / --password-env 只接收“环境变量名”,CLI 会在运行时读取其值;
  • PYPI_SESSION_FILE 指向单个 profile 的单个 session 文件,CLI 只输出非敏感摘要,不直接回显 cookie;
  • .env 中若有包含空格的值,不要直接 source .env,应使用更安全的解析方式。

示例:

export PYPI_SESSION_FILE="$HOME/.config/chatpypi/default/session.json"
export PYPI_API_TOKEN="pypi-***"

chatpypi auth session show --format json
chatpypi pkg upload --project-dir ./demo-pkg --token-env PYPI_API_TOKEN

CLI 规范

这个模板默认依赖 chatstyle>=0.1.0,<0.2.0 和 chatenv>=0.2.0,<0.3.0,新的命令应优先使用:

  • CommandSchema / CommandField 描述输入。
  • add_interactive_option() 提供统一 -i/-I。
  • resolve_command_inputs() 统一缺参补问、默认值、TTY 与校验。

目录结构

  • src/:包源码
  • tests/code-tests/:代码测试和历史测试迁移
  • tests/cli-tests/:真实 CLI 测试,doc-first
  • tests/mock-cli-tests/:mock/fake CLI 测试,doc-first
  • docs/:长期维护文档,由 mkdocs 构建

开发说明

扩展脚手架前,先阅读 DEVELOP.md 和 AGENTS.md。

Metadata

Release files for ChatPyPI 0.2.0

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

Source distribution (sdist)

Source distribution for ChatPyPI 0.2.0
File Size Uploaded Provenance Actions
chatpypi-0.2.0.tar.gz 27.5 kB With provenance Details for chatpypi-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ChatPyPI 0.2.0
File Interpreter ABI Platform Actions
chatpypi-0.2.0-py3-none-any.whl Python 3 none any Details for chatpypi-0.2.0-py3-none-any.whl

Total release size: 54.5 kB

Release files / chatpypi-0.2.0.tar.gz

Download URL chatpypi-0.2.0.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4ebdf32d88611abd72633980cdd7fefb29a6a8d56555066bce97485024bee06e
BLAKE2b-256 checksum
How to use checksums
73c6a147f42417bf7cf5fd162d7dbce64e867f3c4a134b1f06cb3cde17c38dda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 26, 2026.

Transparency log

Release files / chatpypi-0.2.0-py3-none-any.whl

Download URL chatpypi-0.2.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
205e9c7684eb299df9cc6c6849430b25fd4ca7d769dd0122fc33573c6a31c172
BLAKE2b-256 checksum
How to use checksums
e9367b31782506a09f0058511fc7a3247bb2cc1ed27b66188f29cb3983be953c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 26, 2026.

Transparency log

Security for ChatPyPI 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chatpypi-0.2.0.tar.gz

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 Jun 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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