secret : trousseau OS (keyring) + injection @secret au start/run (issue #36) - valeurs jamais affichees ni journalisees, mock testable, fallback clair sans trousseau
This commit is contained in:
+19
-1
@@ -71,6 +71,7 @@ const COMMAND_DESCRIPTIONS: &[(&str, &str)] = &[
|
||||
("history", "search command history"),
|
||||
("init", "generate a project config"),
|
||||
("alias", "manage aliases"),
|
||||
("secret", "manage secrets"),
|
||||
("open", "open the install dir"),
|
||||
("watch", "supervise an agent"),
|
||||
("search", "search the catalog"),
|
||||
@@ -149,7 +150,7 @@ impl AmCompleter {
|
||||
Self {
|
||||
theme: std::cell::Cell::new(crate::theme::default_theme()),
|
||||
commands: vec![
|
||||
"list", "status", "sessions", "stats", "top", "report", "projects", "timeline", "log", "logs", "history", "init", "alias", "open", "watch", "search", "info", "install", "uninstall", "update",
|
||||
"list", "status", "sessions", "stats", "top", "report", "projects", "timeline", "log", "logs", "history", "init", "alias", "secret", "open", "watch", "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",
|
||||
@@ -1239,6 +1240,22 @@ fn handle_line(
|
||||
notify: flag("--notify"),
|
||||
interval: opt_value("--interval").and_then(|v| v.parse().ok()).unwrap_or(5),
|
||||
},
|
||||
"secret" => match rest.first().map(|s| s.as_str()) {
|
||||
Some("set") if rest.len() >= 2 => Command::Secret(crate::cli::SecretCmd::Set {
|
||||
name: rest[1].clone(),
|
||||
agent: opt_value("--agent").unwrap_or_default(),
|
||||
value: opt_value("--value").unwrap_or_default(),
|
||||
}),
|
||||
Some("unset") if rest.len() >= 2 => Command::Secret(crate::cli::SecretCmd::Unset {
|
||||
name: rest[1].clone(),
|
||||
agent: opt_value("--agent").unwrap_or_default(),
|
||||
}),
|
||||
Some("list") | None => Command::Secret(crate::cli::SecretCmd::List),
|
||||
_ => {
|
||||
app.log.error("usage: secret set NAME --agent A --value V | secret unset NAME --agent A | secret list");
|
||||
return Ok(false);
|
||||
}
|
||||
},
|
||||
"alias" => match rest.first().map(|s| s.as_str()) {
|
||||
Some("add") if rest.len() >= 3 => Command::Alias(crate::cli::AliasCmd::Add {
|
||||
name: rest[1].clone(),
|
||||
@@ -1417,6 +1434,7 @@ fn is_am_command(word: &str) -> bool {
|
||||
| "history"
|
||||
| "init"
|
||||
| "alias"
|
||||
| "secret"
|
||||
| "open"
|
||||
| "watch"
|
||||
| "search"
|
||||
|
||||
Reference in New Issue
Block a user