[BE-3] CLI Commands, Webhooks, SSE Streaming & Infrastructure Hardening
Labels: backend, priority:medium, week-3-8
Assignee: Backend Dev
Context
Per Sections 13, 9, and the 10-Week Build Plan, the majority of CLI commands are not implemented (the current binary just starts the server). Additionally, webhook alerts, SSE streaming, process isolation, and production infrastructure features are needed for soft launch (Week 6) and public launch (Week 10).
1. CLI Commands (Section 13.3 — Week 1-6)
The Source of Truth defines 18 CLI commands. Currently only fishnet start (server startup) works.
Week 1-2 priority:
Week 3-4 priority:
Week 5-6 priority:
Use clap subcommands — extend existing CLI argument parser.
2. Webhook Alerts (Week 7-8)
3. SSE Streaming Support (Week 5-6)
LLM APIs (OpenAI, Anthropic) use Server-Sent Events for streaming responses. The proxy must pass these through.
4. Connection Pooling (Week 5-6)
5. Process Isolation (Section 9.2 — Week 1-2)
6. Distribution & Packaging (Week 9-10)
Acceptance Criteria
fishnet init → fishnet add-key → fishnet start → fishnet status works end-to-end
fishnet doctor validates a working OpenClaw + Fishnet setup
- Webhook alerts fire on critical events (prompt drift, budget exceeded)
- SSE streaming responses pass through proxy without breaking
- Fishnet runs as isolated system user with locked-down file permissions
- Pre-built binaries available for all 4 target platforms
[BE-3] CLI Commands, Webhooks, SSE Streaming & Infrastructure Hardening
Labels:
backend,priority:medium,week-3-8Assignee: Backend Dev
Context
Per Sections 13, 9, and the 10-Week Build Plan, the majority of CLI commands are not implemented (the current binary just starts the server). Additionally, webhook alerts, SSE streaming, process isolation, and production infrastructure features are needed for soft launch (Week 6) and public launch (Week 10).
1. CLI Commands (Section 13.3 — Week 1-6)
The Source of Truth defines 18 CLI commands. Currently only
fishnet start(server startup) works.Week 1-2 priority:
fishnet init— first-time setup wizard:fishnet.toml_fishnet(macOS) orfishnet(Linux)fishnet add-key— interactive: prompt for service, name, key; encrypt and store in vaultfishnet list-keys— print table of stored credentials (name + service only, never keys)fishnet remove-key <name>— remove credential from vault with confirmation promptfishnet stop— graceful shutdown (send signal to running process)Week 3-4 priority:
fishnet status— show: running/stopped, uptime, today's spend per service, today's request count, active warningsfishnet policy edit— openfishnet.tomlin$EDITORfishnet audit— print last 20 audit entries to terminal (formatted table)fishnet audit export— export full audit log as CSV to stdout or fileWeek 5-6 priority:
fishnet doctor— check OpenClaw is configured correctly:OPENAI_BASE_URLpointed to localhost:8472?fishnet backup— export encrypted vault backup to filefishnet restore <file>— restore vault from backup (with confirmation)fishnet service install— install auto-start (launchd plist on macOS, systemd unit on Linux)fishnet service uninstall— remove auto-startfishnet firewall enable— configure macOSpfor Linuxiptablesso agent process can ONLY reach localhostfishnet firewall disable— remove network restrictionsUse
clapsubcommands — extend existing CLI argument parser.2. Webhook Alerts (Week 7-8)
fishnet.toml:POST /api/alerts/webhook-config— save webhook URLsPOST /api/alerts/webhook-test— send test message3. SSE Streaming Support (Week 5-6)
LLM APIs (OpenAI, Anthropic) use Server-Sent Events for streaming responses. The proxy must pass these through.
stream: truein request body4. Connection Pooling (Week 5-6)
reqwestconnection pool orhyperconnection pooling5. Process Isolation (Section 9.2 — Week 1-2)
fishnet initcreates dedicated system user:_fishnetsystem user viadsclfishnetsystem user viauseradd -r -s /bin/false/Library/Application Support/Fishnet/owned by_fishnet, mode 700/var/lib/fishnet/owned byfishnet, mode 7006. Distribution & Packaging (Week 9-10)
brew install fishnetcurl -fsSL https://fishnet.dev/install.sh | shAcceptance Criteria
fishnet init→fishnet add-key→fishnet start→fishnet statusworks end-to-endfishnet doctorvalidates a working OpenClaw + Fishnet setup