yamadashy/repomix · error · RepomixError
--skill-output path cannot be empty
Error message
--skill-output path cannot be empty
What it means
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.
Source
Thrown at src/cli/actions/remoteAction.ts:139
}
// For skill generation, prompt for location using current directory (not temp directory)
let skillName: string | undefined;
let skillDir: string | undefined;
let skillProjectName: string | undefined;
if (cliOptions.skillGenerate !== undefined) {
skillName =
typeof cliOptions.skillGenerate === 'string'
? cliOptions.skillGenerate
: generateDefaultSkillNameFromUrl(repoUrl);
// Generate project name from URL for use in skill description
skillProjectName = generateProjectNameFromUrl(repoUrl);
if (cliOptions.skillOutput) {
// Validate --skill-output is not empty or whitespace only
if (!cliOptions.skillOutput.trim()) {
throw new RepomixError('--skill-output path cannot be empty');
}
// Non-interactive mode: use provided path directly
skillDir = await resolveAndPrepareSkillDir(cliOptions.skillOutput, process.cwd(), cliOptions.force ?? false);
} else {
// Interactive mode: prompt for skill location
const promptResult = await promptSkillLocation(skillName, process.cwd());
skillDir = promptResult.skillDir;
}
}
// Run the default action on the downloaded/cloned repository
// Pass the pre-computed skill name, directory, project name, and source URL
// Redacted at the source: this URL is only ever rendered as a link in the
// generated SKILL.md, never used to reach the network. Leaving it raw would
// persist a credentialed remote into a file the user is likely to commit.
const skillSourceUrl = cliOptions.skillGenerate !== undefined ? redactUrl(repoUrl) : undefined;
const optionsWithSkill = {View on GitHub (pinned to f465ad9093)
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.
Example fix
# before (SKILL_OUTPUT empty) repomix --remote "$URL" --skill-generate --skill-output "$SKILL_OUTPUT" # after if [ -n "$SKILL_OUTPUT" ]; then set -- "$@" --skill-output "$SKILL_OUTPUT"; fi repomix --remote "$URL" --skill-generate "$@"
Defensive patterns
Strategy: validation
Validate before calling
if (args.includes('--remote') && args.includes('--skill-generate')) {
const i = args.indexOf('--skill-output');
if (i !== -1 && !(args[i + 1] ?? '').trim()) {
throw new Error('Provide a non-empty --skill-output for remote skill generation');
}
} Type guard
const isNonEmptyPath = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0;
Try / catch
try {
await repomixRun(args);
} catch (e) {
if (String(e.message).includes('--skill-output path cannot be empty')) {
throw new Error('Set a real SKILL_OUTPUT directory before the remote run');
}
throw e;
} Prevention
- 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.
When it happens
Trigger: `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.
Common situations: 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.
Related errors
- --skill-output path cannot be empty
- --skill-project-name cannot be empty
- --skill-output can only be used with --skill-generate
- --force can only be used with --skill-generate
- --skill-project-name can only be used with --skill-generate
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/51a5de3e4eae9c09.
Report an issue: GitHub.