Skip to content

feat: add fish shell completion support (#263)#310

Open
hydrauluu wants to merge 3 commits intoCyber-Syntax:mainfrom
hydrauluu:main
Open

feat: add fish shell completion support (#263)#310
hydrauluu wants to merge 3 commits intoCyber-Syntax:mainfrom
hydrauluu:main

Conversation

@hydrauluu
Copy link
Copy Markdown

Problem

Fish shell users currently lack TAB autocompletion for my-unicorn commands and flags, while bash/zsh users already have this feature. This creates an inconsistent experience across supported shells. (Fixes #263)

Solution

  • Created completions/my-unicorn.fish with completion rules for all subcommands (install, update, catalog, etc.) and their respective flags.
  • Updated install.sh to automatically detect Fish shell and copy the completion file to ~/.config/fish/completions/ during installation.
  • Added Fish setup instructions to README.md.
  • Manually tested in Fish 3.x: my-unicorn <TAB> and my-unicorn install <TAB> correctly suggest commands and flags.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation
  • Other (please describe)

Checklist

  • If you changed python module:
    • Run all fast tests: uv run pytest -m 'not slow'
    • Run e2e tests: 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.)
  • Add your test (if you can)
  • Add/update docs

Comment thread README.md
```

Restart your shell or run `source ~/.config/fish/completions/my-unicorn.fish` to enable.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please review autocompletion.bash, bash/zsh autocompletion files are never copied to root.

@@ -0,0 +1,102 @@
# my-unicorn fish completion script
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

use already existing autocomplete folder instead of completions

Comment thread install.sh Outdated
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
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please use scripts/autocomplete.bash

@Cyber-Syntax
Copy link
Copy Markdown
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.

@Cyber-Syntax Cyber-Syntax moved this from Ready to In progress in my-unicorn May 6, 2026
@Cyber-Syntax Cyber-Syntax moved this from In progress to In review in my-unicorn May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Add fish autocomplete support

2 participants