init+contexte : am init genere un agent-manager.yaml selon la stack detectee + contexte projet (git root, branche, stack) attache aux evenements et sessions (issue #8)

This commit is contained in:
2026-08-16 22:40:00 -04:00
parent 48e85555f7
commit 85d44f9e56
12 changed files with 338 additions and 10 deletions
+28 -1
View File
@@ -64,6 +64,7 @@ const COMMAND_DESCRIPTIONS: &[(&str, &str)] = &[
("stats", "usage statistics"),
("log", "read the event journal"),
("history", "search command history"),
("init", "generate a project config"),
("search", "search the catalog"),
("info", "agent details"),
("install", "install an agent"),
@@ -140,7 +141,7 @@ impl AmCompleter {
Self {
theme: std::cell::Cell::new(crate::theme::default_theme()),
commands: vec![
"list", "status", "sessions", "stats", "log", "history", "search", "info", "install", "uninstall", "update",
"list", "status", "sessions", "stats", "log", "history", "init", "search", "info", "install", "uninstall", "update",
"start", "stop", "restart", "run", "doctor", "config", "completion",
"self-update", "self-uninstall", "export", "import", "shell", "theme",
"ls", "dir", "cd", "ps", "where", "get", "help", "version", "exit",
@@ -1199,6 +1200,31 @@ fn handle_line(
"status" => Command::Status {
agent: rest.first().cloned(),
},
"sessions" => Command::Sessions {
agent: rest.first().cloned(),
project: opt_value("--project"),
status: opt_value("--status"),
show: opt_value("--show"),
},
"stats" => Command::Stats {
agent: rest.first().cloned(),
period: opt_value("--period"),
},
"log" => Command::Log {
agent: rest.first().cloned(),
kind: opt_value("--kind"),
since: opt_value("--since"),
limit: opt_value("--limit").and_then(|v| v.parse().ok()).unwrap_or(50),
},
"history" => Command::History {
kind: opt_value("--kind"),
cwd: opt_value("--cwd"),
search: opt_value("--search"),
failed: flag("--failed"),
session: opt_value("--session"),
limit: opt_value("--limit").and_then(|v| v.parse().ok()).unwrap_or(100),
},
"init" => Command::Init { force: flag("--force") },
"search" => Command::Search {
keyword: rest.join(" "),
category: None,
@@ -1308,6 +1334,7 @@ fn is_am_command(word: &str) -> bool {
| "stats"
| "log"
| "history"
| "init"
| "search"
| "info"
| "install"