Run as a service
Service mode keeps the same daemon, HTTP app, Automations dispatcher, supervision loop, and memory consolidation running after the foreground shell closes. It does not itself make Agents act; automatic work still needs an enabled Automation trigger.
The built-in manager supports a systemd user unit on Linux and a launchd user agent on macOS.
Install and start
Section titled “Install and start”-
Validate the current user’s configuration:
Terminal window axocoatl validate -
Install the service definition:
Terminal window axocoatl service install -
If the configuration contains environment placeholders, inject those values through the service manager. A literal key supplied during onboarding needs no separate environment injection.
-
Start it and enable it at login:
Terminal window axocoatl service startaxocoatl service status -
Print the browser sign-in link. The service does not print it, so the token stays out of its logs:
Terminal window axocoatl urlFor a service installed with
--config, pass the same path, and the sameAXOCOATL_DATA_DIRif the service sets one.
Install resolves both the current axocoatl executable and the config file to
absolute paths. The default service uses the same user configuration and data
root as foreground commands. An explicit --config keeps advanced local mode;
its data defaults to <config-directory>/data unless
AXOCOATL_DATA_DIR overrides it.
What install records
Section titled “What install records”A service manager starts the daemon with its own minimal environment, not your
shell’s. launchd, for example, gives a LaunchAgent only
/usr/bin:/bin:/usr/sbin:/sbin on its PATH, which does not contain a Homebrew
Podman in /opt/homebrew/bin. Install therefore writes into the definition:
PATH: the directory of thepodmanthat your shell finds at install time, then the directories of thegitandghit finds, which Keep as PR runs, followed by/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin;CONTAINER_CONNECTIONandCONTAINER_HOST, when they are set at install time, so the service uses the same Podman connection as your shell. ACONTAINER_HOSTthat contains a password is not recorded.AXOCOATL_SOCKET_PATH, when it is set to an absolute path at install time, so the service’s daemon listens on the IPC socket your commands use. Set it when the default socket path,~/.axocoatl/run/axocoatl.sock(or$XDG_RUNTIME_DIR/axocoatl/axocoatl.sock), is longer than a Unix socket path may be: 103 bytes on macOS, 107 on Linux. Install warns when the service’s daemon could not start for that reason.
Install prints what it recorded and warns when it found no podman. It never
writes provider keys or other secrets into the definition. Run
axocoatl service install again after you move Podman, git or gh, or change
the Podman connection.
If the service was running, load the new definition with
axocoatl service restart.
On macOS the daemon’s output goes to ~/Library/Logs/Axocoatl/daemon.log. When
they do not exist yet, install creates that directory owner-only and the file
with mode 0600; an existing log is kept. On Linux the output goes to the user
journal. The service log never contains the sign-in link: serve
writes only a hint to run axocoatl url.
For an explicit configuration, validate and install it deliberately:
axocoatl validate /absolute/path/to/axocoatl.yamlaxocoatl service install --config /absolute/path/to/axocoatl.yamlSupply environment variables
Section titled “Supply environment variables”Axocoatl interpolates process environment variables in YAML and does not load dotenv files. The generated service unit/plist does not inject provider keys. This section applies only when the active configuration retains an environment placeholder.
Create a root-readable-by-you-only environment file, then add it through a user-unit override:
[Service]EnvironmentFile=/absolute/path/to/axocoatl.envEnvironment=AXOCOATL_DATA_DIR=/absolute/path/to/axocoatl-dataOpen the override with systemctl --user edit axocoatl, then apply it:
systemctl --user daemon-reloadsystemctl --user restart axocoatlThe generated LaunchAgent’s EnvironmentVariables block holds only PATH
and the Podman connection variables, and axocoatl service install
rewrites it. Add required variables through your approved
launchd/secret-management workflow before starting the agent, then inspect
the loaded definition. Avoid placing a long-lived API key in a
world-readable plist.
On Linux, run the hint printed by install when the daemon must survive logout:
loginctl enable-linger "$USER"Operate the service
Section titled “Operate the service”axocoatl service statusaxocoatl service stopaxocoatl service startaxocoatl service restartaxocoatl service uninstallstatus says whether the daemon runs and, when its last start failed, the line that
start logged, also while launchd or systemd is starting it again. start starts a
service that does not run and leaves one that runs as it is. restart stops a
running service and starts it again with the installed definition, which is how a
definition install rewrote, or a new axocoatl binary at the same path, takes
effect; it starts a service that does not run. Both wait until the daemon says it
started (up to 60 seconds). When its start fails (an invalid configuration, a port
in use, a data directory it refuses), they exit with status 1 and print the line the
daemon logged; launchd and systemd keep starting it again until you fix the cause and
run axocoatl service restart. stop returns once the daemon has exited and leaves
the definition installed. The daemon ends its turns and Sessions first: launchd gives
it 60 seconds, the most it allows, and systemd 90 seconds, its default, before they
kill it. A daemon that was killed leaves Session containers, which the next start
removes. uninstall stops the service, as stop does, and removes the definition.
Stopping or restarting the service leaves a Podman machine the daemon started
running: Axocoatl starts podman machine start in a session of its own, outside
the daemon’s process group, which launchd ends with the daemon.
For platform logs:
journalctl --user -u axocoatl --since todaytail -f ~/Library/Logs/Axocoatl/daemon.loglaunchctl print gui/$(id -u)/ai.axocoatl.daemonaxocoatl service status also prints where the logs are.
For an interactive diagnostic run, stop the service first so it releases the per-user IPC socket, then run:
RUST_LOG=debug axocoatl devPass --config /absolute/path/to/axocoatl.yaml as well only when diagnosing an
explicit advanced configuration.
Next: Data and backup →