Get AI-powered command suggestions **directly** in your zsh shell.
Go
223
37 commits
updated Aug 11, 2026
[!NOTE]
This project is a fork of zsh-copilot by Myzel394.
Get AI-powered command suggestions directly in your zsh shell. No complex setup, no external tools - just press CTRL + O and get intelligent command suggestions powered by OpenAI, Anthropic Claude, Google Gemini, or DeepSeek.
[!NOTE]
This project is still in its early stages, and some features may be immature and unstable. I appreciate your understanding.
https://github.com/user-attachments/assets/90eaf300-c891-4ef9-958d-9890f53f9929
https://github.com/user-attachments/assets/0e126456-4e52-4693-a8a8-d3bdb8a133e0
Why don't I use zsh-copilot and instead fork a separate version?
Because the context of zsh-copilot only includes history commands and does not include the terminal buffer (i.e., the stdout/stderr of history commands), it cannot achieve the context-aware intelligent prediction I want, this is the feature I want the most, and it's also the main reason why I forked. Additionally, since zsh-copilot is written in shell, it's very difficult to concatenate JSON and implement stdio interception. Therefore, I re-implemented almost all logic using Go, which made it too different from the original project to merge back.
Make sure you have the following installed:
The easiest way to install smart-suggestion is using our installation script:
curl -fsSL https://raw.githubusercontent.com/yetone/smart-suggestion/main/install.sh | bash
This script will:
~/.config/smart-suggestion~/.zshrc automatically with proxy mode enabled by defaultUninstall:
curl -fsSL https://raw.githubusercontent.com/yetone/smart-suggestion/main/install.sh | bash -s -- --uninstall
git clone https://github.com/yetone/smart-suggestion ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/smart-suggestion
smart-suggestion to your plugins array in ~/.zshrc:omz plugin enable smart-suggestion
cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/smart-suggestion
./build.sh
source ~/.zshrc
~/.zshrc:zinit as"program" atclone'./build.sh' \
atpull'%atclone' pick"smart-suggestion" src"smart-suggestion.plugin.zsh" for \
yetone/smart-suggestion
zi update
git clone https://github.com/yetone/smart-suggestion ~/.config/smart-suggestion
cd ~/.config/smart-suggestion
./build.sh
~/.zshrc:source ~/.config/smart-suggestion/smart-suggestion.plugin.zsh
source ~/.zshrc
Download the latest release for your platform from GitHub Releases
Extract the archive:
mkdir -p ~/.config/smart-suggestion
tar -xzf smart-suggestion-*.tar.gz -C ~/.config/smart-suggestion --strip-components=1
~/.zshrc:source ~/.config/smart-suggestion/smart-suggestion.plugin.zsh
source ~/.zshrc
You need an API key for at least one of the supported AI providers:
export OPENAI_API_KEY="your-openai-api-key"
export AZURE_OPENAI_API_KEY="your-azure-openai-api-key" # i.e. c0123456789012345678901234567890
export AZURE_OPENAI_RESOURCE_NAME="your-azure-openai-resource-name" # i.e. awesome-corp when your endpoint is https://awesome-corp.openai.azure.com
export AZURE_OPENAI_DEPLOYMENT_NAME="your-deployment-name" # i.e. gpt-4o
export AZURE_OPENAI_API_VERSION="2024-10-21" # Optional, defaults to 2024-10-21
export AZURE_OPENAI_BASE_URL="https://your-azure-openai-base-url" # Optional, default to https://$AZURE_OPENAI_RESOURCE_NAME.openai.azure.com
export ANTHROPIC_API_KEY="your-anthropic-api-key"
export GEMINI_API_KEY="your-gemini-api-key"
export DEEPSEEK_API_KEY="your-deepseek-api-key"
Configure the plugin behavior with these environment variables:
| Variable | Description | Default | Options |
|---|---|---|---|
SMART_SUGGESTION_AI_PROVIDER | AI provider to use | Auto-detected | openai, azure_openai, anthropic, gemini, deepseek |
SMART_SUGGESTION_KEY | Keybinding to trigger suggestions | ^o | Any zsh keybinding |
SMART_SUGGESTION_SEND_CONTEXT | Send shell context to AI | true | true, false |
SMART_SUGGESTION_PROXY_MODE | Enable proxy mode for better context | true | true, false |
SMART_SUGGESTION_DEBUG | Enable debug logging | false | true, false |
SMART_SUGGESTION_SYSTEM_PROMPT | Custom system prompt | Built-in | Any string |
SMART_SUGGESTION_AUTO_UPDATE | Enable automatic update checking | true | true, false |
SMART_SUGGESTION_UPDATE_INTERVAL | Days between update checks | 7 | Any positive integer |
SMART_SUGGESTION_BINARY | Path to the smart_suggestion binary | Auto-detected | Any valid filepath to a valid smart_suggestion binary |
If SMART_SUGGESTION_BINARY is not specified, we look for one in the following locations:
smart_suggestion beside the current smart-suggestion.plugin.zsh~/.config/smart-suggestion/smart_suggestionexport OPENAI_BASE_URL="your-custom-openai-endpoint.com"
export AZURE_OPENAI_BASE_URL="your-custom-azure-openai-endpoint.com"
export ANTHROPIC_BASE_URL="your-custom-anthropic-endpoint.com"
export GEMINI_BASE_URL="your-custom-gemini-endpoint.com"
export DEEPSEEK_BASE_URL="your-custom-deepseek-endpoint.com"
export GEMINI_MODEL="gemini-1.5-pro" # Default: gemini-1.5-flash
export SMART_SUGGESTION_HISTORY_LINES="20" # Default: 10
To see all available configurations and their current values:
smart-suggestion
CTRL + O (or your configured key)→ (for completions)+) or new command (=)Smart Suggestion now automatically enables proxy mode by default, which provides significantly better context awareness by recording your terminal session. This mode:
script command for maximum compatibilityYou can disable proxy mode if needed:
export SMART_SUGGESTION_PROXY_MODE=false
For advanced proxy configuration, see PROXY_USAGE.md.
Enable debug logging to troubleshoot issues:
export SMART_SUGGESTION_DEBUG=true
Debug logs are written to /tmp/smart-suggestion.log.
./build.sh in the plugin directorySMART_SUGGESTION_KEY to a different keyIf the build fails:
# Check Go installation
go version
# Clean and rebuild
rm -f smart-suggestion
./build.sh
Contributions are welcome! Please feel free to submit issues and pull requests.
This project is open source. Please check the repository for license details.
541 followers · starred Jun 2025
139 followers · starred Jul 2025
688 followers · starred Jul 2025
93 followers · starred Jun 2025
Get AI-powered command suggestions **directly** in your zsh shell.
Go
223
37 commits
updated Aug 11, 2026
[!NOTE]
This project is a fork of zsh-copilot by Myzel394.
Get AI-powered command suggestions directly in your zsh shell. No complex setup, no external tools - just press CTRL + O and get intelligent command suggestions powered by OpenAI, Anthropic Claude, Google Gemini, or DeepSeek.
[!NOTE]
This project is still in its early stages, and some features may be immature and unstable. I appreciate your understanding.
https://github.com/user-attachments/assets/90eaf300-c891-4ef9-958d-9890f53f9929
https://github.com/user-attachments/assets/0e126456-4e52-4693-a8a8-d3bdb8a133e0
Why don't I use zsh-copilot and instead fork a separate version?
Because the context of zsh-copilot only includes history commands and does not include the terminal buffer (i.e., the stdout/stderr of history commands), it cannot achieve the context-aware intelligent prediction I want, this is the feature I want the most, and it's also the main reason why I forked. Additionally, since zsh-copilot is written in shell, it's very difficult to concatenate JSON and implement stdio interception. Therefore, I re-implemented almost all logic using Go, which made it too different from the original project to merge back.
Make sure you have the following installed:
The easiest way to install smart-suggestion is using our installation script:
curl -fsSL https://raw.githubusercontent.com/yetone/smart-suggestion/main/install.sh | bash
This script will:
~/.config/smart-suggestion~/.zshrc automatically with proxy mode enabled by defaultUninstall:
curl -fsSL https://raw.githubusercontent.com/yetone/smart-suggestion/main/install.sh | bash -s -- --uninstall
git clone https://github.com/yetone/smart-suggestion ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/smart-suggestion
smart-suggestion to your plugins array in ~/.zshrc:omz plugin enable smart-suggestion
cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/smart-suggestion
./build.sh
source ~/.zshrc
~/.zshrc:zinit as"program" atclone'./build.sh' \
atpull'%atclone' pick"smart-suggestion" src"smart-suggestion.plugin.zsh" for \
yetone/smart-suggestion
zi update
git clone https://github.com/yetone/smart-suggestion ~/.config/smart-suggestion
cd ~/.config/smart-suggestion
./build.sh
~/.zshrc:source ~/.config/smart-suggestion/smart-suggestion.plugin.zsh
source ~/.zshrc
Download the latest release for your platform from GitHub Releases
Extract the archive:
mkdir -p ~/.config/smart-suggestion
tar -xzf smart-suggestion-*.tar.gz -C ~/.config/smart-suggestion --strip-components=1
~/.zshrc:source ~/.config/smart-suggestion/smart-suggestion.plugin.zsh
source ~/.zshrc
You need an API key for at least one of the supported AI providers:
export OPENAI_API_KEY="your-openai-api-key"
export AZURE_OPENAI_API_KEY="your-azure-openai-api-key" # i.e. c0123456789012345678901234567890
export AZURE_OPENAI_RESOURCE_NAME="your-azure-openai-resource-name" # i.e. awesome-corp when your endpoint is https://awesome-corp.openai.azure.com
export AZURE_OPENAI_DEPLOYMENT_NAME="your-deployment-name" # i.e. gpt-4o
export AZURE_OPENAI_API_VERSION="2024-10-21" # Optional, defaults to 2024-10-21
export AZURE_OPENAI_BASE_URL="https://your-azure-openai-base-url" # Optional, default to https://$AZURE_OPENAI_RESOURCE_NAME.openai.azure.com
export ANTHROPIC_API_KEY="your-anthropic-api-key"
export GEMINI_API_KEY="your-gemini-api-key"
export DEEPSEEK_API_KEY="your-deepseek-api-key"
Configure the plugin behavior with these environment variables:
| Variable | Description | Default | Options |
|---|---|---|---|
SMART_SUGGESTION_AI_PROVIDER | AI provider to use | Auto-detected | openai, azure_openai, anthropic, gemini, deepseek |
SMART_SUGGESTION_KEY | Keybinding to trigger suggestions | ^o | Any zsh keybinding |
SMART_SUGGESTION_SEND_CONTEXT | Send shell context to AI | true | true, false |
SMART_SUGGESTION_PROXY_MODE | Enable proxy mode for better context | true | true, false |
SMART_SUGGESTION_DEBUG | Enable debug logging | false | true, false |
SMART_SUGGESTION_SYSTEM_PROMPT | Custom system prompt | Built-in | Any string |
SMART_SUGGESTION_AUTO_UPDATE | Enable automatic update checking | true | true, false |
SMART_SUGGESTION_UPDATE_INTERVAL | Days between update checks | 7 | Any positive integer |
SMART_SUGGESTION_BINARY | Path to the smart_suggestion binary | Auto-detected | Any valid filepath to a valid smart_suggestion binary |
If SMART_SUGGESTION_BINARY is not specified, we look for one in the following locations:
smart_suggestion beside the current smart-suggestion.plugin.zsh~/.config/smart-suggestion/smart_suggestionexport OPENAI_BASE_URL="your-custom-openai-endpoint.com"
export AZURE_OPENAI_BASE_URL="your-custom-azure-openai-endpoint.com"
export ANTHROPIC_BASE_URL="your-custom-anthropic-endpoint.com"
export GEMINI_BASE_URL="your-custom-gemini-endpoint.com"
export DEEPSEEK_BASE_URL="your-custom-deepseek-endpoint.com"
export GEMINI_MODEL="gemini-1.5-pro" # Default: gemini-1.5-flash
export SMART_SUGGESTION_HISTORY_LINES="20" # Default: 10
To see all available configurations and their current values:
smart-suggestion
CTRL + O (or your configured key)→ (for completions)+) or new command (=)Smart Suggestion now automatically enables proxy mode by default, which provides significantly better context awareness by recording your terminal session. This mode:
script command for maximum compatibilityYou can disable proxy mode if needed:
export SMART_SUGGESTION_PROXY_MODE=false
For advanced proxy configuration, see PROXY_USAGE.md.
Enable debug logging to troubleshoot issues:
export SMART_SUGGESTION_DEBUG=true
Debug logs are written to /tmp/smart-suggestion.log.
./build.sh in the plugin directorySMART_SUGGESTION_KEY to a different keyIf the build fails:
# Check Go installation
go version
# Clean and rebuild
rm -f smart-suggestion
./build.sh
Contributions are welcome! Please feel free to submit issues and pull requests.
This project is open source. Please check the repository for license details.
541 followers · starred Jun 2025
139 followers · starred Jul 2025
688 followers · starred Jul 2025
93 followers · starred Jun 2025