Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/integrations/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ specify integration switch <key>
| Option | Description |
| ------------------------ | ------------------------------------------------------------------------ |
| `--script sh\|ps\|py` | Script type: `sh` (bash/zsh), `ps` (PowerShell), or `py` (Python) |
| `--force` | Force removal of modified files during uninstall; when the target is already installed, overwrite managed shared templates while changing the default |
| `--refresh-shared-infra` | Also overwrite shared infrastructure files even if you customized them (otherwise customizations are preserved) |
| `--force` | Force removal of modified files during uninstall; when the target is already installed, overwrite customized shared infrastructure |
| `--refresh-shared-infra` | Overwrite customized shared scripts, page templates, and `.specify/.gitignore`, including for installed targets and the current default |
| `--integration-options` | Options for the target integration when it is not already installed |
| `--trust-integration` | Authorize downloading and executing a reviewed external adapter without the interactive trust prompt |

Expand All @@ -222,7 +222,14 @@ specify integration switch <key>
`switch` rejects setup options for installed targets.

Both paths register enabled extensions and presets for the new default.
See the option table for the different meanings of `--force`.
If the target is already the current default, a call without flags does nothing;
`--refresh-shared-infra` or `--force` refreshes only shared infrastructure, without
reinstalling the integration or re-registering extensions and presets.

For a target that is not installed, `--force` controls removal of the outgoing
integration's edited files; only `--refresh-shared-infra` permits overwriting
shared customizations. For an installed target, either flag permits that shared
overwrite. Symlinked shared paths remain protected with either flag.

When switching to an external adapter that must be downloaded and installed,
use `--trust-integration` only after reviewing its code:
Expand Down
6 changes: 3 additions & 3 deletions src/specify_cli/integrations/command_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def integration_switch(
target: str = typer.Argument(help="Integration key to switch to"),
script: str | None = typer.Option(None, "--script", help="Script type: sh, ps, or py (default: from init-options.json or platform default)"),
force: bool = typer.Option(False, "--force", help="Force removal of modified files during uninstall of the previous integration"),
refresh_shared_infra: bool = typer.Option(False, "--refresh-shared-infra", help="Also overwrite shared infrastructure files even if you customized them (otherwise customizations are preserved)"),
refresh_shared_infra: bool = typer.Option(False, "--refresh-shared-infra", help="Overwrite customized shared scripts, templates, and .specify/.gitignore, including when the target is already the default"),
integration_options: str | None = typer.Option(None, "--integration-options", help='Options for the target integration'),
trust_integration: bool = typer.Option(False, "--trust-integration", help="Authorize executing a reviewed external integration package without prompting"),
):
Expand Down Expand Up @@ -68,7 +68,7 @@ def integration_switch(
"to update managed files/options."
)
raise typer.Exit(1)
if force:
if force or refresh_shared_infra:
raw_options, parsed_options = _resolve_integration_options(
target_integration, current, target, None
)
Expand Down Expand Up @@ -112,7 +112,7 @@ def integration_switch(
installed_keys,
raw_options=raw_options,
parsed_options=parsed_options,
refresh_templates_force=force,
refresh_templates_force=force or refresh_shared_infra,
)
manifest, unmodified_files = _snapshot_manifest_before_registration(project_root, target)
_register_extensions_for_agent(
Expand Down
Loading
Loading