The gateway now ships in the
praisonai-bot package. praisonai serve gateway still works exactly as documented here; for a standalone install see praisonai-bot Migration.This page documents the WebSocket multi-agent Gateway daemon. The canonical CLI command is
praisonai-bot gateway start (bot-tier package). When the praisonai wrapper is co-installed, praisonai gateway start works as a convenience alias.For the UI-Gateway (Pattern C integration), see praisonai serve ui-gateway.For detailed information about channel resilience and operator controls, see Channel Supervision.praisonai gateway start; the CLI launches the daemon, supervises channels, and keeps the WebSocket gateway reachable.
How It Works
Quick Start
The gateway runs in the foreground. The daemon is installed by
praisonai-bot gateway install (or automatically by praisonai-bot onboard).Commands
Gateway Management
| Command | Description | Example |
|---|---|---|
praisonai gateway start | Start the gateway server (foreground) | praisonai gateway start --port 9000 |
praisonai gateway stop | Stop a running gateway instance | praisonai gateway stop --force |
praisonai gateway status | Check gateway and daemon status | praisonai gateway status --daemon-only |
praisonai gateway doctor | Validate channel credentials before start (pre-flight) | praisonai gateway doctor --config gateway.yaml |
praisonai gateway channels | List configured channels (add --probe to check creds) | praisonai gateway channels --probe |
Daemon Service
| Command | Description | Example |
|---|---|---|
praisonai gateway install | Install as OS daemon | praisonai gateway install --no-start |
praisonai gateway uninstall | Remove daemon service | praisonai gateway uninstall |
praisonai gateway logs | Show daemon logs | praisonai gateway logs -n 100 |
praisonai gateway restart | Restart the daemon | See restart commands below |
Channel Control
| Command | Description | Example |
|---|---|---|
praisonai gateway pause | Pause a channel | praisonai gateway pause telegram |
praisonai gateway resume | Resume a paused channel | praisonai gateway resume telegram |
praisonai gateway reconnect | Force reconnect a channel | praisonai gateway reconnect telegram |
Inbound Hooks
| Command | Description | Example |
|---|---|---|
praisonai gateway hooks add <path> | Register an inbound webhook trigger | praisonai gateway hooks add gmail --agent assistant |
praisonai gateway hooks list | List registered hooks | praisonai gateway hooks list |
praisonai gateway hooks remove <path> | Remove an inbound hook | praisonai gateway hooks remove gmail |
Testing & Debugging
| Command | Description | Example |
|---|---|---|
praisonai gateway send | Send test message | praisonai gateway send --channel telegram --channel-id 12345 -m "test" |
Command Reference
- start
- stop
- status
- doctor
- channels
- pause
- resume
- reconnect
--reliability overrides the reliability: / gateway.reliability: key in YAML. See Gateway Reliability Presets for profile details and precedence rules.Pre-flight credential check
praisonai gateway doctor validates every channel’s token before the gateway starts, so a bad or expired credential fails fast with a precise per-channel reason instead of disappearing into the supervisor’s silent reconnect loop.
Examples
Quick health check:Pre-flight gate on start
praisonai gateway start runs the same probe automatically before launch when invoked with --config gateway.yaml:
Token resolution
The probe loads~/.praisonai/.env first, so ${VAR} placeholders set by praisonai onboard resolve exactly like they do at runtime — doctor, channels --probe, and start --preflight all share the same token-resolution path.
Per-channel timeout
Each probe is bounded by a 15-second deadline; a stuck adapter is reported as"probe timed out after 15s" and does not hang the aggregate.
Exit codes
| Outcome | Exit code |
|---|---|
| All channels probe OK | 0 |
| Any channel fails | 1 |
gateway doctor with no channels configured | 0 |
When to use which
Programmatic check (Python)
Programmatic check (Python)
Environment Variables
| Variable | Description | Default |
|---|---|---|
GATEWAY_PORT | Port for start/stop/status when —port is not passed | 8765 |
The
GATEWAY_PORT environment variable is used by start, stop, and status commands when the --port option is not explicitly provided. Invalid values silently fall back to 8765.Single-Instance Enforcement
PraisonAI enforces a single gateway instance per host:port combination using PID locks. Lock File Location:~/.praisonai/gateway-<safe_host>-<port>.pid
The safe_host replaces : and . with _ (so 127.0.0.1 becomes 127_0_0_1). Each host:port combination gets its own lock file, allowing multiple gateways on different ports.
Restart the Daemon
Use these OS-specific commands to restart the daemon service (same commands shown in the onboard Done panel):- macOS
- Linux
- Windows
Status Output Examples
Healthy Gateway
Daemon Issues
Not Installed
Platform Support
Gateway CLI works across platforms with native daemon integration:| Platform | Service Type | Log Location | Management |
|---|---|---|---|
| macOS | LaunchAgent (ai.praison.bot) | ~/.praisonai/logs/bot-stderr.log | launchctl kickstart -k gui/$(id -u)/ai.praison.bot |
| Linux | systemd user service (praisonai-bot) | journalctl --user -u praisonai-bot | systemctl --user restart praisonai-bot |
| Windows | Scheduled Task (PraisonAIGateway) | Windows Event Log | schtasks /End /TN PraisonAIGateway && schtasks /Run /TN PraisonAIGateway |
Configuration Files
- agents.yaml
- gateway.yaml
Best Practices
Use daemon-only for health checks
Use daemon-only for health checks
Use
--daemon-only flag when monitoring daemon status in scripts or CI/CD pipelines to avoid gateway connection attempts.Check logs for troubleshooting
Check logs for troubleshooting
Always check
praisonai gateway logs when the daemon is running but gateway is unreachable - this reveals startup errors.Test channel configuration
Test channel configuration
Use
praisonai gateway send to test channel bot configuration before deploying to production environments.Monitor daemon status regularly
Monitor daemon status regularly
Set up monitoring that runs
praisonai gateway status --daemon-only to detect service failures quickly.Related
Gateway Server
Gateway architecture and configuration
Troubleshooting
Common gateway issues and solutions

