BaihuBaihu
CLI

daemon

full runtime with all subsystems

usage

baihu daemon

starts the full baihu runtime:

  • gateway — HTTP API server on localhost
  • channels — all configured chat channels (telegram, discord, slack, etc.)
  • heartbeat — periodic tasks from HEARTBEAT.md
  • cron — scheduled jobs
  • skills — loaded from ~/.baihu/workspace/skills/

uses tokio JoinSet for structured concurrency. all subsystems start together, and if one crashes, the daemon logs the error and continues running the rest.

single instance

the daemon grabs an exclusive file lock on ~/.baihu/daemon.lock at startup. if another instance is already running, it exits with an error instead of corrupting shared state.

graceful shutdown

ctrl+c sends SIGTERM. the daemon shuts down all subsystems cleanly, flushes pending writes, and releases the lock file.

On this page