You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: agent runs as system service via kardianos/service
Integrate github.com/kardianos/service so the Go agent can install itself
as a system service (launchd on macOS, systemd on Linux, Windows service).
Three CLI modes:
- No args: interactive setup wizard that registers, installs, and starts
the service — the friend-friendly double-click path
- --run: foreground mode for Docker/service manager/development
- --service <action>: power-user install/uninstall/start/stop/restart/status
Automatically requests sudo when elevation is needed. Bakes PLOW_DATA_DIR
into the service env so the daemon finds credentials generated by the
installing user. Clears stale service state before reinstalling to avoid
launchd throttle errors from prior crash loops.
Copy file name to clipboardExpand all lines: agent/README.md
+46-10Lines changed: 46 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,21 +15,55 @@ The city publishes real-time plow locations on their [AVL map](https://map.stjoh
15
15
16
16
Your credentials are stored locally and reused on subsequent runs. The agent uses minimal resources and runs quietly in the background.
17
17
18
-
## Running
18
+
## Quick start (recommended)
19
19
20
-
### Binary
20
+
Download the latest release for your platform, then just run it:
21
21
22
-
Download the latest release for your platform, then:
22
+
```
23
+
./plow-agent
24
+
```
25
+
26
+
This launches an interactive setup wizard that:
27
+
1. Asks for the server URL (defaults to `https://plow.jackharrhy.dev`)
28
+
2. Prompts for a name to identify your agent (e.g. "alice-laptop")
29
+
3. Generates your cryptographic keypair
30
+
4. Registers with the server
31
+
5. Installs itself as a **system service** (systemd on Linux, launchd on macOS, Windows service)
32
+
6. Starts the service automatically
33
+
34
+
After setup, the agent runs in the background and survives reboots. You don't need to keep a terminal open.
35
+
36
+
**Note:** Installing a system service usually requires administrator/root privileges. On Linux, run with `sudo`. On macOS, you may get a permissions prompt. On Windows, run as Administrator.
37
+
38
+
## Running interactively
39
+
40
+
If you prefer not to install a service (or for Docker/development use):
This runs the agent in the foreground. Press Ctrl+C to stop.
47
+
48
+
## Managing the service
49
+
50
+
Once installed, you can control the service with:
23
51
24
52
```
25
-
./plow-agent --server https://plow.jackharrhy.dev
53
+
plow-agent --service status # Check if running
54
+
plow-agent --service stop # Stop the service
55
+
plow-agent --service start # Start the service
56
+
plow-agent --service restart # Restart the service
57
+
plow-agent --service uninstall # Remove the service
26
58
```
27
59
28
-
On first run it will ask for a name to identify your agent (e.g. "alice-laptop"). The keypair and name are saved to `~/.config/plow-agent/` so you only do this once.
60
+
### Viewing logs
29
61
30
-
That's it. Leave it running and the server operator will approve you.
0 commit comments