fix(cli): fix 'gemini skills install' unknown argument error (#16537)

This commit is contained in:
N. Taylor Mullen
2026-01-13 13:14:14 -08:00
committed by GitHub
parent 92e31e3c4a
commit e8be252b75
8 changed files with 28 additions and 8 deletions

View File

@@ -108,7 +108,7 @@ describe('skills disable command', () => {
describe('disableCommand', () => {
it('should have correct command and describe', () => {
expect(disableCommand.command).toBe('disable <name>');
expect(disableCommand.command).toBe('disable <name> [--scope]');
expect(disableCommand.describe).toBe('Disables an agent skill.');
});
});

View File

@@ -31,7 +31,7 @@ export async function handleDisable(args: DisableArgs) {
}
export const disableCommand: CommandModule = {
command: 'disable <name>',
command: 'disable <name> [--scope]',
describe: 'Disables an agent skill.',
builder: (yargs) =>
yargs

View File

@@ -17,7 +17,7 @@ vi.mock('@google/gemini-cli-core', () => ({
}));
import { debugLogger } from '@google/gemini-cli-core';
import { handleInstall } from './install.js';
import { handleInstall, installCommand } from './install.js';
describe('skill install command', () => {
beforeEach(() => {
@@ -25,6 +25,17 @@ describe('skill install command', () => {
vi.spyOn(process, 'exit').mockImplementation(() => undefined as never);
});
describe('installCommand', () => {
it('should have correct command and describe', () => {
expect(installCommand.command).toBe(
'install <source> [--scope] [--path]',
);
expect(installCommand.describe).toBe(
'Installs an agent skill from a git repository URL or a local path.',
);
});
});
it('should call installSkill with correct arguments for user scope', async () => {
mockInstallSkill.mockResolvedValue([
{ name: 'test-skill', location: '/mock/user/skills/test-skill' },

View File

@@ -46,7 +46,7 @@ export async function handleInstall(args: InstallArgs) {
}
export const installCommand: CommandModule = {
command: 'install <source>',
command: 'install <source> [--scope] [--path]',
describe:
'Installs an agent skill from a git repository URL or a local path.',
builder: (yargs) =>

View File

@@ -184,7 +184,7 @@ describe('skills list command', () => {
const command = listCommand;
it('should have correct command and describe', () => {
expect(command.command).toBe('list');
expect(command.command).toBe('list [--all]');
expect(command.describe).toBe('Lists discovered agent skills.');
});
});

View File

@@ -63,7 +63,7 @@ export async function handleList(args: { all?: boolean }) {
}
export const listCommand: CommandModule = {
command: 'list',
command: 'list [--all]',
describe: 'Lists discovered agent skills.',
builder: (yargs) =>
yargs.option('all', {

View File

@@ -17,7 +17,7 @@ vi.mock('@google/gemini-cli-core', () => ({
}));
import { debugLogger } from '@google/gemini-cli-core';
import { handleUninstall } from './uninstall.js';
import { handleUninstall, uninstallCommand } from './uninstall.js';
describe('skill uninstall command', () => {
beforeEach(() => {
@@ -25,6 +25,15 @@ describe('skill uninstall command', () => {
vi.spyOn(process, 'exit').mockImplementation(() => undefined as never);
});
describe('uninstallCommand', () => {
it('should have correct command and describe', () => {
expect(uninstallCommand.command).toBe('uninstall <name> [--scope]');
expect(uninstallCommand.describe).toBe(
'Uninstalls an agent skill by name.',
);
});
});
it('should call uninstallSkill with correct arguments for user scope', async () => {
mockUninstallSkill.mockResolvedValue({
location: '/mock/user/skills/test-skill',

View File

@@ -41,7 +41,7 @@ export async function handleUninstall(args: UninstallArgs) {
}
export const uninstallCommand: CommandModule = {
command: 'uninstall <name>',
command: 'uninstall <name> [--scope]',
describe: 'Uninstalls an agent skill by name.',
builder: (yargs) =>
yargs