google-gemini/gemini-cli · info
Skill installation cancelled by user.
Error message
Skill installation cancelled by user.
What it means
Thrown when requestConsent returns false — the user was prompted to approve skill installation and declined (or dismissed the prompt). This is an expected, user-initiated cancellation, not a system error.
Source
Thrown at packages/cli/src/utils/skillUtils.ts:172
onLog(`Searching for skills in ${sourcePath}...`);
const skills = await loadSkillsFromDir(sourcePath);
if (skills.length === 0) {
throw new Error(
`No valid skills found in ${source}${subpath ? ` at path "${subpath}"` : ''}. Ensure a SKILL.md file exists with valid frontmatter.`,
);
}
const workspaceDir = process.cwd();
const storage = new Storage(workspaceDir);
const targetDir =
scope === 'workspace'
? storage.getProjectSkillsDir()
: Storage.getUserSkillsDir();
if (!(await requestConsent(skills, targetDir))) {
throw new Error('Skill installation cancelled by user.');
}
const resolvedTarget = path.resolve(targetDir);
await fs.mkdir(resolvedTarget, { recursive: true });
const installedSkills: Array<{ name: string; location: string }> = [];
for (const skill of skills) {
const skillName = skill.name;
const skillDir = path.dirname(skill.location);
const destPath = path.resolve(resolvedTarget, skillName);
const relative = path.relative(resolvedTarget, destPath);
if (isInvalidSubpath(relative)) {
throw new Error('Invalid skill name: Path traversal detected.');
}
const exists = await fs.lstat(destPath).catch(() => null);View on GitHub (pinned to 5024443c72)
Solutions
- Re-run the install command and approve the consent prompt if you trust the source.
- If running non-interactively, set the appropriate flag/env to auto-approve trusted sources (per the CLI's consent docs).
- Verify the skill source is legitimate before approving.
Defensive patterns
Strategy: validation
Validate before calling
// In non-interactive flows, decide explicitly whether to auto-approve.
if (!process.stdin.isTTY && !AUTO_APPROVE_SKILLS) {
throw new Error('Skill consent cannot be obtained in non-interactive mode; set AUTO_APPROVE_SKILLS for trusted sources.');
} Prevention
- Run skill installs interactively when possible.
- Only auto-approve skills from verified sources in CI.
When it happens
Trigger: requestConsent(skills, targetDir) resolves to false. The interactive consent prompt received a 'no'/cancel, or non-interactive mode defaulted to decline.
Common situations: User chose not to trust a third-party skill. Running in a non-interactive context where the prompt cannot be answered. Consent policy set to auto-decline unknown sources.
Related errors
- Invalid path: Directory traversal not allowed.
- No valid skills found in ${source}${subpath ? ` at path "${s
- Invalid skill name: Path traversal detected.
- Installation aborted: Folder "${absolutePath}" is not truste
- Could not install extension because the current workspace at
AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12).
Data as JSON: /api/errors/46886f410a07db63.
Report an issue: GitHub.