Skip to content

Autostart

Usejarvis supports autostart/background-service installation on:

  • Linux via systemd --user
  • macOS via launchd

This page is the manual reference for autostart. If you run the daemon in Docker, use Docker’s own restart policy instead (--restart unless-stopped). Windows has no daemon autostart (the daemon does not run on native Windows); the sidecar has its own start-at-login preference.

The dashboard can show autostart status and restart the service (GET /api/system/autostart, POST /api/system/autostart/restart), and jarvis uninstall removes the service automatically.

  • You run Usejarvis on your daily machine and want it available after reboot
  • You host it on a home server and want it to come back automatically
  • You do not want to manually run jarvis start every time

Create this file:

~/.config/systemd/user/jarvis.service

Example unit. Use absolute paths: a systemd user unit has a minimal PATH, so the ~/.bun/bin/jarvis wrapper (which needs bun on PATH) can fail. Point bun at the CLI entrypoint directly:

[Unit]
Description=J.A.R.V.I.S. Daemon
After=network.target
[Service]
Type=simple
ExecStart=/home/YOU/.bun/bin/bun /home/YOU/.bun/install/global/node_modules/@usejarvis/brain/bin/jarvis.ts start --foreground
Restart=on-failure
RestartSec=5
Environment=HOME=%h
Environment=PATH=%h/.bun/bin:/usr/local/bin:/usr/bin:/bin
[Install]
WantedBy=default.target

(For a source checkout, point the second argument at your checkout’s bin/jarvis.ts instead.)

Then enable it:

Terminal window
systemctl --user daemon-reload
systemctl --user enable jarvis.service
systemctl --user start jarvis.service

Recommended: keep the service running when you are not logged in:

Terminal window
loginctl enable-linger "$USER"

Useful commands:

Terminal window
systemctl --user status jarvis.service
journalctl --user -u jarvis.service -f

WSL2 caveat: this requires a working user systemd manager. On WSL2 without systemd enabled, user services are unreachable; enable systemd in /etc/wsl.conf first.

Create:

~/Library/LaunchAgents/ai.jarvis.daemon.plist

Example plist. As on Linux, run bun with the CLI entrypoint, set PATH, and redirect logs so you have something to debug:

<?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.jarvis.daemon</string>
<key>ProgramArguments</key>
<array>
<string>/Users/your-user/.bun/bin/bun</string>
<string>/path/to/jarvis/bin/jarvis.ts</string>
<string>start</string>
<string>--foreground</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/Users/your-user/.jarvis/logs/jarvis.log</string>
<key>StandardErrorPath</key>
<string>/Users/your-user/.jarvis/logs/jarvis-error.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>
<string>/Users/your-user</string>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/Users/your-user/.bun/bin</string>
</dict>
</dict>
</plist>

Then load it (modern macOS prefers bootstrap over the deprecated load):

Terminal window
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.jarvis.daemon.plist

RunAtLoad and KeepAlive start it immediately; no separate launchctl start needed. Restart with:

Terminal window
launchctl kickstart -k gui/$(id -u)/ai.jarvis.daemon

The daemon writes to ~/.jarvis/logs/jarvis.log (also viewable with jarvis logs). Check there first if the service starts but the dashboard is unreachable.

  • Make sure your config is valid before enabling autostart: a config file with broken YAML is a fatal startup error
  • Verify the dashboard is reachable after reboot
  • Check logs first if the service appears to start but the dashboard is unavailable