Skip to content

Allow switching AI model provider after init without overwriting existing files #1091

@ArpitSuthar

Description

@ArpitSuthar

Describe the problem
After running specify init , changing the configured AI model provider requires re-running init or manual edits. Re-running init can overwrite existing project files (scaffolding, constitution.md, .specify, prompts, or custom templates), risking loss of progress made so far.

Proposed solution
Add a provider-switch command or enhance init to support switching providers safely by:

  • Introducing a command like specify provider switch <provider-name> (or specify switch-provider) that updates provider-specific configuration only.
  • Detecting existing files and merging provider-specific changes instead of replacing files. Use a safe merge strategy:
    • Update only provider-specific config entries in .specify or equivalent config file.
    • Preserve custom files (constitution.md, prompts/, templates/) unless a --force flag is provided.
    • When provider-specific template files are missing, create provider variants rather than overwriting the generic ones.
  • Add an interactive prompt/confirmation showing which files would be changed and an explicit --force option to allow overwriting when desired.
  • Provide a dry-run mode (--dry-run) that shows diffs/changes.

Additional context / notes

  • Consider supporting provider-specific prompt/template directories to allow coexistence (e.g., .openai/, .anthropic/).
  • Ensure migration path for projects that used older init flows—document steps to move provider-specific files into the new layout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions