yamadashy/repomix · error · RepomixError
--skill-project-name can only be used with --skill-generate
Error message
--skill-project-name can only be used with --skill-generate
What it means
--skill-project-name sets the project name inside a generated skill, so it is only valid when a skill is actually being generated. runDefaultAction throws this whenever the flag is present but config.skillGenerate is undefined (src/cli/actions/defaultAction.ts:101), failing fast before packing or prompting.
Source
Thrown at src/cli/actions/defaultAction.ts:101
progressCallback?: RepomixProgressCallback,
): Promise<DefaultActionRunnerResult> => {
logger.trace('Loaded CLI options:', redactOptionsForLog(cliOptions));
// Build the merged config (migration + file config + CLI options)
const config = await buildMergedConfig(cwd, cliOptions);
// Validate conflicting options
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)));
View on GitHub (pinned to f465ad9093)
Solutions
- Add --skill-generate: `repomix --skill-generate --skill-project-name my-project`.
- Remove --skill-project-name if you are doing a normal pack without skill generation.
- Verify with `repomix --help` that --skill-generate is actually spelled correctly and parsed.
Example fix
// before repomix --skill-project-name myproj // after repomix --skill-generate --skill-project-name myproj
Defensive patterns
Strategy: validation
Validate before calling
if (args.includes('--skill-project-name') && !args.includes('--skill-generate')) {
throw new Error('--skill-project-name requires --skill-generate');
} Type guard
const skillProjectNameAllowed = (argv: string[]): boolean =>
!argv.some(a => a === '--skill-project-name') || argv.includes('--skill-generate'); Try / catch
try {
await repomixRun(args);
} catch (e) {
if (String(e.message).includes('--skill-project-name can only be used with --skill-generate')) {
throw new Error('Add --skill-generate or remove --skill-project-name');
}
throw e;
} Prevention
- Group all skill flags (--skill-generate, --skill-output, --skill-project-name) together in command templates.
- Never pass skill flags conditionally without the same condition guarding --skill-generate.
- Verify flag parsing with repomix --help when upgrading versions.
When it happens
Trigger: Running `repomix --skill-project-name <name>` without --skill-generate; any code path where cliOptions.skillProjectName !== undefined while config.skillGenerate stays undefined.
Common situations: Combining flags from two different example commands; automation that always passes --skill-project-name but conditionally passes --skill-generate; typo in --skill-generate leaving it unparsed.
Related errors
- --skill-output can only be used with --skill-generate
- --force can only be used with --skill-generate
- --skill-output path cannot be empty
- --skill-project-name cannot be empty
- When using --stdin, do not specify directory arguments. File
AI-assisted analysis of yamadashy/repomix@f465ad9093 (2026-08-29).
Data as JSON: /api/errors/b50141a615f42930.
Report an issue: GitHub.