Skip to main content
Edit one channel in 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 into channels[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).
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 a channels: 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

A running gateway picks up the change through Config Reload.

Best Practices

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.
praisonai gateway channels update <name> --set enabled=true is the re-enable path — there is intentionally no enable subcommand.
disable keeps the block, so rolling back is one update --set enabled=true. Run remove once you are sure.
Skip pre-validation in scripts. A rejected edit exits 1 (or raises ValueError) and writes nothing.

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.