HOT RELOAD
Overview
When swamp serve starts with --hot-reload, it writes a PID file to
.swamp/serve.pid and listens for SIGHUP. On receiving the signal, the server
reloads all pulled extension bundles and refreshes the trusted collectives list
without restarting.
The swamp serve reload subcommand reads the PID file and sends SIGHUP to the
running process.
Flag
--hot-reloadDefault: off. When enabled, the server writes .swamp/serve.pid at startup and
removes it on shutdown.
Subcommand
swamp serve reloadWithout --server, reads .swamp/serve.pid and sends SIGHUP to the serve
process. With --server, sends a reload request to the running server over
WebSocket. Both modes require the serve process to be running with
--hot-reload.
Exits non-zero if the PID file does not exist (local mode) or the server is unreachable (remote mode).
Remote reload
swamp serve reload --server <url>Sends a reload request to a remote swamp serve instance over WebSocket instead
of using the local PID file and SIGHUP.
Flags
| Flag | Description |
|---|---|
--server <url> |
WebSocket URL of the running serve instance (env: SWAMP_SERVE_URL) |
--token <token> |
Server token for authentication. Only applies with --server. Falls back to stored credential or SWAMP_SERVER_TOKEN |
Credential resolution
When --token is not provided, the client resolves credentials in this order:
SWAMP_SERVER_TOKENenvironment variable- Stored credential for the server URL in
~/.config/swamp/servers.json(written byswamp auth server-login)
Examples
# Reload on a remote server with explicit token
swamp serve reload --server wss://swamp.acme.internal:9090 \
--token 'paul-token.<secret>'
# Reload using stored credential
swamp serve reload --server wss://swamp.acme.internal:9090
# Reload using SWAMP_SERVE_URL (no --server needed)
export SWAMP_SERVE_URL=wss://swamp.acme.internal:9090
swamp serve reloadPID file
Location: .swamp/serve.pid (relative to the repository root).
Written at startup when --hot-reload is active. Contains the process ID of the
running swamp serve instance. Removed on clean shutdown.
Reload behavior
On SIGHUP, the server:
- Re-reads all pulled extension bundles from
.swamp/pulled-extensions/and.swamp/bundles/ - Invalidates cached bundle modules
- Re-reads
.swamp.yamland refreshes the auto-resolver's trusted collectives list - Serves subsequent requests using the updated bundles and trust list
All extension types (models, reports, workflows, vaults) are reloaded. There is no per-extension targeting — a reload refreshes everything.
Platform availability
SIGHUP is a POSIX signal. Hot-reload is available on macOS and Linux.
--hot-reload is not available on Windows.
Related
- Serve Flags — full flag reference
- Reload Configuration Without Restart — step-by-step workflow