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 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.1.0,<0.2.0chatenv>=0.2.4,<0.3.0。新增命令应优先使用:

  • 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.1.tar.gz (14.0 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.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chatlinux-0.2.1.tar.gz
  • Upload date:
  • Size: 14.0 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.1.tar.gz
Algorithm Hash digest
SHA256 11d4c04bef66c01cc7ab6746239b7d345f5e70e6eb91adcc13b365cc319222f0
MD5 7b8347f8edc753f3d4cb1c96fd5912cd
BLAKE2b-256 bca7972c3d8401da6b55da65ee133fee1b490f13284ebd7e6790aeb235ea6af5

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlinux-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: chatlinux-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 12.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 734e4b3979b73ae99634328f091f9fad80da20e1e7bdb29529d586403c736bf3
MD5 4bd8cac98466cea1f7ee24aa54bc1667
BLAKE2b-256 306278a7daaaa777f2187a3a5bbd7a7522a1ae2e726e44b7c0431a54f6626aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatlinux-0.2.1-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

0.2.2

2 files

This release

0.2.1 This release

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