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())
|
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 self.working_mode.is_repl() {
|
|
||||||
if is_new {
|
if is_new {
|
||||||
println!("✓ Created skill at '{}'.", path.display());
|
println!("✓ Created skill at '{}'.", path.display());
|
||||||
} else {
|
} else {
|
||||||
println!("✓ Saved skill at '{}'.", path.display());
|
println!("✓ Saved skill at '{}'.", path.display());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -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?;
|
||||||
|
|||||||
Reference in New Issue
Block a user