feat: introduce evie daemon subcommand #62

Merged
weiwen merged 2 commits from sandcastle/issue-56 into main 2026-07-08 02:34:15 +08:00
Owner

Summary

  • Adds a daemon subcommand so the binary can be either the long-running Daemon (evie daemon) or, in future issues, a short-lived CLI issuing Verbs to a running Daemon
  • Moves --config flag under evie daemon; bare evie prints help
  • Updates the NixOS module to invoke evie daemon --config … in ExecStart
  • 4 new CLI-parse unit tests; all 130 tests pass

Key decisions

  • subcommand_required = true + arg_required_else_help = true: bare evie prints help (cleaner than silently aliasing to daemon)
  • DaemonArgs holds --config; run_daemon() extracted from main() for clear separation
  • No behavior change inside run_daemon — identical to the pre-split startup path

Test plan

  • just fmt passes
  • just check passes: 130 tests, 0 failures
  • evie daemon / evie daemon --config FILE / evie daemon -c FILE parse correctly
  • Bare evie (no subcommand) returns an error (help is printed)

Closes #56

## Summary - Adds a `daemon` subcommand so the binary can be either the long-running Daemon (`evie daemon`) or, in future issues, a short-lived CLI issuing Verbs to a running Daemon - Moves `--config` flag under `evie daemon`; bare `evie` prints help - Updates the NixOS module to invoke `evie daemon --config …` in `ExecStart` - 4 new CLI-parse unit tests; all 130 tests pass ## Key decisions - `subcommand_required = true` + `arg_required_else_help = true`: bare `evie` prints help (cleaner than silently aliasing to `daemon`) - `DaemonArgs` holds `--config`; `run_daemon()` extracted from `main()` for clear separation - No behavior change inside `run_daemon` — identical to the pre-split startup path ## Test plan - [x] `just fmt` passes - [x] `just check` passes: 130 tests, 0 failures - [x] `evie daemon` / `evie daemon --config FILE` / `evie daemon -c FILE` parse correctly - [x] Bare `evie` (no subcommand) returns an error (help is printed) Closes #56
feat: introduce evie daemon subcommand (#56)
All checks were successful
CI / check (pull_request) Successful in 1m37s
PR Triage — label changes-requested reviews / triage-review (pull_request) Successful in 1s
a64b5ae1ee
Closes #56 (parent PRD: #55)

Introduce a top-level clap subcommand layer so the binary can act as
either the long-running Daemon (`evie daemon`) or, in future issues, a
short-lived CLI issuing a single Verb.

Key decisions:
- `evie daemon` runs today's full startup path unchanged (config load,
  Telegram dispatcher, HTTP API, session manager, idle cleanup, signal
  handling); `--config` flag moves to the `daemon` subcommand.
- Bare `evie` (no subcommand) prints help via
  `subcommand_required = true` + `arg_required_else_help = true`.
- NixOS module updated: ExecStart now invokes `evie daemon --config …`.
- 4 CLI-parse unit tests added: daemon with/without config, short -c
  flag, and bare invocation requiring a subcommand.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
docs(readme): update run examples to evie daemon subcommand
All checks were successful
CI / check (pull_request) Successful in 1m24s
PR Triage — label changes-requested reviews / triage-review (pull_request) Successful in 1s
358f7439a7
The `evie daemon` subcommand made bare `evie` print help and
`evie --config` invalid. Update the two Running / Test Fixtures
examples to match, alongside the already-updated NixOS ExecStart.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
weiwen merged commit 4be07a2c5c into main 2026-07-08 02:34:15 +08:00
weiwen deleted branch sandcastle/issue-56 2026-07-08 02:34:15 +08:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
weiwen/evie!62
No description provided.