feat: Modified --skill CLI to allow users to specify skills to start the REPL or CLI with.
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user