Bug Description
When initializing a project using the noskills init command, the process crashes with an EEXIST error if a .codex directory already exists in the project root.
This occurs after selecting "Codex CLI" in the tools selection step. It appears the CLI attempts to create the .codex directory using mkdir without first checking if the directory is already present, causing the initialization to fail.
Steps to Reproduce
- Ensure a
.codex folder already exists in your target project directory.
- Run
npx eser@latest noskills init
- When prompted for "Any additional tools?", select
Codex CLI.
- Proceed through the remaining prompts (e.g., project kind).
- See the
EEXIST error crash the process.
Error Output:
node:internal/fs/promises:859
return await PromisePrototypeThen(
^
Error: EEXIST: file already exists, mkdir '/Users/ssi/projects/rswy/web/.codex'
at async Module.mkdir (node:internal/fs/promises:859:10)
at async Object.mkdir (file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/chunks/chunk-TW23CULJ.js:2:1187)
at async Object.syncHooks (file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/chunks/chunk-4JICYXYK.js:102:342)
at async wt (file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/chunks/chunk-4JICYXYK.js:111:1175)
at async Module.qe (file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/chunks/init-4Q4HAHND.js:2:4759)
at async #F (file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/chunks/chunk-RNFCAHVL.js:89:34)
at async t.parse (file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/chunks/chunk-RNFCAHVL.js:88:2108)
at async h (file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/eser.js:3:13094)
at async file:///Users/ssi/.npm/_npx/4c89fca78fe8d356/node_modules/eser/eser.js:3:13137 {
errno: -17,
code: 'EEXIST',
syscall: 'mkdir',
path: '/Users/ssi/projects/rswy/web/.codex'
}
Expected Behavior
The initialization process should gracefully handle the scenario where the .codex directory already exists. It should either bypass the directory creation step and utilize the existing folder, or output a friendly warning/prompt to the user, rather than throwing an unhandled exception and crashing the entire setup.
Actual Behavior
The initialization process crashes completely with an unhandled EEXIST error (Error: EEXIST: file already exists, mkdir...) when it attempts to create the .codex directory without verifying if it is already present in the file system.
Runtime
Node.js
Package Version
latest
Runtime Version
v24.15.0
Additional Context
No response
Bug Description
When initializing a project using the
noskills initcommand, the process crashes with anEEXISTerror if a.codexdirectory already exists in the project root.This occurs after selecting "Codex CLI" in the tools selection step. It appears the CLI attempts to create the
.codexdirectory usingmkdirwithout first checking if the directory is already present, causing the initialization to fail.Steps to Reproduce
.codexfolder already exists in your target project directory.npx eser@latest noskills initCodex CLI.EEXISTerror crash the process.Error Output:
Expected Behavior
The initialization process should gracefully handle the scenario where the
.codexdirectory already exists. It should either bypass the directory creation step and utilize the existing folder, or output a friendly warning/prompt to the user, rather than throwing an unhandled exception and crashing the entire setup.Actual Behavior
The initialization process crashes completely with an unhandled
EEXISTerror (Error: EEXIST: file already exists, mkdir...) when it attempts to create the.codexdirectory without verifying if it is already present in the file system.Runtime
Node.js
Package Version
latest
Runtime Version
v24.15.0
Additional Context
No response