Skip to content

CLI: EISDIR error when outputDirectory is a directory in single-file mode #34

@nathanacurtis

Description

@nathanacurtis

Bug

When outputDirectory is set to ./specs in specs.config.yaml and that path already exists as a directory (e.g. from a prior --split-components run), running specs generate without --split-components or -o fails with:

Error: Failed to write file: EISDIR: illegal operation on a directory, open '.../specs'

Expected behavior

The CLI should detect the directory conflict and either:

  1. Append a default filename (e.g. {outputDirectory}/{alias}.yaml) when the path is a directory
  2. Provide a clear error message explaining the conflict and suggesting -o or --split-components

Steps to reproduce

  1. specs init and configure a source
  2. specs fetch && specs scan — select components
  3. specs generate --split-components — creates specs/ directory with per-component files
  4. specs generate — fails with EISDIR

Context

  • CLI version: 0.11.0
  • The outputDirectory config value serves dual purpose: as a directory for split modes and as a file path for single-file mode. This ambiguity causes the conflict.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions