feat: add fish shell completion support (#263)#310
Open
hydrauluu wants to merge 3 commits intoCyber-Syntax:mainfrom
Open
feat: add fish shell completion support (#263)#310hydrauluu wants to merge 3 commits intoCyber-Syntax:mainfrom
hydrauluu wants to merge 3 commits intoCyber-Syntax:mainfrom
Conversation
Cyber-Syntax
reviewed
May 4, 2026
| ``` | ||
|
|
||
| Restart your shell or run `source ~/.config/fish/completions/my-unicorn.fish` to enable. | ||
|
|
Owner
There was a problem hiding this comment.
Please review autocompletion.bash, bash/zsh autocompletion files are never copied to root.
Cyber-Syntax
reviewed
May 4, 2026
| @@ -0,0 +1,102 @@ | |||
| # my-unicorn fish completion script | |||
Owner
There was a problem hiding this comment.
use already existing autocomplete folder instead of completions
Cyber-Syntax
reviewed
May 4, 2026
Comment on lines
+130
to
+148
| # Set up fish shell completions | ||
| setup_fish_completions() { | ||
| local fish_dir="$HOME/.config/fish/completions" | ||
| local fish_src="$INSTALL_DIR/completions/my-unicorn.fish" | ||
|
|
||
| # Fallback to source directory if installed version not available | ||
| if [[ ! -f "$fish_src" ]]; then | ||
| fish_src="$(script_dir)/completions/my-unicorn.fish" | ||
| fi | ||
|
|
||
| if [[ -f "$fish_src" ]]; then | ||
| if command -v fish &>/dev/null; then | ||
| echo "Setting up fish completions..." | ||
| mkdir -p "$fish_dir" | ||
| cp "$fish_src" "$fish_dir/" | ||
| echo "Fish completions installed to $fish_dir/my-unicorn.fish" | ||
| fi | ||
| fi | ||
| } |
Owner
There was a problem hiding this comment.
Please use scripts/autocomplete.bash
Owner
|
Thanks for the contribution! I’ve left several inline comments with details, but the main issue is that the feature is currently implemented in the wrong location/files. Once that’s done, this should be in a much better shape for review 👍 Let me know if you want to sync on structure or placement before updating. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fish shell users currently lack TAB autocompletion for
my-unicorncommands and flags, while bash/zsh users already have this feature. This creates an inconsistent experience across supported shells. (Fixes #263)Solution
completions/my-unicorn.fishwith completion rules for all subcommands (install,update,catalog, etc.) and their respective flags.install.shto automatically detect Fish shell and copy the completion file to~/.config/fish/completions/during installation.README.md.my-unicorn <TAB>andmy-unicorn install <TAB>correctly suggest commands and flags.Type of Change
Checklist
uv run pytest -m 'not slow'uv run pytest tests/e2e/(WARNING: This tests would use real api connection, make sure you setup your token. Also, this would take time according to your internet speed.)