Skip to content

Bring Windows daemon autostart support to parity with macOS and Linux #15

Description

@OpenCow42

Context

Windows can currently run mbd persistently through a manually documented Windows Task Scheduler setup, validated on a clean Windows VM with the portable metabrain-1.2.0-windows-x86_64.zip artifact.

macOS and Linux have native mbd service management, but Windows does not yet have first-class CLI support. That leaves Windows users with more manual setup and less parity across platforms.

Current state

  • macOS: mbd service install/start/stop/status/uninstall --user
  • Linux: mbd service install/start/stop/status/uninstall --user
  • Windows: documented PowerShell + Task Scheduler commands only
  • Validated working Windows mechanism:
    • Scheduled task action executes absolute mbd.exe
    • Arguments: serve --config "<LOCALAPPDATA>\\metaBrain\\mbd.json"
    • Trigger: current user logon
    • Settings: restart on failure and no execution time limit

Desired behavior

Bring Windows daemon autostart support on par with macOS and Linux.

Suggested CLI shape:

mbd service print --user --config "$env:LOCALAPPDATA\metaBrain\mbd.json"
mbd service install --user --config "$env:LOCALAPPDATA\metaBrain\mbd.json" --now
mbd service status --user
mbd service start --user
mbd service stop --user
mbd service uninstall --user

Acceptance criteria

  • mbd service supports Windows user-level service management through Task Scheduler.
  • install --user --config ... --now creates or updates a metaBrain mbd scheduled task and starts it.
  • The task runs the absolute mbd.exe path with serve --config "<config path>".
  • The task restarts on failure and has no execution time limit.
  • status --user reports task state and whether 127.0.0.1:6374 is reachable.
  • print --user shows the scheduled task / PowerShell equivalent without installing it.
  • Tests cover command generation and Windows-specific behavior where practical.
  • Docs can be simplified to use native mbd service commands once implemented.

Notes

The documented manual setup lives in docs/daemon-autostart.md and can serve as the implementation reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions