Docs/Automation

Gateway & apps

The gateway daemon runs Gray in the background: cron jobs and app connections like Discord keep working with no REPL window open.

Source: crates/gray/src/gateway

The gateway is a user service running gray gateway run: a 60-second cron ticker plus a control socket at $GRAY_HOME/gateway.sock. It is supervised by systemd --user, or runit on Void Linux. Messaging apps install as plugins and appear in the /gateway connections panel.

bash
$gray gateway install # write and start the user service (--print previews, --no-start skips)
$gray gateway status # daemon, service and ticker health; exits 1 when down
$gray gateway restart # also: start, stop, uninstall
$gray gateway off # master switch: run/start refuse until `on`

Connecting an app

/gateway (alias /gw) lists every installed app with its status; space toggles one, and a row that needs setup opens its flow. The flow asks for exactly what the app declares — secrets masked, the portal link beside each field — writes the config privately, runs the app's own doctor, and starts the daemon under whatever init the machine has. Nothing reports success until it is true.

headless setup
$gray gateway setup discord --field token=… --field owner_id=… --field channel_id=… --start

The daemon claims $GRAY_HOME/gateway.pid, records why it stopped in gateway.state.json, and drains an in-flight cron fire for up to 65 seconds on SIGTERM. Secrets never reach logs, errors, or anything the model can see.

Join the Discord

Chat with the people building and running Gray. Show what you made with it.

Join Discord →

Need help?

Open an issue on GitHub, run /feedback from the REPL, or ask in Discord.

Open an issue →