Skip to content

[Fix] Use openspec update directly in config apply-now #1306

Description

@alfred-openspec

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.ts imports execSync and calls execSync('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.ts currently asserts the hardcoded npx command, so it will need to be updated.

Proposed Fix

  1. Replace the apply-now command with openspec update instead of npx openspec update.
  2. Update test/commands/config-profile.test.ts to expect execSync('openspec update', { stdio: 'inherit', cwd: fs.realpathSync(tempDir) }).
  3. Run the focused test: pnpm test test/commands/config-profile.test.ts.

Files to Modify

  • src/commands/config.ts
  • test/commands/config-profile.test.ts

Closes #1304

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions