Skip to main content

ChatGlance

ChatGlance 是 ChatArch/WZHECNU Glance dashboard 的 Python 生成与运维包,提供 chatglance CLI。

它不是 NPM 项目,也不是重新实现 Glance 后端:上游 Glance 仍然是 Go 单二进制 dashboard server;ChatGlance 负责把 ChatArch 项目清单、Glance YAML 页面、inline HTML 表格和安全运维补丁组织成可复用的 Python 包/CLI。

当前能力

  • 从 repository inventory JSON 生成 Glance 项目 page。
  • 当前 page tabs 固定为:最近提交待处理 PR / Issue分类一览表
  • 待处理 PR / Issue 只显示 PR/Issue 非 0 的仓库,并按 (PR, Issue, 最近提交) 降序。
  • 生成 config 副本时清理 legacy generated pages:ProjectsChatArch ProjectsChatArch Projects List
  • 为 Glance server-stats 写入 root-only Disk 配置:hide-mountpoints-by-default: true + mountpoints: /,避免 snap/loop mount 出现在 Disk popover。
  • 维护 durable runtime:一次性 runtime maintain 可原子更新 live config、备份、校验,并在内容变化时可选重启 systemd user service。
  • 渲染并安装 user-level systemd units:主服务仍直接启动 upstream Glance Go binary;维护任务是独立 oneshot/timer,不是 Python wrapper。
  • 通过 CLI 安装、启用、启动和回读当前 Glance 页面对应的 user service/timer。

快速开始

pip install -e ".[dev]"
chatglance --help
chatglance --tree
chatglance --version
python -m pytest -q
python -m build

CLI 示例

只生成 项目 page YAML:

chatglance projects render-page \
  --data /path/to/chatarch-projects.json \
  --output playground/projects-page.yml

把生成页写入一个 Glance config 副本:

chatglance projects update-config \
  --data /path/to/chatarch-projects.json \
  --config /path/to/glance.yml \
  --output playground/glance.with-projects.yml

server-stats Disk 改成只显示 root 分区,写入 config 副本:

chatglance disks root-only \
  --config /path/to/glance.yml \
  --output playground/glance.root-disk.yml

维护一个 durable Glance runtime(默认 ~/.chatarch/glance):

chatglance runtime maintain \
  --runtime-home ~/.chatarch/glance \
  --restart-service chatarch-glance.service

生成推荐 systemd user units:

chatglance runtime render-systemd \
  --runtime-home ~/.chatarch/glance \
  --chatglance-bin ~/.chatarch/venv/bin/chatglance \
  --output-dir playground/systemd

安装并启用 user-level systemd units(写入 ~/.config/systemd/user,不需要 sudo):

chatglance runtime install-systemd \
  --runtime-home ~/.chatarch/glance \
  --chatglance-bin ~/.chatarch/venv/bin/chatglance \
  --start

启动/回读当前页面对应的 user service/timer:

chatglance runtime start
chatglance runtime status

运行态边界

推荐拓扑是 systemd 直接运行 Glance,chatglance 只做维护

  • 主服务:chatarch-glance.service 直接执行 ~/.chatarch/glance/bin/glance -config ~/.chatarch/glance/config/glance.yml
  • 内容数据:repository inventory JSON、缓存和生成快照放在 ~/.chatarch/glance/data/~/.chatarch/glance/cache/
  • live config:~/.chatarch/glance/config/glance.yml;更新前写备份到 ~/.chatarch/glance/config/backups/
  • 维护:chatglance runtime maintain 是 oneshot,可由 chatarch-glance-maintenance.timer 周期触发。
  • 安装/启动:chatglance runtime install-systemd --startchatglance runtime start 只使用 user-level systemd,不写 /etc/systemd
  • 不建议加 Python 长驻 wrapper:wrapper 会把 server 生命周期和内容生成耦合,反而不利于 systemd 重启、日志、健康检查和回滚。

安全边界

  • CLI 默认写 output file,不默认覆盖 live glance.yml
  • 不保存或输出 Glance auth、password hash、GitHub token、proxy credential。
  • live runtime、logs、backups、全量实时 JSON 快照默认不进源码仓库。
  • 后续如需动态表格、搜索、中英文切换,再考虑增加小型静态前端层;当前 Python CLI 是基础层。

Download files

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

Source Distribution

chatglance-0.1.1.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

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

chatglance-0.1.1-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file chatglance-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for chatglance-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9067c08c0ae9fc87e923d25faf8db30b36c8527f19e0616995d74cd61197ca89
MD5 609e4b8377764335f4ec5b88e05a66c9
BLAKE2b-256 f679408932a63a3193048cad25afe366a7324bf2dc7eae842c1a1caec35e031d

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatglance-0.1.1.tar.gz:

Publisher: publish.yml on ChatArch/ChatGlance

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

File details

Details for the file chatglance-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for chatglance-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb972c105562a3d3456d3686fcb6686b63ddea8f9901bbece9362a2b43a88fed
MD5 28c4aa193e3e6ae76e1fb2b539722f31
BLAKE2b-256 3291dd357b4b9e803261a12b086e1c99c6e7ca489a35658e4a943c6ac02a25b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatglance-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ChatArch/ChatGlance

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