feat: phase 2 — automatisation: doctor --watch, schedule, service, orchestration, conteneurs (closes #55 #56 #57 #58 #59)

This commit is contained in:
2026-08-18 10:57:00 -04:00
parent 6a6676fc5d
commit 63dc36660b
27 changed files with 1408 additions and 35 deletions
+66 -9
View File
@@ -138,6 +138,18 @@ const START_FLAGS: &[HelpFlag] = &[
value: "",
desc: "Send a desktop notification once the agent has started",
},
HelpFlag {
short: "",
long: "--parallel",
value: "",
desc: "Start every group member back-to-back without waiting (issue #57)",
},
HelpFlag {
short: "",
long: "--container",
value: "",
desc: "Run inside the agent's container profile (issue #58)",
},
];
pub static HELP_SPECS: &[HelpSpec] = &[
@@ -623,7 +635,7 @@ pub static HELP_SPECS: &[HelpSpec] = &[
category: "Commands",
usage: "start {flags} <agent>",
about: "Start an agent (foreground by default, or detached with --background). --profile applies an environment profile (env + args).",
search_terms: &["launch", "begin"],
search_terms: &["launch", "begin", "group", "parallel", "healthcheck"],
flags: START_FLAGS,
subcommands: &[],
parameters: &[
@@ -633,7 +645,8 @@ pub static HELP_SPECS: &[HelpSpec] = &[
examples: &[
HelpExample { desc: "Start an agent in the background.", code: "start claude-code --background" },
HelpExample { desc: "Start with extra arguments.", code: "start claude-code --args \"--model sonnet\"" },
HelpExample { desc: "Start every agent of a group.", code: "start group:dev --background" },
HelpExample { desc: "Start every agent of a group, waiting each health check.", code: "start group:dev --background" },
HelpExample { desc: "Start a group without waiting.", code: "start group:dev --parallel" },
HelpExample { desc: "Start with an environment profile.", code: "start claude-code --profile prod" },
],
},
@@ -687,8 +700,11 @@ pub static HELP_SPECS: &[HelpSpec] = &[
category: "Commands",
usage: "run {flags} <agent> ...(args)",
about: "Run the agent command directly with the given arguments (no process management).",
search_terms: &["exec", "pass-through"],
flags: &[],
search_terms: &["exec", "pass-through", "container", "docker", "podman"],
flags: &[
HelpFlag { short: "", long: "--model", value: "MODEL", desc: "Local model to use (issue #71)" },
HelpFlag { short: "", long: "--container", value: "", desc: "Run inside the agent's container profile (issue #58)" },
],
subcommands: &[],
parameters: &[
HelpParam { name: "agent", typ: "string", desc: "Agent name or alias" },
@@ -704,17 +720,58 @@ pub static HELP_SPECS: &[HelpSpec] = &[
name: "doctor",
category: "Commands",
usage: "doctor {flags}",
about: "Check the environment: tools, config validity, paths, permissions.",
search_terms: &["check", "environment", "repair"],
about: "Check the environment; --watch re-runs periodically and alerts on failure.",
search_terms: &["health", "watch", "check", "environment", "repair"],
flags: &[
HelpFlag { short: "", long: "--fix", value: "", desc: "Attempt to repair problems (create directories, fix the state file)" },
HelpFlag { short: "", long: "--fix", value: "", desc: "Repair what can be repaired automatically" },
HelpFlag { short: "", long: "--watch", value: "SECONDS", desc: "Re-run the checks every N seconds; alert + event on failure, recover silently" },
],
subcommands: &[],
parameters: &[],
io: None,
examples: &[
HelpExample { desc: "Check the environment.", code: "doctor" },
HelpExample { desc: "Check and repair.", code: "doctor --fix" },
HelpExample { desc: "One-shot environment report.", code: "doctor" },
HelpExample { desc: "Watch every 30s, alerting on failure.", code: "doctor --watch 30" },
HelpExample { desc: "Repair what can be fixed.", code: "doctor --fix" },
],
},
HelpSpec {
name: "service",
category: "Commands",
usage: "service install|uninstall|status <agent> {flags}",
about: "Register an agent as a system service (systemd / launchd / Task Scheduler).",
search_terms: &["systemd", "autostart", "launchd", "task scheduler", "daemon"],
flags: &[
HelpFlag { short: "", long: "--autostart", value: "", desc: "Start the service at boot/logon" },
],
subcommands: &[],
parameters: &[
HelpParam { name: "agent", typ: "string", desc: "Agent name" },
],
io: None,
examples: &[
HelpExample { desc: "Install with autostart.", code: "service install claude-code --autostart" },
HelpExample { desc: "Remove the service.", code: "service uninstall claude-code" },
HelpExample { desc: "Check the service.", code: "service status claude-code" },
],
},
HelpSpec {
name: "schedule",
category: "Commands",
usage: "schedule add|list|remove <cmd...> {flags}",
about: "Plan am commands (daily) and run them with health reporting.",
search_terms: &["cron", "daily", "task scheduler", "scheduled", "planning"],
flags: &[
HelpFlag { short: "", long: "--at", value: "HH:MM", desc: "Time of day (default 08:00)" },
],
subcommands: &[],
parameters: &[],
io: None,
examples: &[
HelpExample { desc: "Daily update of every agent at 06:30.", code: "schedule add update --all --at 06:30" },
HelpExample { desc: "List the schedules.", code: "schedule list" },
HelpExample { desc: "Remove a schedule.", code: "schedule remove <id>" },
HelpExample { desc: "Run a schedule now (used by the OS task).", code: "schedule run <id>" },
],
},
HelpSpec {