yamadashy/repomix · error · RepomixError
--skill-project-name cannot be empty
Error message
--skill-project-name cannot be empty
What it means
--skill-project-name requires a non-empty, non-whitespace value since it names the project inside the generated skill metadata. runDefaultAction throws this when the flag is given but its trimmed value is empty (src/cli/actions/defaultAction.ts:109).
Source
Thrown at src/cli/actions/defaultAction.ts:109
validateConflictingOptions(config);
// Validate --skill-output and --force require --skill-generate
if (cliOptions.skillOutput && config.skillGenerate === undefined) {
throw new RepomixError('--skill-output can only be used with --skill-generate');
}
if (cliOptions.force && config.skillGenerate === undefined) {
throw new RepomixError('--force can only be used with --skill-generate');
}
if (cliOptions.skillProjectName !== undefined && config.skillGenerate === undefined) {
throw new RepomixError('--skill-project-name can only be used with --skill-generate');
}
// Validate --skill-output is not empty or whitespace only
if (cliOptions.skillOutput !== undefined && !cliOptions.skillOutput.trim()) {
throw new RepomixError('--skill-output path cannot be empty');
}
if (cliOptions.skillProjectName !== undefined && !cliOptions.skillProjectName.trim()) {
throw new RepomixError('--skill-project-name cannot be empty');
}
// Validate skill generation options and prompt for location
if (config.skillGenerate !== undefined) {
// Resolve skill name: use pre-computed name (from remoteAction) or generate from directory
cliOptions.skillName ??=
typeof config.skillGenerate === 'string'
? config.skillGenerate
: generateDefaultSkillName(directories.map((d) => path.resolve(cwd, d)));
// Determine skill directory
if (cliOptions.skillOutput && !cliOptions.skillDir) {
// Non-interactive mode: use provided path directly
cliOptions.skillDir = await resolveAndPrepareSkillDir(cliOptions.skillOutput, cwd, cliOptions.force ?? false);
} else if (!cliOptions.skillDir) {
// Interactive mode: prompt for skill location
const promptResult = await promptSkillLocation(cliOptions.skillName, cwd);
cliOptions.skillDir = promptResult.skillDir;View on GitHub (pinned to f465ad9093)
Solutions
- Supply an actual name: `repomix --skill-generate --skill-project-name "My Project"`.
- Omit the flag entirely — a project name is derived automatically (e.g. from the directory or remote URL).
- In scripts, default the value: `--skill-project-name "${PROJECT_NAME:-$(basename $PWD)}"`.
Example fix
# before (PROJECT_NAME unset)
repomix --skill-generate --skill-project-name "$PROJECT_NAME"
# after
repomix --skill-generate --skill-project-name "${PROJECT_NAME:-$(basename "$PWD")}" Defensive patterns
Strategy: validation
Validate before calling
const i = args.indexOf('--skill-project-name');
if (i !== -1 && !(args[i + 1] ?? '').trim()) {
throw new Error('Provide a non-empty --skill-project-name or omit the flag');
} Type guard
const isFilled = (v: string | undefined): v is string => typeof v === 'string' && v.trim().length > 0;
Try / catch
try {
await repomixRun(args);
} catch (e) {
if (String(e.message).includes('--skill-project-name cannot be empty')) {
return repomixRun(args.filter((a, idx) => a !== '--skill-project-name' && args[idx - 1] !== '--skill-project-name'));
}
throw e;
} Prevention
- Prefer omitting --skill-project-name and letting repomix derive the name automatically.
- Use ${VAR:-default} expansion so empty variables never reach the flag.
- Validate required variables at the top of CI jobs with test -n "$VAR".
When it happens
Trigger: `repomix --skill-generate --skill-project-name ""` or `--skill-project-name " "`; scripts passing an unset/empty variable as the value.
Common situations: CI pipelines where PROJECT_NAME is undefined; templated commands with a placeholder never filled in; quoting bugs that swallow the value.
Related errors
- --skill-output path cannot be empty
- --skill-output path 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/b2cd82b1c5a9ea5d.
Report an issue: GitHub.