Gateway

The gateway is the main runtime process. It starts the agent, connects all enabled chat channels, and runs the cron scheduler and heartbeat service.

Starting the gateway

kyber gateway

Configuration

{
  "gateway": {
    "host": "0.0.0.0",
    "port": 18790
  }
}
FieldTypeDefaultDescription
hoststring0.0.0.0Bind address
portnumber18790Port

CLI flags

FlagDescription
--port, -pOverride gateway port
--verbose, -vEnable debug logging

What the gateway runs

When you start the gateway, it:

  1. Loads your config from ~/.kyber/config.json
  2. Creates the LLM provider with your API key and model
  3. Starts the agent loop
  4. Connects all enabled chat channels (Discord, Telegram, WhatsApp, Feishu)
  5. Starts the cron scheduler (if any jobs are configured)
  6. Starts the heartbeat service
  7. Listens for incoming messages on all channels

Running as a system service

The install script can set this up for you. If you want to do it manually:

Linux (systemd):

mkdir -p ~/.config/systemd/user
 
cat > ~/.config/systemd/user/kyber-gateway.service << EOF
[Unit]
Description=Kyber Gateway
After=network.target
 
[Service]
Type=simple
ExecStart=$(which kyber) gateway
Restart=on-failure
RestartSec=5
 
[Install]
WantedBy=default.target
EOF
 
systemctl --user daemon-reload
systemctl --user enable --now kyber-gateway
loginctl enable-linger $(whoami)  # survive logout on VPS

macOS (launchd):

The install script creates plist files in ~/Library/LaunchAgents/. See the install script source for the full plist template.