feat(install): auto-start the dashboard on boot via systemd, no Claude Code needed

Adds ccam service install/uninstall/status for checkout installs and wires
the same systemd --user unit into plugin-bootstrap.js, so plugin-installed
colleagues get boot persistence too instead of needing a Claude Code
session to (re)start the server after every reboot.
This commit is contained in:
2026-08-28 16:15:45 +07:00
parent 8bd74a57e6
commit 1cb7ac0a4b
5 changed files with 303 additions and 7 deletions
+22
View File
@@ -71,6 +71,27 @@ at its own runtime directory). `postinstall` writes the Claude Code hook entries
that feed the dashboard — do not run it when the `ccam` plugin is installed, or
every event is counted twice.
### Run as a service (auto-start on boot)
`npm start` only runs while that terminal (or `ccam start`'s background
process) is alive — a reboot loses it. On Linux, `ccam service install` sets
up a systemd `--user` service instead, so `:4820` is up again on its own after
every reboot, with no manual step and no Claude Code (or any AI tool) needed
to trigger it:
```bash
npm run build # the service serves the built client, same as npm start
ccam service install # writes + enables ~/.config/systemd/user/ccam.service
ccam service status # systemctl --user status ccam
ccam service uninstall # disable and remove it
```
`ccam service install` also tries `loginctl enable-linger` so the service
starts on a cold boot, before anyone logs in; if that needs elevated rights on
your machine it prints the `sudo loginctl enable-linger <user>` command to run
once yourself. Plugin installs get the same persistence automatically — see
[Auto-start on boot](docs/PLUGINS.md#auto-start-on-boot) in `docs/PLUGINS.md`.
## The CLI
`ccam` is linked by `npm run setup`; otherwise call `node bin/ccam.js`.
@@ -78,6 +99,7 @@ every event is counted twice.
```bash
ccam status # is the dashboard up
ccam start # start it in the background and wait for healthy
ccam service install # auto-start on boot via systemd --user (Linux)
ccam sessions # recent sessions
ccam lanes # lanes with stage and progress
ccam lanes pipeline # this lane's pipeline template, or switch it