Skip to main content

ChatLinux

ChatArch Linux 运维包。当前首个业务能力是 fleet 状态缓存 CLI:用 ChatArch 内部配置 track 服务器,通过 Ansible 刷新常规公共指标,并从本地缓存快速查看状态。

文档入口:https://arch.gh.wzhecnu.cn/ChatLinux/

按场景选择文档:

场景 文档
第一次安装、初始化 .cube track、刷新/查看缓存 快速开始
查看当前真实 CLI 命令树和 shell 用法 CLI 树
校对当前包有哪些一等能力和边界 能力地图
从 Python 代码调用包能力 接口树

快速开始

pip install ChatLinux
chatlinux --version
chatlinux --tree
chatlinux --tree-brief
chatlinux fleet init --sample cube
chatlinux fleet refresh --track cube
chatlinux fleet show --track cube

开发 checkout 中可用:

pip install -e ".[dev,docs]"
PYTHONPATH=src python -m pytest -q
PYTHONPATH=src python -m chatlinux.cli fleet --help

Fleet 配置与缓存

默认本地状态根是一个 ChatArch 内部路径:优先使用 CHATLINUX_HOME,否则使用 $CHATARCH_HOME/chatlinux,再否则回落到 ~/.chatarch/chatlinux。默认落点包括:

~/.chatarch/chatlinux/fleet.json
~/.chatarch/chatlinux/cache/<track>-status.json
~/.chatarch/chatlinux/runtime/fleet-inventory.ini
~/.chatarch/chatlinux/runtime/fleet_probe.py

其中 runtime/ 只保存 refresh 时生成的 Ansible inventory 和只读 probe;它仍在 ChatArch home 内部,不写入 /etc/usr、系统服务目录或任务仓库。ChatEnv provider namespace 也使用小写 chatlinux,未来 ChatEnv 托管值同样归入 ChatArch home,不在工作区散落文件。

chatlinux fleet init --json 会回显完整 state_paths,用于验收 config/cache/runtime 等本地数据落点是否仍在同一个 state root 下。

任务目录或 CI 中可用 --home 隔离:

chatlinux fleet --home ./playground/chatlinux-home init --sample cube --json
chatlinux fleet --home ./playground/chatlinux-home status --track cube --refresh

安全边界

  • show / status 默认只读本地缓存;refreshstatus --refresh 才会访问服务器。
  • 当前 MVP 只采集常规公共指标:CPU/load、内存、swap、文件系统、GPU 可用信息和 failed systemd units。
  • 不执行 sudo,不清理、不重启、不修复远端服务。

命令行规范

这个包依赖 chatstyle>=0.2.0,<0.3.0chatenv>=0.2.10,<0.3.0。新增命令应优先使用:

  • 顶层 Click CLI 使用 add_tree_option()--tree 默认显示参数签名,--tree-brief 只保留命令节点和说明。
  • CommandSchema / CommandField 描述输入。
  • add_interactive_option() 提供统一 -i/-I
  • resolve_command_inputs() 统一缺参补问、默认值、TTY 与校验。
  • 默认保留 config.pychatenv.configs 入口点,使包可被 ChatEnv 发现。

目录结构

  • src/:包源码
  • tests/:代码测试与 CLI 测试
  • docs/:长期维护文档,由 mkdocs 构建

开发说明

扩展包前,先阅读 DEVELOP.mdAGENTS.md

Download files

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

Source Distribution

chatlinux-0.2.2.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

chatlinux-0.2.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file chatlinux-0.2.2.tar.gz.

File metadata

  • Download URL: chatlinux-0.2.2.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chatlinux-0.2.2.tar.gz
Algorithm Hash digest
SHA256 84a086e3352b02dee2332e2c0d8c7bff7b66187ff0a417fd14a9ea604b4fc22d
MD5 4f97f9c3491961b3e652f4ed943e8c36
BLAKE2b-256 5cf88ec88c851768882239bd2f894487e768663646d754842f3cfaafdf08f4c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlinux-0.2.2.tar.gz:

Publisher: publish.yml on ChatArch/ChatLinux

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

File details

Details for the file chatlinux-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: chatlinux-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chatlinux-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6bc4c32cbf4b8f959b53e52dfada8de8cc1e79e079e412e9690b33222ec3305
MD5 ab07680e636ece762a47fb8beaa59465
BLAKE2b-256 375bbb25892371210855dd31e76c22c2c4d49775431dc2f136ebd5e1d419f28a

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlinux-0.2.2-py3-none-any.whl:

Publisher: publish.yml on ChatArch/ChatLinux

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

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

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