gateway.yaml / bot.yaml with a single command — other channels and settings stay untouched, and invalid edits are never written.
Quick Start
1
Let an agent manage channels
2
Or run the CLI directly
3
Or call the Python helper
How It Works
Every edit is a locked read-modify-write: read the file, merge the change intochannels[name], validate the whole document, then atomically replace the file.
A failed validation leaves the file byte-for-byte unchanged, so a bad edit can never take a running gateway down on its next reload.
Choosing a Subcommand
Pick the subcommand by what should happen to the channel block.CLI Reference
All four subcommands accept--config / -c; when omitted they use the parent gateway channels --config value, which falls back to gateway.yaml and the onboarded ~/.praisonai/bot.yaml (see Config Discovery).
- add
- update
- disable
- remove
The config file must already exist — create one first with
praisonai onboard or provision_gateway_config.Python API
Returns the resulting channel block (
{} when remove=True).
The Python helper upserts: it does not refuse to
add over an existing channel. The CLI adds that check (add rejects an existing name, update / disable / remove reject a missing one).Validation
The edited document is validated before the write; anything rejected leaves the file unchanged.Legacy Config Migration
Older single-bot and BotOS files are converted to achannels: block on the first edit.
Concurrent-Edit Safety
Each edit holds an exclusive OS advisory lock on a sidecar<config_path>.lock file (fcntl.flock on POSIX, msvcrt.locking on Windows), so parallel edits of different channels never overwrite each other.
Common Patterns
Rotate a token from CI
Add the same channel to many tenants
Add one channel to a running gateway
Best Practices
Prefer ${VAR} references over literal tokens
Prefer ${VAR} references over literal tokens
Store
token: ${DISCORD_BOT_TOKEN} rather than the secret itself. add writes a reference by default, and references survive every later edit verbatim. See Secret References.Re-enable with update, not a separate command
Re-enable with update, not a separate command
praisonai gateway channels update <name> --set enabled=true is the re-enable path — there is intentionally no enable subcommand.Disable before you remove
Disable before you remove
disable keeps the block, so rolling back is one update --set enabled=true. Run remove once you are sure.Let the schema reject bad values
Let the schema reject bad values
Skip pre-validation in scripts. A rejected edit exits
1 (or raises ValueError) and writes nothing.Related
Gateway Admin API
Repair and provision configs from Python.
Gateway CLI
Every
praisonai gateway command.Channels Gateway
How channels are configured and served.
Secret References
${VAR} tokens in gateway config.
