google-gemini/gemini-cli · error
The skill name must be provided.
Error message
The skill name must be provided.
What it means
Thrown by the yargs `.check()` validator on the `gemini skills uninstall <name>` command when the positional `name` argument is missing or falsy. The check enforces `demandOption: true` on the positional; uninstall needs a concrete skill identifier to look up and remove.
Source
Thrown at packages/cli/src/commands/skills/uninstall.ts:60
export const uninstallCommand: CommandModule = {
command: 'uninstall <name> [--scope]',
describe: 'Uninstalls an agent skill by name.',
builder: (yargs) =>
yargs
.positional('name', {
describe: 'The name of the skill to uninstall.',
type: 'string',
demandOption: true,
})
.option('scope', {
describe:
'The scope to uninstall the skill from. Defaults to "user" (global).',
choices: ['user', 'workspace'],
default: 'user',
})
.check((argv) => {
if (!argv.name) {
throw new Error('The skill name must be provided.');
}
return true;
}),
handler: async (argv) => {
await handleUninstall({
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
name: argv['name'] as string,
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
scope: argv['scope'] as 'user' | 'workspace',
});
await exitCli();
},
};
View on GitHub (pinned to 5024443c72)
Solutions
- List installed skills first (`gemini skills list`) then uninstall by exact name: `gemini skills uninstall my-skill`.
- Confirm the name is spelled exactly as installed (case-sensitive).
- Pass a non-empty string when invoking the handler programmatically.
Example fix
// before gemini skills uninstall // after gemini skills uninstall my-skill
Defensive patterns
Strategy: validation
Validate before calling
const name = typeof argv.name === 'string' ? argv.name.trim() : '';
if (!name) {
console.error('Usage: gemini skills uninstall <name>');
process.exit(2);
} Type guard
function hasSkillName(argv: unknown): argv is { name: string } {
return (
typeof argv === 'object' && argv !== null &&
typeof (argv as { name?: unknown }).name === 'string' &&
(argv as { name: string }).name.trim().length > 0
);
} Prevention
- Run `gemini skills list` first to confirm exact names.
- Pass the exact stored name (case-sensitive).
- Build the uninstall command from the list output rather than typing from memory.
When it happens
Trigger: Running `gemini skills uninstall` with no positional, an empty string, or programmatically invoking `uninstallCommand` without a name.
Common situations: Forgetting the skill name; copying an uninstall command but dropping the argument; referencing an unset shell variable; assuming a default such as the most recently installed skill.
Related errors
- The source argument must be provided.
- The path argument must be provided.
- The --session-id option cannot be empty.
- Invalid scope: ${argv.scope}. Please use one of ${Object.val
- Invalid scope: ${argv.scope}. Please use one of ${Object.val
AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12).
Data as JSON: /api/errors/3f2b7d1c46cfa20f.
Report an issue: GitHub.