best-claw is a Telegram DM gateway that replies through a Codex model.
- Onboard
cargo run -- onboard- Validate config
cargo run -- config check- Check/approve pairing requests
cargo run -- pairing list
cargo run -- pairing approve <code>- Optional: OAuth login
cargo run -- auth- Run gateway
cargo run -- gateway- Stop gateway
- Press
qin the gateway TUI.
- Run:
-
cargo run -- pairing list -
cargo run -- pairing approve <code>
-
- Verify you know who is requesting access and that code values match.
- Keep
telegram.dm_policy = "pairing"so unapproved users never receive model responses.
- Keep
~/.best-claw/secrets.toml,~/.best-claw/oauth.token.enc, and~/.best-claw/telegram-pairing.tomlon trusted machines only. - Do not share these files over chat/email/issues.
- When moving files between machines, use trusted channels and keep permissions private (0600 on Unix).
src/coreowns shared runtime contracts and state:- command/event types
- event bus
- runtime state
AppCorecommand dispatch
src/extensionsowns command handlers:- each extension declares supported command kinds (kernel contract)
- each handler executes the command and can emit runtime events
src/domain.rsis CLI parsing focused and maps CLI input to core commands.
- CLI args are parsed in
domain.rsinto a core command. AppCorestoreslast_commandand dispatches to the first matching extension handler.- Extensions run command behavior and emit events as needed (for example gateway start/stop, pairing approved).
onboard→OnboardExtensionauth→AuthExtensionconfig check→ConfigExtensionpairing list,pairing approve <code>→PairingExtensiongateway,gateway-core→TelegramGatewayExtension- default/no recognized command →
TuiExtension
- Internal architecture was refactored to explicit core/extensions boundaries (
src/core,src/extensions). - Runtime command handling is now extension-based through
AppCoredispatch. - Operator-facing CLI commands and operational flow remain the same.
- Default is
telegram.dm_policy = "pairing". - Unapproved users receive a pairing guidance message instead of a model reply.
- Users cannot receive model responses until approved.
Approved users (admins) can send these bot DM commands:
/pairing list/pairing approve <code>/auth(runs OAuth login flow)
- Ingress listener: OAuth callback on
127.0.0.1:1455(loopback-only HTTP during login flow). - Egress destinations:
auth.openai.com,api.openai.com,api.telegram.org(HTTPS-only). - Remote operation recommendation: keep loopback defaults and use SSH/Tailscale tunnel instead of direct public bind.
Before upgrading or deploying a new build:
- Run
./scripts/security_gate.shand ensure it passes. - Confirm the build passed the release security verification gate in SECURITY.md.
- Confirm the network inventory summary still matches your deployment topology.
For full trust model and network inventory details, see SECURITY.md.