Skip to content

feat(cli): add stash web daemon supervisor controls - #7

Merged
sergdort merged 4 commits into
mainfrom
codex/web-daemon-supervisor
Mar 9, 2026
Merged

sergdort merged 4 commits into
mainfrom
codex/web-daemon-supervisor

Conversation

@sergdort

@sergdort sergdort commented Mar 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • add tithe-style stash web daemon controls with --daemon, --status, --stop, and --foreground
  • supervise the combined API/PWA stack in a detached runner with PID/state/log files and best-effort Tailnet access reporting
  • add daemon-focused CLI tests and update README, CLI reference, AGENTS, and .env.example

Testing

  • pnpm run check

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts with full daemon lifecycle management: supervisor spawning, PID/state file persistence, restart backoff, Tailscale URL resolution, and stop/status operations.
  • CliError extracted to apps/cli/src/error.ts; cli.ts updated to wire three new internal subcommands (web-supervisor, web-runner) and the expanded web command with all new flags.
  • Tests, README, AGENTS.md, CLI reference, and .env.example updated 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.

Comment thread apps/cli/src/web.ts Outdated
Comment thread apps/cli/test/web.test.ts
Comment thread apps/cli/src/web.ts Outdated
Comment thread apps/cli/src/web.ts Outdated
Comment thread README.md Outdated
@sergdort
sergdort merged commit 183082a into main Mar 9, 2026
1 check passed
@sergdort
sergdort deleted the codex/web-daemon-supervisor branch March 9, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants