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

命令行规范

这个包依赖 chatstyle>=0.2.0,<0.3.0 和 chatenv>=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.py 和 chatenv.configs 入口点,使包可被 ChatEnv 发现。

目录结构

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

开发说明

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

Metadata

Release files for ChatLinux 0.2.2

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

Source distribution (sdist)

Source distribution for ChatLinux 0.2.2
File Size Uploaded
chatlinux-0.2.2.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ChatLinux 0.2.2
File Interpreter ABI Platform
chatlinux-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / chatlinux-0.2.2.tar.gz

Download URL chatlinux-0.2.2.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
84a086e3352b02dee2332e2c0d8c7bff7b66187ff0a417fd14a9ea604b4fc22d
BLAKE2b-256 checksum
How to use checksums
5cf88ec88c851768882239bd2f894487e768663646d754842f3cfaafdf08f4c8
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 21, 2026.

Transparency log

Release files / chatlinux-0.2.2-py3-none-any.whl

Download URL chatlinux-0.2.2-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6bc4c32cbf4b8f959b53e52dfada8de8cc1e79e079e412e9690b33222ec3305
BLAKE2b-256 checksum
How to use checksums
375bbb25892371210855dd31e76c22c2c4d49775431dc2f136ebd5e1d419f28a
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 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

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