Service Installation

Install aidaemon as a system service that starts on boot and runs forever.

Install Command

bash
./aidaemon install-service

This auto-detects the platform and generates the appropriate service configuration.

Linux (systemd)

Creates /etc/systemd/system/aidaemon.service:

aidaemon.service
[Unit]
Description=aidaemon AI Agent
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/full/path/to/aidaemon
WorkingDirectory=/path/to/config/dir
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Then enables and starts the service:

bash
sudo systemctl daemon-reload
sudo systemctl enable --now aidaemon

macOS (launchd)

Creates $HOME/Library/LaunchAgents/ai.aidaemon.plist:

ai.aidaemon.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>ai.aidaemon</string>
    <key>ProgramArguments</key>
    <array>
        <string>/full/path/to/aidaemon</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/tmp/aidaemon.stdout.log</string>
    <key>StandardErrorPath</key>
    <string>/tmp/aidaemon.stderr.log</string>
</dict>
</plist>

Then loads the service:

bash
launchctl load ~/Library/LaunchAgents/ai.aidaemon.plist

Health Check

Once running as a service, verify with:

bash
curl http://127.0.0.1:8080/health
# {"status": "ok"}

The health endpoint is served by axum on the configured daemon.health_bind:daemon.health_port.