mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 15:10:59 -07:00
fix(cli): fix 'gemini skills install' unknown argument error (#16537)
This commit is contained in:
@@ -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.');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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' },
|
||||
|
||||
@@ -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) =>
|
||||
|
||||
@@ -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.');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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', {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user