Skip to content

fix: keep --ai as a supported init alias#2637

Open
puneetdixit200 wants to merge 2 commits into
github:mainfrom
puneetdixit200:codex/keep-ai-alias
Open

fix: keep --ai as a supported init alias#2637
puneetdixit200 wants to merge 2 commits into
github:mainfrom
puneetdixit200:codex/keep-ai-alias

Conversation

@puneetdixit200
Copy link
Copy Markdown

@puneetdixit200 puneetdixit200 commented May 20, 2026

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.

Copilot AI review requested due to automatic review settings May 20, 2026 06:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the CLI behavior and documentation so the legacy --ai flag no longer emits a deprecation warning and is treated as a short alias for selecting an integration.

Changes:

  • Remove the --ai deprecation warning panel from specify init.
  • Update integration tests to assert no deprecation warning is printed for --ai.
  • Update docs/README to document --ai as a short alias for --integration.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/integrations/test_cli.py Updates expectations to ensure --ai no longer prints a deprecation warning.
src/specify_cli/init.py Removes deprecation-warning construction/printing and related import; updates --integration help text.
docs/reference/core.md Documents --ai as a short alias and adds an example.
README.md Documents --ai as a short alias and adds an example usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/specify_cli/__init__.py Outdated
Comment thread tests/integrations/test_cli.py Outdated
Comment thread docs/reference/core.md Outdated
Comment thread docs/reference/core.md Outdated
@puneetdixit200 puneetdixit200 marked this pull request as ready for review May 20, 2026 07:01
@puneetdixit200 puneetdixit200 requested a review from mnriem as a code owner May 20, 2026 07:01
Copilot AI review requested due to automatic review settings May 20, 2026 09:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread src/specify_cli/__init__.py Outdated
Comment thread tests/integrations/test_cli.py Outdated
Comment thread tests/integrations/test_cli.py Outdated
Copilot AI review requested due to automatic review settings May 21, 2026 03:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread tests/integrations/test_cli.py Outdated
Comment thread src/specify_cli/__init__.py Outdated
@puneetdixit200
Copy link
Copy Markdown
Author

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

Copilot AI review requested due to automatic review settings May 26, 2026 16:47
@puneetdixit200
Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread docs/reference/core.md Outdated
| Option | Description |
| ------------------------ | ------------------------------------------------------------------------ |
| `--integration <key>` | AI coding agent integration to use (e.g. `copilot`, `claude`, `gemini`). See the [Integrations reference](integrations.md) for all available keys |
| `--integration <key>` | AI coding agent integration to use (e.g. `copilot`, `claude`, `gemini`). Equivalent to `--ai`; do not combine them. See the [Integrations reference](integrations.md) for all available keys |
Comment thread tests/integrations/test_cli.py Outdated
Comment on lines +46 to +47
def _assert_no_ai_deprecation_output(output: str) -> None:
lower_output = output.lower()
Comment on lines +54 to +62
ai_related_blocks = [
block
for block in re.split(r"\n\s*\n", lower_output)
if "--ai" in block
]
for block in ai_related_blocks:
assert "deprecated" not in block
assert "0.10.0" not in block
assert "next steps" not in block
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in cf2295b. _assert_no_ai_deprecation_output now strips ANSI itself, normalizes only for whole-output assertions, and splits the raw cleaned output into blocks before checking AI-related sections. I also updated both callers to pass result.output instead of the already-normalized string. Verification: focused 3-test run passed, full tests/integrations/test_cli.py passed (77 tests), specify init --help ran, and git diff --check passed.

Comment thread tests/integrations/test_cli.py Outdated
Comment on lines +194 to +196
normalized_output = _normalize_cli_output(result.output)
assert result.exit_code == 0, result.output
assert "Deprecation Warning" in normalized_output
assert "--ai" in normalized_output
assert "deprecated" in normalized_output
assert "no longer be available" 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_no_ai_deprecation_output(normalized_output)
@puneetdixit200
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: don't depreciate --ai in favor of --integration .. keep both! ai is so much easier to type!

3 participants