Skip to main content

ChatArch network and campus-network CLI

Project description

ChatNet

ChatNet 是 ChatArch 系列的网络与校园网 CLI,当前提供 ECNU 自助服务平台登录、查询和访客管理能力。

快速开始

pip install -e ".[dev]"
chatnet ecnu --help
python -m pytest -q
python -m build

ECNU CLI

ECNU 自助服务平台能力统一挂在 chatnet ecnu 下,覆盖登录、会话、日志查询和访客管理。

默认配置使用 chatenv 规范,位于 ~/.chatarch/envs/ECNU/.env

chatenv cat -t ecnu
chatnet ecnu login --username "$ECNU_USERNAME" --password "$ECNU_PASSWORD"
chatnet ecnu status
chatnet ecnu home
chatnet ecnu visitor list
chatnet ecnu visitor default
chatnet ecnu visitor create --remark GuestB
chatnet ecnu visitor update --id 10256703 --remark GuestB --password 'Temp!235'

默认 login 会走自动验证码登录;自动识别依赖可选 OCR extra:

pip install -e ".[captcha]"
chatnet ecnu login --username "$ECNU_USERNAME" --password "$ECNU_PASSWORD"

缺少可恢复参数时,命令会按 ChatArch 规范进入交互补问;-i 强制交互,-I 禁止交互并快速失败。默认输出为人类可读摘要,显式传 --json 才输出原始 JSON。密码、Cookie、短信验证码等敏感值不要写入文档或提交记录。 默认 help 只展示常用命令;login-initlogin-autocookie-headerselftest 和日志类 debug 命令仍可直接调用,但不在常规帮助中暴露。 如果要批量维护默认访客账号,可在 ECNU typed env 中设置 ECNU_VISITOR_PASSWORD1ECNU_VISITOR_PASSWORD2ECNU_VISITOR_REMARK,然后运行 chatnet ecnu visitor default

完整使用文档见 docs/ecnu.md

CLI 规范

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

  • 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.mdAGENTS.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatnet-0.1.2.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatnet-0.1.2-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file chatnet-0.1.2.tar.gz.

File metadata

  • Download URL: chatnet-0.1.2.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatnet-0.1.2.tar.gz
Algorithm Hash digest
SHA256 427db3d5e2b31611d87836a82bc2b75a83a693966fa2428bdbf4a11fa4e79e05
MD5 118f3729746d3784ecf61e5db4ad2dc5
BLAKE2b-256 fb99b44f98aed80f6edbdceb9be945a66ac2eb48371ce19d0b5cdc4b7a94f735

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatnet-0.1.2.tar.gz:

Publisher: publish.yml on ChatArch/ChatNet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chatnet-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: chatnet-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chatnet-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43532893bdb17b6232e5ff5803dc10406cddab6345db5a6f5e47563bd68ef7bf
MD5 40774842cec566ac12edfe8b38d4cf2e
BLAKE2b-256 5dabc47f8d11f21f0827dc8db988d567c14129e366017838b0dfdf285f2ee3be

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatnet-0.1.2-py3-none-any.whl:

Publisher: publish.yml on ChatArch/ChatNet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page