spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

fix: keep --ai as a supported init alias

Open puneetdixit200 opened this issue 6 months ago • 3 comments

Summary

  • keep specify init --ai <key> as a supported short alias instead of warning about removal
  • remove the --ai deprecation panel while preserving mutual exclusion with --integration
  • document --ai alongside --integration in the core reference and README

Closes #2636.

Verification

  • uv sync --extra test
  • uv run pytest tests/integrations/test_cli.py::TestInitIntegrationFlag::test_integration_and_ai_mutually_exclusive tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_copilot_does_not_emit_deprecation_warning tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_generic_alias_does_not_emit_deprecation_warning -q -> 3 passed
  • PYTHONUTF8=1 PYTHONIOENCODING=utf-8 uv run specify --help -> passed
  • git diff --check -> passed

Note: the full tests/integrations/test_cli.py suite reached 68 passed / 1 skipped but 7 unrelated symlink-safety tests failed on this Windows checkout with WinError 1314 because symlink creation requires elevated privileges.

AI-assisted work

This patch was prepared with AI assistance and manually reviewed. I added the no-deprecation regression expectation first, observed it fail on the existing warning, then reran the affected tests after the implementation change.

puneetdixit200 avatar May 20 '26 06:05 puneetdixit200

AI-assisted follow-up pushed in 0f023bc.

Verification:

  • uv sync --extra test
  • uv run pytest tests/integrations/test_cli.py::TestInitIntegrationFlag::test_integration_and_ai_mutually_exclusive tests/integrations/test_cli.py::TestInitIntegrationFlag::test_init_help_explains_ai_alias_and_generic_options tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_copilot_does_not_emit_deprecation_warning tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_generic_alias_does_not_emit_deprecation_warning -q -> 4 passed
  • uv run specify init --help
  • git diff --check

puneetdixit200 avatar May 23 '26 14:05 puneetdixit200

Rebased/resolved the conflict against current main after the init command refactor. The branch now ports the existing --ai alias behavior into src/specify_cli/commands/init.py and _agent_config.py rather than reintroducing the old inline init command.

Current head: 2381193

Verified locally:

  • UV_CACHE_DIR=/private/tmp/spec-kit-2637-uv-cache uv sync --extra test
  • UV_CACHE_DIR=/private/tmp/spec-kit-2637-uv-cache uv run pytest tests/integrations/test_cli.py::TestInitIntegrationFlag::test_integration_and_ai_mutually_exclusive tests/integrations/test_cli.py::TestInitIntegrationFlag::test_init_help_explains_ai_alias_and_generic_options tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_copilot_does_not_emit_deprecation_warning tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_generic_alias_does_not_emit_deprecation_warning -q (4 passed)
  • UV_CACHE_DIR=/private/tmp/spec-kit-2637-uv-cache uv run pytest tests/integrations/test_cli.py -q (77 passed)
  • UV_CACHE_DIR=/private/tmp/spec-kit-2637-uv-cache uv run specify init --help
  • git diff --check

puneetdixit200 avatar May 26 '26 16:05 puneetdixit200

AI-assisted follow-up pushed in cf2295b.

This addresses the review-note cleanup around the --ai alias docs/tests:

  • clarifies the core docs wording to say --integration <key> is equivalent to --ai <key>
  • keeps the no-deprecation assertion checking the raw Rich/Typer output after stripping ANSI and normalizing text, so deprecation text cannot be hidden by pre-normalization

Verified locally on the current head:

  • UV_CACHE_DIR=/private/tmp/spec-kit-2637-uv-cache uv run pytest tests/integrations/test_cli.py -q (77 passed)
  • git diff --check

gh pr checks still reports no check rows for this branch.

puneetdixit200 avatar May 26 '26 17:05 puneetdixit200