From 3e2f4eb8ba12bded08183f3e71163cb0f7b00b31 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 7 Jan 2026 22:30:33 -0800 Subject: [PATCH] [Skills] UX Polishing: Transparent feedback and CLI refinements (#15954) --- .../cli/src/commands/skills/disable.test.ts | 3 ++- packages/cli/src/commands/skills/disable.ts | 22 +++++++++++-------- .../cli/src/commands/skills/enable.test.ts | 4 ++-- packages/cli/src/commands/skills/enable.ts | 10 ++++++++- .../cli/src/ui/commands/skillsCommand.test.ts | 6 ++--- packages/cli/src/ui/commands/skillsCommand.ts | 4 ++-- 6 files changed, 31 insertions(+), 18 deletions(-) diff --git a/packages/cli/src/commands/skills/disable.test.ts b/packages/cli/src/commands/skills/disable.test.ts index 325a93499d..4fa8403702 100644 --- a/packages/cli/src/commands/skills/disable.test.ts +++ b/packages/cli/src/commands/skills/disable.test.ts @@ -60,6 +60,7 @@ describe('skills disable command', () => { const mockSettings = { forScope: vi.fn().mockReturnValue({ settings: { skills: { disabled: [] } }, + path: '/user/settings.json', }), setValue: vi.fn(), }; @@ -79,7 +80,7 @@ describe('skills disable command', () => { ); expect(emitConsoleLog).toHaveBeenCalledWith( 'log', - 'Skill "skill1" disabled by adding it to the disabled list in user settings.', + 'Skill "skill1" disabled by adding it to the disabled list in user (/user/settings.json) settings. Restart required to take effect.', ); }); diff --git a/packages/cli/src/commands/skills/disable.ts b/packages/cli/src/commands/skills/disable.ts index ef100c74f2..f1831654f5 100644 --- a/packages/cli/src/commands/skills/disable.ts +++ b/packages/cli/src/commands/skills/disable.ts @@ -5,19 +5,16 @@ */ import type { CommandModule } from 'yargs'; -import { - loadSettings, - SettingScope, - type LoadableSettingScope, -} from '../../config/settings.js'; +import { loadSettings, SettingScope } from '../../config/settings.js'; import { debugLogger } from '@google/gemini-cli-core'; import { exitCli } from '../utils.js'; import { disableSkill } from '../../utils/skillSettings.js'; import { renderSkillActionFeedback } from '../../utils/skillUtils.js'; +import chalk from 'chalk'; interface DisableArgs { name: string; - scope: LoadableSettingScope; + scope: SettingScope; } export async function handleDisable(args: DisableArgs) { @@ -26,7 +23,14 @@ export async function handleDisable(args: DisableArgs) { const settings = loadSettings(workspaceDir); const result = disableSkill(settings, name, scope); - debugLogger.log(renderSkillActionFeedback(result, (label, _path) => label)); + let feedback = renderSkillActionFeedback( + result, + (label, path) => `${chalk.bold(label)} (${chalk.dim(path)})`, + ); + if (result.status === 'success') { + feedback += ' Restart required to take effect.'; + } + debugLogger.log(feedback); } export const disableCommand: CommandModule = { @@ -43,11 +47,11 @@ export const disableCommand: CommandModule = { alias: 's', describe: 'The scope to disable the skill in (user or project).', type: 'string', - default: 'user', + default: 'project', choices: ['user', 'project'], }), handler: async (argv) => { - const scope: LoadableSettingScope = + const scope = argv['scope'] === 'project' ? SettingScope.Workspace : SettingScope.User; await handleDisable({ name: argv['name'] as string, diff --git a/packages/cli/src/commands/skills/enable.test.ts b/packages/cli/src/commands/skills/enable.test.ts index 35c7d5b0f5..b3a96d5967 100644 --- a/packages/cli/src/commands/skills/enable.test.ts +++ b/packages/cli/src/commands/skills/enable.test.ts @@ -81,7 +81,7 @@ describe('skills enable command', () => { ); expect(emitConsoleLog).toHaveBeenCalledWith( 'log', - 'Skill "skill1" enabled by removing it from the disabled list in user and project settings.', + 'Skill "skill1" enabled by removing it from the disabled list in user (/user/settings.json) and project (/project/settings.json) settings. Restart required to take effect.', ); }); @@ -122,7 +122,7 @@ describe('skills enable command', () => { ); expect(emitConsoleLog).toHaveBeenCalledWith( 'log', - 'Skill "skill1" enabled by removing it from the disabled list in project and user settings.', + 'Skill "skill1" enabled by removing it from the disabled list in project (/workspace/settings.json) and user (/user/settings.json) settings. Restart required to take effect.', ); }); diff --git a/packages/cli/src/commands/skills/enable.ts b/packages/cli/src/commands/skills/enable.ts index 8bfcaa7c2b..1e1cc12e49 100644 --- a/packages/cli/src/commands/skills/enable.ts +++ b/packages/cli/src/commands/skills/enable.ts @@ -10,6 +10,7 @@ import { debugLogger } from '@google/gemini-cli-core'; import { exitCli } from '../utils.js'; import { enableSkill } from '../../utils/skillSettings.js'; import { renderSkillActionFeedback } from '../../utils/skillUtils.js'; +import chalk from 'chalk'; interface EnableArgs { name: string; @@ -21,7 +22,14 @@ export async function handleEnable(args: EnableArgs) { const settings = loadSettings(workspaceDir); const result = enableSkill(settings, name); - debugLogger.log(renderSkillActionFeedback(result, (label, _path) => label)); + let feedback = renderSkillActionFeedback( + result, + (label, path) => `${chalk.bold(label)} (${chalk.dim(path)})`, + ); + if (result.status === 'success') { + feedback += ' Restart required to take effect.'; + } + debugLogger.log(feedback); } export const enableCommand: CommandModule = { diff --git a/packages/cli/src/ui/commands/skillsCommand.test.ts b/packages/cli/src/ui/commands/skillsCommand.test.ts index 511effd0b6..e90c695e0c 100644 --- a/packages/cli/src/ui/commands/skillsCommand.test.ts +++ b/packages/cli/src/ui/commands/skillsCommand.test.ts @@ -182,7 +182,7 @@ describe('skillsCommand', () => { expect(context.ui.addItem).toHaveBeenCalledWith( expect.objectContaining({ type: MessageType.INFO, - text: 'Skill "skill1" disabled by adding it to the disabled list in project settings. Use "/skills reload" for it to take effect.', + text: 'Skill "skill1" disabled by adding it to the disabled list in project (/workspace) settings. Use "/skills reload" for it to take effect.', }), expect.any(Number), ); @@ -211,7 +211,7 @@ describe('skillsCommand', () => { expect(context.ui.addItem).toHaveBeenCalledWith( expect.objectContaining({ type: MessageType.INFO, - text: 'Skill "skill1" enabled by removing it from the disabled list in project and user settings. Use "/skills reload" for it to take effect.', + text: 'Skill "skill1" enabled by removing it from the disabled list in project (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.', }), expect.any(Number), ); @@ -251,7 +251,7 @@ describe('skillsCommand', () => { expect(context.ui.addItem).toHaveBeenCalledWith( expect.objectContaining({ type: MessageType.INFO, - text: 'Skill "skill1" enabled by removing it from the disabled list in project and user settings. Use "/skills reload" for it to take effect.', + text: 'Skill "skill1" enabled by removing it from the disabled list in project (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.', }), expect.any(Number), ); diff --git a/packages/cli/src/ui/commands/skillsCommand.ts b/packages/cli/src/ui/commands/skillsCommand.ts index 35a41f461b..d769b9941d 100644 --- a/packages/cli/src/ui/commands/skillsCommand.ts +++ b/packages/cli/src/ui/commands/skillsCommand.ts @@ -96,7 +96,7 @@ async function disableAction( let feedback = renderSkillActionFeedback( result, - (label, _path) => `${label}`, + (label, path) => `${label} (${path})`, ); if (result.status === 'success') { feedback += ' Use "/skills reload" for it to take effect.'; @@ -131,7 +131,7 @@ async function enableAction( let feedback = renderSkillActionFeedback( result, - (label, _path) => `${label}`, + (label, path) => `${label} (${path})`, ); if (result.status === 'success') { feedback += ' Use "/skills reload" for it to take effect.';