Skip to content

Commit 5f82c75

Browse files
mnriemCopilot
andauthored
Update src/specify_cli/__init__.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 2316fa3 commit 5f82c75

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/specify_cli/__init__.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,25 @@ def _format_rate_limit_error(status_code: int, headers: httpx.Headers, url: str)
267267
def _build_ai_assistant_help() -> str:
268268
"""Build the --ai help text from AGENT_CONFIG so it stays in sync with runtime config."""
269269

270-
non_generic_agents = [agent for agent in AGENT_CONFIG if agent != "generic"]
271-
return (
270+
non_generic_agents = sorted(agent for agent in AGENT_CONFIG if agent != "generic")
271+
base_help = (
272272
f"AI assistant to use: {', '.join(non_generic_agents)}, "
273-
"or generic (requires --ai-commands-dir). "
274-
"Use 'kiro' as an alias for 'kiro-cli'."
273+
"or generic (requires --ai-commands-dir)."
275274
)
276275

276+
if not AI_ASSISTANT_ALIASES:
277+
return base_help
277278

279+
alias_phrases = []
280+
for alias, target in sorted(AI_ASSISTANT_ALIASES.items()):
281+
alias_phrases.append(f\"'{alias}' as an alias for '{target}'\")
282+
283+
if len(alias_phrases) == 1:
284+
aliases_text = alias_phrases[0]
285+
else:
286+
aliases_text = ', '.join(alias_phrases[:-1]) + ' and ' + alias_phrases[-1]
287+
288+
return base_help + " Use " + aliases_text + "."
278289
AI_ASSISTANT_HELP = _build_ai_assistant_help()
279290

280291
SCRIPT_TYPE_CHOICES = {"sh": "POSIX Shell (bash/zsh)", "ps": "PowerShell"}

0 commit comments

Comments
 (0)