| Crates.io | aishell |
| lib.rs | aishell |
| version | 0.1.2 |
| created_at | 2025-02-23 17:15:43.156313+00 |
| updated_at | 2025-02-23 17:30:02.161366+00 |
| description | A shell that understands and suggests fixes for failed commands. |
| homepage | https://github.com/ryankopf/aishell |
| repository | https://github.com/ryankopf/aishell |
| max_upload_size | |
| id | 1566523 |
| size | 83,014 |
aishell is a smart shell assistant that understands commands sent to the shell. If a command fails or is typed incorrectly (e.g., "gerp" instead of "grep"), aishell suggests a fix for the command. The fix is placed into the shell history, so the user can press the up arrow and hit enter to execute the corrected command.

** Feel free to submit PRs for other systems. **
cargo install aishell
aishell add-to-shell
To install aishell on Ubuntu using bash, follow these steps:
Clone the repository:
git clone https://github.com/yourusername/aishell.git
cd aishell
Build the project:
cargo build --release
Move the binary to /usr/local/bin:
sudo mv target/release/aishell /usr/local/bin
Run the installation script:
./install.sh
Set your OPENAI_API_KEY in your ~/.bashrc file, like:
export OPENAI_API_KEY="sk-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb11111111111111"
To initialize aishell in your shell, add the following to your ~/.bashrc or ~/.zshrc file:
eval "$(aishell init bash)" # For bash
# or
eval "$(aishell init zsh)" # For zsh
For fish shell, add the following to your ~/.config/fish/config.fish file:
aishell init fish | source
Add to shell in ~/.bashrc or ~/.zshrc:
eval "$(aishell init bash)"
You also have to add a function to enable the (Ctrl+T) functionality:
aishell_suggestion() {
local suggestion_file="/tmp/aishell_suggestion"
if [ -f "$suggestion_file" ]; then
fix=$(< "$suggestion_file")
rm -f "$suggestion_file"
# Put it on the current command line:
READLINE_LINE="$fix"
READLINE_POINT=${#fix}
else
echo "No suggestion available."
fi
}
# Bind Ctrl+T to that function
bind -x '"\C-t":aishell_suggestion'
Build and move the binary:
cargo build --release
sudo mv target/release/aishell /usr/local/bin
eval "$(aishell init bash)" # Or zsh/fish