OpenSpec
OpenSpec copied to clipboard
[Fix] Use openspec update directly in config apply-now
Context
Reported in #1304 by @BenNewman100. After openspec config profile saves profile/workflow changes and the user confirms "Apply changes to this project now?", OpenSpec shells out through npx openspec update. That fails for Bun global installs and standalone binary installs where openspec is available on PATH but npx is not.
Root Cause
src/commands/config.tsimportsexecSyncand callsexecSync('npx openspec update', { stdio: 'inherit', cwd: projectDir })in the interactive apply-now path.- The UX and fallback message already tell users to run
openspec update, so the implementation is inconsistent with the supported non-npm installation paths. - The focused regression in
test/commands/config-profile.test.tscurrently asserts the hardcodednpxcommand, so it will need to be updated.
Proposed Fix
- Replace the apply-now command with
openspec updateinstead ofnpx openspec update. - Update
test/commands/config-profile.test.tsto expectexecSync('openspec update', { stdio: 'inherit', cwd: fs.realpathSync(tempDir) }). - Run the focused test:
pnpm test test/commands/config-profile.test.ts.
Files to Modify
src/commands/config.tstest/commands/config-profile.test.ts
Closes #1304
Closing as fixed by #1351 (commit a0eb70e), which went one step further than proposed: the apply-now path calls new UpdateCommand().execute(projectDir) in-process (src/commands/config.ts:625), so there is no shell-out at all. npx, PATH, and Bun users are now equally unbothered.
On main, ships with the next release.