feat: Modified --skill CLI to allow users to specify skills to start the REPL or CLI with.

This commit is contained in:
2026-06-01 14:20:45 -06:00
parent bf8dad2a4f
commit 588c69ea6c
2 changed files with 11 additions and 10 deletions
+4 -9
View File
@@ -2495,18 +2495,13 @@ impl RequestContext {
format!("Failed to scaffold skill at {}", path.display()) format!("Failed to scaffold skill at {}", path.display())
})?; })?;
} }
let editor = app.editor()?; let editor = app.editor()?;
edit_file(&editor, &path)?; edit_file(&editor, &path)?;
if is_new {
if self.working_mode.is_repl() { println!("✓ Created skill at '{}'.", path.display());
if is_new { } else {
println!("Created skill at '{}'.", path.display()); println!("Saved skill at '{}'.", path.display());
} else {
println!("✓ Saved skill at '{}'.", path.display());
}
} }
Ok(()) Ok(())
} }
+7 -1
View File
@@ -197,7 +197,9 @@ async fn run(
println!("{skills}"); println!("{skills}");
return Ok(()); 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); let app = Arc::clone(&ctx.app.config);
ctx.upsert_skill(app.as_ref(), name)?; ctx.upsert_skill(app.as_ref(), name)?;
return Ok(()); return Ok(());
@@ -315,6 +317,10 @@ async fn run(
.await?; .await?;
} }
if let Some(name) = &cli.skill {
ctx.load_skill_repl(name, abort_signal.clone()).await?;
}
match is_repl { match is_repl {
false => { false => {
let mut input = create_input(&ctx, text, &cli.file, abort_signal.clone()).await?; let mut input = create_input(&ctx, text, &cli.file, abort_signal.clone()).await?;