loom serve command supports subcommands for daemon lifecycle management, log viewing, and boot auto-start.
Running modes
- Foreground
- Background daemon
- Daemon + auto-start
Run the server in the current terminal session. Stops when you press Ctrl+C or close the terminal.
Port configuration
The server port can be specified in two ways (highest priority wins):- Command-line flag:
loom serve --port 9000 start - Config file:
server.portinconfigs/loom.yaml - Default:
8000
--port flag is defined on the serve group, so it works with all subcommands and foreground mode.
Daemon management
Start
--host, --port, and --template are defined on the parent serve command and apply to all subcommands. Pass --autostart to also enable boot auto-start via systemd.
Stop
--remove-autostart to also disable the systemd auto-start service.
Restart
Status
- Running state and PID
- Log file location
- Uptime, memory usage, and CPU (when
psutilis installed) - Whether auto-start is enabled
Install
psutil (pip install psutil) for uptime, memory, and CPU metrics in the status output.Boot auto-start
Use the--autostart flag on start to register a systemd user service:
- Starts the daemon immediately
- Generates a systemd unit file at
~/.config/systemd/user/loom.service - Enables the service with
systemctl --user enable loom - Runs
loginctl enable-lingerso the service survives user logout
Manual systemd control
After enabling auto-start, you can also manage the service directly with systemctl:Log management
View recent server output:~/.loom/loom.log
File locations
| File | Purpose |
|---|---|
~/.loom/loom.pid | PID of the running daemon process |
~/.loom/loom.log | Server stdout and stderr output |
~/.config/systemd/user/loom.service | Systemd unit file (created by --autostart) |
Command reference
| Command | Description |
|---|---|
loom serve | Start in foreground (Ctrl+C to stop) |
loom serve start | Start as background daemon |
loom serve start --autostart | Start daemon + enable boot auto-start (systemd) |
loom serve stop | Stop the daemon |
loom serve stop --remove-autostart | Stop daemon + disable boot auto-start |
loom serve restart | Restart the daemon |
loom serve status | Show status, PID, uptime, memory, auto-start state |
loom serve logs | View logs (-f follow, -n line count) |