This project provides an AI-powered assistant for your ZSH terminal, leveraging the Perplexity AI API to enhance your command-line experience with smart suggestions, error explanations, command help, and autocompletion.
- AI Command Completion: Get shell command suggestions and autocompletions with Ctrl+Space.
- Error Analysis: Instantly analyze and get fixes for failed commands with Ctrl+E.
- Command Help: Get concise help and examples for any command with Ctrl+H.
- Direct AI Query: Use the
ai
alias to ask the AI anything related to the terminal.
-
Download the configuration file Place
ai-config.zsh
in your preferred configuration directory, for example:~/.config/zsh/ai-config.zsh
. -
Set your Perplexity API key Export your API key in your shell configuration (e.g.,
.zshrc
):export PERPLEXITY_API_KEY="API_TOKEN"
-
Source the AI configuration Add the following lines to your
.zshrc
or equivalent config:# Load AI configuration if [[ -f ~/.config/zsh/ai-config.zsh ]]; then source ~/.config/zsh/ai-config.zsh fi
-
(Optional) Recommended ZSH options For better history handling:
setopt HIST_IGNORE_SPACE setopt APPEND_HISTORY
-
Reload your shell Restart your terminal or run
source ~/.zshrc
to apply changes.
- AI Command Completion: Type a partial command and press Ctrl+Space to get an AI-generated completion.
- Error Analysis: After a failed command, press Ctrl+E to get an explanation and fix.
- Command Help: While typing a command, press Ctrl+H to get help and examples.
- Direct AI Query: Use the
ai
command followed by your question, e.g.:ai How do I find all files larger than 1GB?
MIT