Skip to content

feat: Shell completion command#45

Open
seroperson wants to merge 1 commit intoentrius:testfrom
seroperson:shell-completion
Open

feat: Shell completion command#45
seroperson wants to merge 1 commit intoentrius:testfrom
seroperson:shell-completion

Conversation

@seroperson
Copy link
Copy Markdown

@seroperson seroperson commented Apr 15, 2026

This PR introduces the completion command for enabling shell completion. With click it's available out-of-box, just needed a handy command to use it easily. Tools like gh, pip, kubectl etc have such completion command too, so it's a well-known adopted pattern.

eval "$(alw completion bash)" # bash
eval "$(alw completion zsh)"  # zsh
alw completion fish | source  # fish
Recording.2026-04-15.120439.mp4

This aligns with the same functionality for gitt: entrius/gittensor#431

The only thing which differs from gitt implementation is that alw uses heavy bittensor imports, which slow completions just a little, so I had to add a stub if we're inside of completion invocation. It's a common click limitation and it has several possible workarounds, but the most suitable is just stubbing.

@seroperson seroperson changed the title Shell completion command feat: Shell completion command Apr 15, 2026
@seroperson seroperson force-pushed the shell-completion branch 3 times, most recently from e8f18bb to 2211833 Compare April 15, 2026 09:30
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.

1 participant