mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-09 01:27:41 -07:00
Support for Built-in Agent Skills (#16045)
This commit is contained in:
@@ -23,12 +23,18 @@ async function listAction(
|
||||
context: CommandContext,
|
||||
args: string,
|
||||
): Promise<void | SlashCommandActionReturn> {
|
||||
const subCommand = args.trim();
|
||||
const subArgs = args.trim().split(/\s+/);
|
||||
|
||||
// Default to SHOWING descriptions. The user can hide them with 'nodesc'.
|
||||
let useShowDescriptions = true;
|
||||
if (subCommand === 'nodesc') {
|
||||
useShowDescriptions = false;
|
||||
let showAll = false;
|
||||
|
||||
for (const arg of subArgs) {
|
||||
if (arg === 'nodesc' || arg === '--nodesc') {
|
||||
useShowDescriptions = false;
|
||||
} else if (arg === 'all' || arg === '--all') {
|
||||
showAll = true;
|
||||
}
|
||||
}
|
||||
|
||||
const skillManager = context.services.config?.getSkillManager();
|
||||
@@ -43,7 +49,9 @@ async function listAction(
|
||||
return;
|
||||
}
|
||||
|
||||
const skills = skillManager.getAllSkills();
|
||||
const skills = showAll
|
||||
? skillManager.getAllSkills()
|
||||
: skillManager.getAllSkills().filter((s) => !s.isBuiltin);
|
||||
|
||||
const skillsListItem: HistoryItemSkillsList = {
|
||||
type: MessageType.SKILLS_LIST,
|
||||
@@ -53,6 +61,7 @@ async function listAction(
|
||||
disabled: skill.disabled,
|
||||
location: skill.location,
|
||||
body: skill.body,
|
||||
isBuiltin: skill.isBuiltin,
|
||||
})),
|
||||
showDescriptions: useShowDescriptions,
|
||||
};
|
||||
@@ -278,7 +287,8 @@ export const skillsCommand: SlashCommand = {
|
||||
subCommands: [
|
||||
{
|
||||
name: 'list',
|
||||
description: 'List available agent skills. Usage: /skills list [nodesc]',
|
||||
description:
|
||||
'List available agent skills. Usage: /skills list [nodesc] [all]',
|
||||
kind: CommandKind.BUILT_IN,
|
||||
action: listAction,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user