Skip to main content

bot-cmder

CI

Multi-platform SRE ChatOps bot — drive maintenance operations from Telegram, Discord, and Slack when you're away from your laptop and prod has issues. Same dispatcher, same /cmd UX, same JSONL audit log on every platform; per-message TOTP gate on PRIVILEGED operations so a leaked chat session can't restart your services.

Why bot-cmder

  • Operate prod from your phone. SSH-driven service actions, kubectl, custom runbooks — all reachable through chat. No laptop required during incidents.
  • Strong defaults you can live with. TOTP-gated PRIVILEGED commands, append-only JSONL audit log with built-in rotation, per-host SSH command allowlists, ACL-driven access. Safe out of the box.
  • One codebase, three platforms. Telegram + Discord + Slack adapters share the dispatcher / OTP gate / audit log. Pick one, all three, or none — every adapter mounts on demand.

Quick start

pip install bot-cmder
bot-cmder init                              # scaffold ~/.config/bot-cmder/{app.yaml,.env} + state dir
bot-cmder configure                         # interactive wizard — fill Telegram/Discord/Slack credentials
# edit ~/.config/bot-cmder/app.yaml — add your users + ACL
bot-cmder enroll-totp --user telegram:<your-id>
bot-cmder serve

→ For the full 30-minute walkthrough from pip install to "I just ran a privileged command via TOTP", see docs/getting-started.md.

Other install paths (source / Docker) below.

Install

pip install bot-cmder

Lands bot-cmder on your PATH; pairs with python -m bot_cmder (equivalent).

From source (contributors)

Requires uv.

git clone https://github.com/zondatw/bot-cmder.git
cd bot-cmder
uv sync && pre-commit install --install-hooks
uv run bot-cmder init --config-dir .       # scaffolds into repo (./config/, ./var/) instead of ~/.config
uv run bot-cmder serve --reload

The from-source flow uses ./config/app.yaml, ./.env, and ./var/ (CWD-relative), preserving the dev workflow exactly.

Via Docker / GHCR

docker pull ghcr.io/zondatw/bot-cmder:latest

docker run --rm -it -v bot-cmder-cfg:/etc/bot-cmder \
  ghcr.io/zondatw/bot-cmder:latest init --config-dir /etc/bot-cmder

docker run -d --name bot-cmder \
  -v bot-cmder-cfg:/etc/bot-cmder:ro \
  -v bot-cmder-state:/var/lib/bot-cmder \
  -p 47823:47823 \
  --restart unless-stopped \
  ghcr.io/zondatw/bot-cmder:latest

Multi-arch (amd64 + arm64). Full walkthrough including k8s + Compose examples in docs/docker.md.

Config file locations

bot-cmder searches for app.yaml (and .env, and the state dir) in this order, returning the first hit:

  1. --config <path> CLI flag / BOT_CMDER_CONFIG env var
  2. ./config/app.yaml (CWD-relative, dev workflow)
  3. $XDG_CONFIG_HOME/bot-cmder/app.yaml (default ~/.config/bot-cmder/app.yaml, installed flow)

Same precedence for .env (./.env → $XDG_CONFIG_HOME/bot-cmder/.env) and the state dir (BOT_CMDER_STATE_DIR → ./var/ → $XDG_STATE_HOME/bot-cmder/).

The legacy BIND_HOST / BIND_PORT / RELOAD / APP_CONFIG_PATH env names keep working through 0.2.x with a deprecation warning; rename to the BOT_CMDER_* form before 0.3.0.

Documentation

Getting started 30-minute walkthrough — from pip install to your first PRIVILEGED command
Full config reference Every settable field with default + comment
CHANGELOG Per-release notes (Keep a Changelog format)
Discord setup docs/discord-setup.md — app + slash commands
Slack setup docs/slack-setup.md — manifest + signing secret
Telegram polling (no domain) docs/telegram-polling.md
Slack Socket Mode (no domain) docs/slack-socket-mode.md
Discord Gateway (no domain) docs/discord-gateway.md
TOTP + emergency mode docs/otp.md
Audit log rotation docs/audit-rotation.md
Docker / GHCR docs/docker.md
Maintainer release procedure docs/release.md
Contributor workflow AGENTS.md — issue-first, atomic commits, PR-then-merge
Personal-ID leak prevention docs/git-leak-prevention.md

Architecture (one paragraph)

bot_cmder/ package layout: adapters/ (how chat platforms talk to the bot — Telegram, Discord, Slack, with both push and outbound-pull modes per platform); core/ (registry, dispatcher, parser, ACL, OTP gate); connectors/ (how the bot talks to infra — local subprocess, SSH); auth/ (TOTP enrollment, secret store, pending sessions, emergency-bypass windows); audit/ (JSONL writer with rotation); config/ (pydantic schema + XDG-aware path resolution); commands/ (built-in /help / /whoami / /health / /kubectl / /runbook / /service / /ssh / /otp); cli/ (the bot-cmder shell command). Tests mirror the package layout under tests/.

Run tests

uv run pytest -q
uv run pre-commit run --all-files

Changelog

Per-release notes — what's added / changed / deprecated / removed — in CHANGELOG.md. Format: Keep a Changelog 1.1.0.

License

MIT — see LICENSE.

Metadata

Release files for bot-cmder 0.3.0

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

Source distribution (sdist)

Source distribution for bot-cmder 0.3.0
File Size Uploaded Provenance Actions
bot_cmder-0.3.0.tar.gz 368.1 kB With provenance Details for bot_cmder-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bot-cmder 0.3.0
File Interpreter ABI Platform Actions
bot_cmder-0.3.0-py3-none-any.whl Python 3 none any Details for bot_cmder-0.3.0-py3-none-any.whl

Total release size: 525.4 kB

Release files / bot_cmder-0.3.0.tar.gz

Download URL bot_cmder-0.3.0.tar.gz
Size 368.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a4b7724fc83c03d52744f940e22b9c8b3590a30fde98e803969e486e9ee0af2c
BLAKE2b-256 checksum
How to use checksums
7a784d3a320303aaf3b4fa93e513fd5ab3bbdf6d32408f28027458ebc3c18370
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 20, 2026.

Transparency log

Release files / bot_cmder-0.3.0-py3-none-any.whl

Download URL bot_cmder-0.3.0-py3-none-any.whl
Size 157.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc2fe95a48289e3c8f350aa942e7d5bc6a990da41bf91ad9087981708db3b09b
BLAKE2b-256 checksum
How to use checksums
bab9eeaf36001c27ce8dd837f1c2634dd51483c8ebfdf337cd03ab2dec191247
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 20, 2026.

Transparency log

Security for bot-cmder 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bot_cmder-0.3.0.tar.gz

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 Jun 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

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