Repository navigation
feat(cli): add stash web daemon supervisor controls - #7
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds tithe-style daemon supervisor controls to the stash web command, introducing --daemon, --status, --stop, and --foreground flags. The daemon mode spawns a detached supervisor process that manages the combined API/PWA web stack, auto-restarts it on unexpected exits, and exposes state via PID/state/log files. Tailnet URL reporting via tailscale status --json is added as a best-effort enhancement.
Changes:
- New
apps/cli/src/web.tswith full daemon lifecycle management: supervisor spawning, PID/state file persistence, restart backoff, Tailscale URL resolution, and stop/status operations. CliErrorextracted toapps/cli/src/error.ts;cli.tsupdated to wire three new internal subcommands (web-supervisor,web-runner) and the expandedwebcommand with all new flags.- Tests, README, AGENTS.md, CLI reference, and
.env.exampleupdated to document the new defaults and daemon controls.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
apps/cli/src/web.ts |
Core daemon implementation: supervisor loop, PID/state file management, Tailscale URL resolution, control flow for all new flags |
apps/cli/src/error.ts |
CliError extracted from cli.ts into its own module |
apps/cli/src/cli.ts |
Wires new web, web-supervisor, web-runner subcommands; removes inline CliError |
apps/cli/test/web.test.ts |
Integration and unit tests for daemon start/status/stop/idempotency and helper behavior |
docs/CLI_REFERENCE.md |
Updated CLI reference with all new flag forms and notes |
README.md |
Updated usage examples and runtime notes (contains a documentation bug — see comment) |
AGENTS.md |
Updated agent-facing guidance for daemon controls and host defaults |
.env.example |
Updated example STASH_WEB_HOST value to 0.0.0.0 |
.agents/notes.md |
New notes on daemon control parity and naming convention |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stash webdaemon controls with--daemon,--status,--stop, and--foreground.env.exampleTesting