docs(readme): document install-service verbs and config precedence

This commit is contained in:
mika kuns
2026-04-24 19:36:54 +02:00
parent c3e5bc2ba2
commit e7407b1b3a

View File

@@ -33,18 +33,58 @@ Put the resulting `claude-mailbox.exe` on your `PATH`.
## Daemon lifecycle ## Daemon lifecycle
The daemon is a normal console process. Pick whichever level of automation you want: Pick whichever level of automation you want:
1. **Manual.** Open a terminal, run `claude-mailbox serve`, leave it open. Stops when you close the window. 1. **Manual.** `claude-mailbox serve` in a terminal.
2. **Startup shortcut.** Drop a shortcut to `claude-mailbox serve` in `shell:startup` — starts on login. 2. **Startup shortcut.** Shortcut to `claude-mailbox serve` in `shell:startup`.
3. **Windows Service.** `sc.exe create ClaudeMailbox binPath= "C:\path\to\claude-mailbox.exe serve" start= auto` — same pattern ClaudeDo uses. 3. **Windows Service (recommended).** See below.
Defaults: port `47822`, bind `127.0.0.1`, database at `%USERPROFILE%\.claude-mailbox\mailbox.db`. All overridable: ### Windows Service
Install (admin shell):
``` ```
claude-mailbox serve [--port 47822] [--bind 127.0.0.1] [--db-path <path>] claude-mailbox install-service [--port 47822] [--bind 127.0.0.1] [--db-path <path>]
``` ```
This:
- Creates `%ProgramData%\ClaudeMailbox\` with ACLs for `LocalService`
- Seeds `mailbox.json` with the defaults (or your flag overrides) — only on first install
- Registers the service via `sc.exe create`, running as `NT AUTHORITY\LocalService` with `start= auto`
Control:
```
claude-mailbox start
claude-mailbox stop
claude-mailbox status # prints Running | Stopped | NotInstalled
claude-mailbox uninstall-service [--purge]
```
`--purge` additionally removes `%ProgramData%\ClaudeMailbox\` (config + database).
### Config precedence
```
CLI flag > mailbox.json > built-in defaults
```
The service is invoked with `serve --config C:\ProgramData\ClaudeMailbox\mailbox.json`, so editing that file and restarting the service is enough to change port/bind/db-path.
Interactive (console) runs without `--config` use `%USERPROFILE%\.claude-mailbox\mailbox.db` (unchanged from v0).
### Manual smoke test
```
claude-mailbox install-service
sc query ClaudeMailbox
claude-mailbox start
Invoke-WebRequest http://127.0.0.1:47822/health
claude-mailbox uninstall-service --purge
```
Defaults: port `47822`, bind `127.0.0.1`, database at `%ProgramData%\ClaudeMailbox\mailbox.db` (service) or `%USERPROFILE%\.claude-mailbox\mailbox.db` (console).
## Use from a Claude session ## Use from a Claude session
Drop this into your project's `.mcp.json` (one per session, different `X-Mailbox` values): Drop this into your project's `.mcp.json` (one per session, different `X-Mailbox` values):