A shell plugin that uses an llm to convert natural language or pseudo-code into actual shell commands. It is not just an llm client, but integrates into the shell for convenience and speed.
- (For now limited to OpenAI, open an issue to request other providers.)
- Fish, Zsh or Bash shell
- curl
- jq
- An OpenAI API key
- Install
shellmind
and bind it to a key - Type a pseudo-code command in your shell
- Press your assigned key to replace the pseudo-code with a real command
First, make sure to set the environment variable OPENAI_API_KEY
to a valid
OpenAI API key.
-
Put the
shellmind.fish
file from this repo into.config/fish/functions/
. You may edit that file for some optional configuration options. -
Add a keybind to
.config/fish/functions/fish_user_key_bindings.fish
:function fish_user_key_bindings # ... # Your other keybinds # ... # For Ctrl-X: bind \cx 'shellmind' # For Ctrl-X in insert mode when using Vi mode: bind -M insert \cx 'shellmind' end
-
Put the
shellmind.bash
file from this repo into a directory of your choice. You may edit that file for some optional configuration options. -
Source the file in your
.bashrc
:source /path/to/shellmind.bash
-
Add a keybind to your
.bashrc
:# For Ctrl-G bind -x '"\C-g": shellmind'
-
Put the
shellmind.zsh
file from this repo into a directory of your choice. You may edit that file for some optional configuration options. -
Source the file in your
.zshrc
:source /path/to/shellmind.zsh
-
Add a keybind to your
.zshrc
:# For Ctrl-G: zle -N shellmind bindkey '^G' shellmind