Skip to content

Exclude hidden commands from command suggestions#1901

Draft
hsusul wants to merge 1 commit into
fastapi:masterfrom
hsusul:fix-hidden-command-suggestions
Draft

Exclude hidden commands from command suggestions#1901
hsusul wants to merge 1 commit into
fastapi:masterfrom
hsusul:fix-hidden-command-suggestions

Conversation

@hsusul

@hsusul hsusul commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Hidden commands were included when Typer generated typo suggestions, exposing command names intentionally omitted from help output.

Suggestion candidates are now filtered using each command's hidden status. Visible-command suggestions remain unchanged, and hidden commands remain directly invokable by their exact names.

Tests

Added regression coverage for both Rich and plain Click-style error rendering, verifying that:

  • hidden commands are not suggested
  • visible commands are still suggested
  • hidden commands remain directly invokable

Validation

  • uv run pytest tests/test_suggest_commands.py tests/test_hidden.py tests/test_rich_utils.py -q
  • uv run bash scripts/lint.sh
  • env -u NO_COLOR TERM=xterm-256color uv run bash scripts/test.sh
  • git diff --check

@svlandeg svlandeg added the bug Something isn't working label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants