Open TheR1D opened 10 months ago
I have try wrote this:
function _sgpt_fish
set -l cmd (echo "$line" | sgpt --shell --no-interaction)
commandline -r $cmd
end
bind \cl _sgpt_fish
But the $line is empty, don't know how to get the input buffer in fish
I get, it work now
function _sgpt_fish
set -l cmd (commandline | sgpt --shell --no-interaction)
commandline -r $cmd
end
bind \cl _sgpt_fish
@onewesong I'd like to try it out. Where do I need to place this snipped? Does it go to ~/.config/fish/completions/ ?
@andyfr If you just want to try, you can just paste it to fish terminal
Didn't work for me (I hit the key after typing "change git branch"):
change git branch Usage: sgpt [OPTIONS] [PROMPT]
Try 'sgpt --help' for help.
╭─ Error ───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ No such option: --no-interaction (Possible options: --install-integration, --no-install-functions, │
│ --no-install-integration) │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
pip install shell-gpt --upgrade
and its working now...
The only thing I miss is the animation :)
Current ShellGPT ingeration works only with Zsh and Bash. Add shell integration for Fish as well.
_Originally posted by @endolith in https://github.com/TheR1D/shell_gpt/discussions/268#discussioncomment-7777678_