CLI to list skills with token counts (#9326)

This commit is contained in:
Jack Amadeo
2026-05-28 10:09:11 -04:00
committed by GitHub
parent 27d68ba636
commit d10d009b97
3 changed files with 252 additions and 0 deletions
+23
View File
@@ -29,6 +29,7 @@ use crate::commands::schedule::{
handle_schedule_sessions,
};
use crate::commands::session::{handle_session_list, handle_session_remove};
use crate::commands::skills::handle_skills_list;
use crate::recipes::extract_from_cli::extract_recipe_info_from_cli;
use crate::recipes::recipe::{explain_recipe, render_recipe_as_yaml};
use crate::session::{build_session, SessionBuilderConfig};
@@ -699,6 +700,13 @@ enum PluginCommand {
},
}
#[derive(Subcommand)]
enum SkillsCommand {
/// List all skills available to the goose agent
#[command(about = "List all skills available to the goose agent")]
List,
}
#[derive(Subcommand)]
enum RecipeCommand {
/// Validate a recipe file
@@ -910,6 +918,13 @@ enum Command {
command: RecipeCommand,
},
/// Skill utilities
#[command(about = "Skill utilities")]
Skills {
#[command(subcommand)]
command: SkillsCommand,
},
/// Manage plugins
#[command(about = "Manage plugins")]
Plugin {
@@ -1273,6 +1288,7 @@ fn get_command_name(command: &Option<Command>) -> &'static str {
#[cfg(feature = "update")]
Some(Command::Update { .. }) => "update",
Some(Command::Recipe { .. }) => "recipe",
Some(Command::Skills { .. }) => "skills",
Some(Command::Plugin { .. }) => "plugin",
Some(Command::Term { .. }) => "term",
Some(Command::Tui { .. }) => "tui",
@@ -1799,6 +1815,12 @@ fn handle_recipe_subcommand(command: RecipeCommand) -> Result<()> {
}
}
async fn handle_skills_subcommand(command: SkillsCommand) -> Result<()> {
match command {
SkillsCommand::List => handle_skills_list().await,
}
}
async fn handle_term_subcommand(command: TermCommand) -> Result<()> {
match command {
TermCommand::Init {
@@ -2129,6 +2151,7 @@ pub async fn cli() -> anyhow::Result<()> {
Ok(())
}
Some(Command::Recipe { command }) => handle_recipe_subcommand(command),
Some(Command::Skills { command }) => handle_skills_subcommand(command).await,
Some(Command::Plugin { command }) => handle_plugin_subcommand(command),
Some(Command::Term { command }) => handle_term_subcommand(command).await,
Some(Command::Tui { args }) => crate::commands::tui::handle_tui(args),