{"record":{"id":"51a5de3e4eae9c09","repo":"yamadashy/repomix","slug":"skill-output-path-cannot-be-empty-51a5de","errorCode":null,"errorMessage":"--skill-output path cannot be empty","messagePattern":"--skill-output path cannot be empty","errorType":"exception","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/cli/actions/remoteAction.ts","lineNumber":139,"sourceCode":"    }\n\n    // For skill generation, prompt for location using current directory (not temp directory)\n    let skillName: string | undefined;\n    let skillDir: string | undefined;\n    let skillProjectName: string | undefined;\n    if (cliOptions.skillGenerate !== undefined) {\n      skillName =\n        typeof cliOptions.skillGenerate === 'string'\n          ? cliOptions.skillGenerate\n          : generateDefaultSkillNameFromUrl(repoUrl);\n\n      // Generate project name from URL for use in skill description\n      skillProjectName = generateProjectNameFromUrl(repoUrl);\n\n      if (cliOptions.skillOutput) {\n        // Validate --skill-output is not empty or whitespace only\n        if (!cliOptions.skillOutput.trim()) {\n          throw new RepomixError('--skill-output path cannot be empty');\n        }\n        // Non-interactive mode: use provided path directly\n        skillDir = await resolveAndPrepareSkillDir(cliOptions.skillOutput, process.cwd(), cliOptions.force ?? false);\n      } else {\n        // Interactive mode: prompt for skill location\n        const promptResult = await promptSkillLocation(skillName, process.cwd());\n        skillDir = promptResult.skillDir;\n      }\n    }\n\n    // Run the default action on the downloaded/cloned repository\n    // Pass the pre-computed skill name, directory, project name, and source URL\n    // Redacted at the source: this URL is only ever rendered as a link in the\n    // generated SKILL.md, never used to reach the network. Leaving it raw would\n    // persist a credentialed remote into a file the user is likely to commit.\n    const skillSourceUrl = cliOptions.skillGenerate !== undefined ? redactUrl(repoUrl) : undefined;\n\n    const optionsWithSkill = {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/cli/actions/remoteAction.ts#L121-L157","documentation":"In remote mode, when --skill-output is provided alongside skill generation it is resolved non-interactively as the skill target directory, so it must be a non-empty path. runRemoteAction throws this when cliOptions.skillOutput is truthy but its trimmed value is empty (src/cli/actions/remoteAction.ts:139), mirroring the default-action check but after the remote repo URL is resolved.","triggerScenarios":"`repomix --remote <url> --skill-generate --skill-output \"\"` or `--skill-output \"   \"`; CI scripts interpolating an unset SKILL_OUTPUT variable into the flag while --skill-output is passed unconditionally.","commonSituations":"Automation where the output-directory variable is empty for a job; quoting mistakes (`--skill-output \"\"`); reusing local skill commands where an empty string was tolerated upstream.","solutions":["Provide a concrete directory: `repomix --remote <url> --skill-generate --skill-output ./skills/repo-skill`.","Guard the flag in scripts so it is only added when the variable is non-empty, falling back to the interactive prompt.","Echo the assembled command before execution to verify the value."],"exampleFix":"# before (SKILL_OUTPUT empty)\nrepomix --remote \"$URL\" --skill-generate --skill-output \"$SKILL_OUTPUT\"\n# after\nif [ -n \"$SKILL_OUTPUT\" ]; then set -- \"$@\" --skill-output \"$SKILL_OUTPUT\"; fi\nrepomix --remote \"$URL\" --skill-generate \"$@\"","handlingStrategy":"validation","validationCode":"if (args.includes('--remote') && args.includes('--skill-generate')) {\n  const i = args.indexOf('--skill-output');\n  if (i !== -1 && !(args[i + 1] ?? '').trim()) {\n    throw new Error('Provide a non-empty --skill-output for remote skill generation');\n  }\n}","typeGuard":"const isNonEmptyPath = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":"try {\n  await repomixRun(args);\n} catch (e) {\n  if (String(e.message).includes('--skill-output path cannot be empty')) {\n    throw new Error('Set a real SKILL_OUTPUT directory before the remote run');\n  }\n  throw e;\n}","preventionTips":["Fail fast in CI: test -n \"$SKILL_OUTPUT\" before invoking repomix remote.","Only append --skill-output when the variable is non-empty; otherwise accept the interactive prompt.","Use absolute or ./-prefixed paths to avoid ambiguity."],"tags":["cli","remote","argument-validation","empty-value","repomix"],"backgroundTag":"empty-option-value","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}