Skip to main content

Crate skill_embed_clap

Crate skill_embed_clap 

Source
Expand description

A clap command for the agent skills embedded by skill_embed.

use clap::Command;

let cli = Command::new("mytool").subcommand(skill_embed_clap::command(&SKILLS));
let matches = cli.get_matches();
if let Some((name, args)) = matches.subcommand()
    && name == SKILLS.command_name()
{
    skill_embed_clap::run(&SKILLS, args)?;
}

The flags are the ones gh skill install defines, so a user who knows that command already knows this one. What each subcommand prints comes from skill_embed::render_results and skill_embed::render_status, and goes to the writer skill_embed::Installer::with_output names, so every front end reports the same way to the same place.

Functionsยง

command
The skill command, with install, uninstall and list beneath it.
options
Reads the flags clap parsed.
run
Runs whichever subcommand clap matched, and prints what it did.