From 5722e6aadfa152e175f70e037e504835997836e9 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Mon, 1 Jun 2026 14:20:45 -0600 Subject: [PATCH] feat: Modified --skill CLI to allow users to specify skills to start the REPL or CLI with. --- src/config/request_context.rs | 13 ++++--------- src/main.rs | 8 +++++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/config/request_context.rs b/src/config/request_context.rs index dd0efef..5a5b192 100644 --- a/src/config/request_context.rs +++ b/src/config/request_context.rs @@ -2495,18 +2495,13 @@ impl RequestContext { format!("Failed to scaffold skill at {}", path.display()) })?; } - let editor = app.editor()?; edit_file(&editor, &path)?; - - if self.working_mode.is_repl() { - if is_new { - println!("✓ Created skill at '{}'.", path.display()); - } else { - println!("✓ Saved skill at '{}'.", path.display()); - } + if is_new { + println!("✓ Created skill at '{}'.", path.display()); + } else { + println!("✓ Saved skill at '{}'.", path.display()); } - Ok(()) } diff --git a/src/main.rs b/src/main.rs index 2eb65e4..9bc596b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -197,7 +197,9 @@ async fn run( println!("{skills}"); return Ok(()); } - if let Some(name) = &cli.skill { + if let Some(name) = &cli.skill + && !paths::has_skill(name) + { let app = Arc::clone(&ctx.app.config); ctx.upsert_skill(app.as_ref(), name)?; return Ok(()); @@ -315,6 +317,10 @@ async fn run( .await?; } + if let Some(name) = &cli.skill { + ctx.load_skill_repl(name, abort_signal.clone()).await?; + } + match is_repl { false => { let mut input = create_input(&ctx, text, &cli.file, abort_signal.clone()).await?;