Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(cli): add automations list subcommand

Richie McIlroy6126b6b68bc8
diff --git a/apps/cli/src/main.rs b/apps/cli/src/main.rs
index 55787e087..36c54ee3a 100644
--- a/apps/cli/src/main.rs
+++ b/apps/cli/src/main.rs
@@ -1,3 +1,4 @@
+mod automation;
mod credentials;
mod doctor;
mod export;
@@ -128,6 +129,8 @@ enum Commands {
Desktop(DesktopArgs),
/// Print the machine-readable capability & JSON-schema manifest for agents
Guide(FormatArgs),
+ /// List automation rules shared with Cap Desktop
+ Automations(AutomationsArgs),
/// Generate shell completion scripts
Completions(CompletionsArgs),
}
@@ -298,6 +301,18 @@ enum AuthCommands {
Status(FormatArgs),
}
+#[derive(Args)]
+struct AutomationsArgs {
+ #[command(subcommand)]
+ command: AutomationsCommands,
+}
+
+#[derive(Subcommand)]
+enum AutomationsCommands {
+ /// List the automation rules configured in Cap Desktop
+ List(FormatArgs),
+}
+
#[derive(Args)]
struct CompletionsArgs {
#[arg(value_enum)]
@@ -435,6 +450,12 @@ async fn run(cli: Cli) -> Result<(), String> {
let format = resolve_format(json, args.format);
finish_json(format, guide::run(format))
}
+ Commands::Automations(args) => match args.command {
+ AutomationsCommands::List(a) => {
+ let format = resolve_format(json, a.format);
+ finish_json(format, automation::list(format))
+ }
+ },
Commands::Completions(args) => {
args.run();
Ok(())