Skip to main content
Gateway CLI provides commands for starting, monitoring, and managing the PraisonAI Gateway server and its daemon service.
This page documents the WebSocket multi-agent Gateway daemon (praisonai gateway start). For the UI-Gateway (Pattern C integration), see praisonai serve ui-gateway.

Quick Start

Important: praisonai gateway start runs in the foreground. The daemon is installed by praisonai gateway install (or automatically by praisonai onboard).
1

Start Gateway

praisonai gateway start
Only one gateway can run per host:port. Stop the existing one with praisonai gateway stop first, or use a different port.
2

Check Status

praisonai gateway status
3

Test Health Endpoint

curl http://127.0.0.1:8765/health

Commands

Gateway Management

CommandDescriptionExample
praisonai gateway startStart the gateway server (foreground)praisonai gateway start --port 9000
praisonai gateway stopStop a running gateway instancepraisonai gateway stop --force
praisonai gateway statusCheck gateway and daemon statuspraisonai gateway status --daemon-only
praisonai gateway channelsList configured channelspraisonai gateway channels --json

Daemon Service

CommandDescriptionExample
praisonai gateway installInstall as OS daemonpraisonai gateway install --no-start
praisonai gateway uninstallRemove daemon servicepraisonai gateway uninstall
praisonai gateway logsShow daemon logspraisonai gateway logs -n 100
praisonai gateway restartRestart the daemonSee restart commands below

Testing & Debugging

CommandDescriptionExample
praisonai gateway sendSend test messagepraisonai gateway send --channel telegram --channel-id 12345 -m "test"

Command Reference

praisonai gateway start [OPTIONS]

Options:
  --host TEXT         Host to bind to [default: 127.0.0.1]
  --port INTEGER      Port to listen on [default: 8765 or $GATEWAY_PORT]
  --agents TEXT       Path to agent configuration file
  --config TEXT       Path to gateway.yaml for multi-bot mode

Examples:
  praisonai gateway start
  praisonai gateway start --config gateway.yaml
  praisonai gateway start --agents agents.yaml --port 9000
  GATEWAY_PORT=9000 praisonai gateway start

Environment Variables

VariableDescriptionDefault
GATEWAY_PORTPort for start/stop/status when —port is not passed8765
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):
launchctl kickstart -k gui/$(id -u)/ai.praison.bot

Status Output Examples

Healthy Gateway

$ praisonai gateway status
Gateway PID lock: Process 12345 running (127.0.0.1:8765)
Port 127.0.0.1:8765: In use
Daemon service: Running (launchd)
Process ID: 12345
Gateway server: Reachable at http://127.0.0.1:8765/health
  Status: healthy
  Uptime: 3600.5 seconds
  Agents: 2
  Sessions: 1
  Clients: 3
  Channels: 2 configured

Daemon Issues

$ praisonai gateway status
Daemon service: Installed but not running (launchd)
Gateway not reachable at http://127.0.0.1:8765/health

Not Installed

$ praisonai gateway status --daemon-only
Daemon service: Not installed (systemd)

Platform Support

Gateway CLI works across platforms with native daemon integration:
PlatformService TypeLog LocationManagement
macOSLaunchAgent (ai.praison.bot)~/.praisonai/logs/bot-stderr.loglaunchctl kickstart -k gui/$(id -u)/ai.praison.bot
Linuxsystemd user service (praisonai-bot)journalctl --user -u praisonai-botsystemctl --user restart praisonai-bot
WindowsScheduled Task (PraisonAIGateway)Windows Event Logschtasks /End /TN PraisonAIGateway && schtasks /Run /TN PraisonAIGateway

Configuration Files

# Simple agent configuration
agent:
  name: "support"
  instructions: "You are a helpful support agent"
  model: "gpt-4o-mini"
  tools:
    - search_web
  memory: true

Best Practices

Use --daemon-only flag when monitoring daemon status in scripts or CI/CD pipelines to avoid gateway connection attempts.
Always check praisonai gateway logs when the daemon is running but gateway is unreachable - this reveals startup errors.
Use praisonai gateway send to test channel bot configuration before deploying to production environments.
Set up monitoring that runs praisonai gateway status --daemon-only to detect service failures quickly.

Gateway Server

Gateway architecture and configuration

Troubleshooting

Common gateway issues and solutions