diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index 1c3e63ec03..618492f306 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -127,7 +127,7 @@ def _build_ai_deprecation_warning( ai_commands_dir=ai_commands_dir, ) return ( - "[bold]--ai[/bold] is deprecated and will no longer be available in version 1.0.0 or later.\n\n" + "[bold]--ai[/bold] is deprecated and will no longer be available in version 0.10.0 or later.\n\n" f"Use [bold]{replacement}[/bold] instead." ) @@ -1088,6 +1088,13 @@ def init( 'use [bold]--integration generic --integration-options="--commands-dir "[/bold] instead.[/dim]' ) + if no_git: + console.print( + "[yellow]⚠️ --no-git is deprecated and will be removed in v0.10.0.[/yellow]\n" + "[yellow]The git extension will no longer be enabled by default " + "— use the [bold]specify extension[/bold] commands to install or enable the git extension if needed.[/yellow]" + ) + if project_name == ".": here = True project_name = None # Clear project_name to use existing validation logic diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py index 152c56813c..df48323ed2 100644 --- a/tests/integrations/test_cli.py +++ b/tests/integrations/test_cli.py @@ -112,7 +112,7 @@ def test_ai_emits_deprecation_warning_with_integration_replacement(self, tmp_pat assert "--ai" in normalized_output assert "deprecated" in normalized_output assert "no longer be available" in normalized_output - assert "1.0.0" in normalized_output + assert "0.10.0" in normalized_output assert "--integration copilot" in normalized_output assert normalized_output.index("Deprecation Warning") < normalized_output.index("Next Steps") assert (project / ".github" / "agents" / "speckit.plan.agent.md").exists() @@ -446,6 +446,33 @@ def test_no_git_skips_extension(self, tmp_path): ext_dir = project / ".specify" / "extensions" / "git" assert not ext_dir.exists(), "git extension should not be installed with --no-git" + def test_no_git_emits_deprecation_warning(self, tmp_path): + """Using --no-git emits a visible deprecation warning.""" + from typer.testing import CliRunner + from specify_cli import app + + project = tmp_path / "no-git-warn" + project.mkdir() + old_cwd = os.getcwd() + try: + os.chdir(project) + runner = CliRunner() + result = runner.invoke(app, [ + "init", "--here", "--ai", "claude", "--script", "sh", + "--no-git", "--ignore-agent-tools", + ], catch_exceptions=False) + finally: + os.chdir(old_cwd) + + normalized_output = _normalize_cli_output(result.output) + assert result.exit_code == 0, result.output + assert "--no-git" in normalized_output + assert "deprecated" in normalized_output + assert "0.10.0" in normalized_output + assert "specify extension" in normalized_output + assert "will be removed" in normalized_output + assert "git extension will no longer be enabled by default" in normalized_output + def test_git_extension_commands_registered(self, tmp_path): """Git extension commands are registered with the agent during init.""" from typer.testing import CliRunner