{"record":{"id":"2f2471b85d3e794d","repo":"google-gemini/gemini-cli","slug":"the-path-argument-must-be-provided","errorCode":null,"errorMessage":"The path argument must be provided.","messagePattern":"The path argument must be provided\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/skills/link.ts","lineNumber":80,"sourceCode":"        describe: 'The local path of the skill to link.',\n        type: 'string',\n        demandOption: true,\n      })\n      .option('scope', {\n        describe:\n          'The scope to link the skill into. Defaults to \"user\" (global).',\n        choices: ['user', 'workspace'],\n        default: 'user',\n      })\n      .option('consent', {\n        describe:\n          'Acknowledge the security risks of linking a skill and skip the confirmation prompt.',\n        type: 'boolean',\n        default: false,\n      })\n      .check((argv) => {\n        if (!argv.path) {\n          throw new Error('The path argument must be provided.');\n        }\n        return true;\n      }),\n  handler: async (argv) => {\n    await handleLink({\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      path: argv['path'] as string,\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      scope: argv['scope'] as 'user' | 'workspace',\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion\n      consent: argv['consent'] as boolean | undefined,\n    });\n    await exitCli();\n  },\n};\n","sourceCodeStart":62,"sourceCodeEnd":96,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/commands/skills/link.ts#L62-L96","documentation":"Thrown by the yargs `.check()` validator on the `gemini skills link <path>` command when the positional `path` argument is missing or falsy. Like the install command, it backs up the positional's `demandOption: true` and ensures the handler never runs against an undefined path. Linking creates a symlink to a local skill directory, so a missing path has no valid target.","triggerScenarios":"Running `gemini skills link` with no positional, with an empty string, or invoking the `linkCommand` module without a populated `argv.path`.","commonSituations":"Forgetting the path argument; relative paths that the shell expands to nothing; copy-paste errors that drop the path; scripts that pass an unbound variable.","solutions":["Provide a local directory path: `gemini skills link ./my-skill`.","Verify the path exists and is non-empty before running: `[ -n \"$P\" ] && gemini skills link \"$P\"`.","When calling the handler directly, populate `argv.path` with a non-empty string."],"exampleFix":"// before\ngemini skills link\n// after\ngemini skills link /home/me/skills/my-skill","handlingStrategy":"validation","validationCode":"const p = typeof argv.path === 'string' ? argv.path : '';\nif (!p) {\n  console.error('Usage: gemini skills link <path>');\n  process.exit(2);\n}","typeGuard":"function hasLinkPath(argv: unknown): argv is { path: string } {\n  return (\n    typeof argv === 'object' && argv !== null &&\n    typeof (argv as { path?: unknown }).path === 'string' &&\n    (argv as { path: string }).path.length > 0\n  );\n}","tryCatchPattern":null,"preventionTips":["Verify the path exists with `fs.existsSync` before linking.","Quote path arguments to survive spaces.","Use absolute paths to avoid ambiguity with `workspaceDir`."],"tags":["cli","yargs","skills","validation","argument"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}