mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
feat(cli): improve skill enablement/disablement verbiage (#17192)
This commit is contained in:
@@ -234,7 +234,34 @@ describe('skillsCommand', () => {
|
||||
expect(context.ui.addItem).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
type: MessageType.INFO,
|
||||
text: 'Skill "skill1" disabled by adding it to the disabled list in workspace (/workspace) settings. Use "/skills reload" for it to take effect.',
|
||||
text: 'Skill "skill1" disabled by adding it to the disabled list in workspace (/workspace) settings. You can run "/skills reload" to refresh your current instance.',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should show reload guidance even if skill is already disabled', async () => {
|
||||
const disableCmd = skillsCommand.subCommands!.find(
|
||||
(s) => s.name === 'disable',
|
||||
)!;
|
||||
(
|
||||
context.services.settings as unknown as { merged: MergedSettings }
|
||||
).merged = createTestMergedSettings({
|
||||
skills: { enabled: true, disabled: ['skill1'] },
|
||||
});
|
||||
(
|
||||
context.services.settings as unknown as {
|
||||
workspace: { settings: { skills: { disabled: string[] } } };
|
||||
}
|
||||
).workspace.settings = {
|
||||
skills: { disabled: ['skill1'] },
|
||||
};
|
||||
|
||||
await disableCmd.action!(context, 'skill1');
|
||||
|
||||
expect(context.ui.addItem).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
type: MessageType.INFO,
|
||||
text: 'Skill "skill1" is already disabled. You can run "/skills reload" to refresh your current instance.',
|
||||
}),
|
||||
);
|
||||
});
|
||||
@@ -269,7 +296,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 workspace (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.',
|
||||
text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. You can run "/skills reload" to refresh your current instance.',
|
||||
}),
|
||||
);
|
||||
});
|
||||
@@ -308,7 +335,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 workspace (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.',
|
||||
text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. You can run "/skills reload" to refresh your current instance.',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -112,8 +112,9 @@ async function disableAction(
|
||||
result,
|
||||
(label, path) => `${label} (${path})`,
|
||||
);
|
||||
if (result.status === 'success') {
|
||||
feedback += ' Use "/skills reload" for it to take effect.';
|
||||
if (result.status === 'success' || result.status === 'no-op') {
|
||||
feedback +=
|
||||
' You can run "/skills reload" to refresh your current instance.';
|
||||
}
|
||||
|
||||
context.ui.addItem({
|
||||
@@ -153,8 +154,9 @@ async function enableAction(
|
||||
result,
|
||||
(label, path) => `${label} (${path})`,
|
||||
);
|
||||
if (result.status === 'success') {
|
||||
feedback += ' Use "/skills reload" for it to take effect.';
|
||||
if (result.status === 'success' || result.status === 'no-op') {
|
||||
feedback +=
|
||||
' You can run "/skills reload" to refresh your current instance.';
|
||||
}
|
||||
|
||||
context.ui.addItem({
|
||||
|
||||
Reference in New Issue
Block a user