Smart-Shell
July 7, 2025 ยท View on GitHub
Smart-Shell is in active development.
Smart-Shell is an intelligent terminal assistant that converts natural language into executable Bash or Zsh commands using Google's Gemini AI models via the new google-genai SDK.
โจ Features
-
๐ง Natural Language to Command
Convert plain English into valid Bash/Zsh commands instantly. -
๐ Shell Auto-Detection
Automatically detects and supports both Bash and Zsh environments. -
๐ฌ Interactive Mode with Command History
Rich REPL interface with protected prompt and support for special commands like:
!help,!docs,!models,!history,!clear,!redo,!last,!creator,!forget-sudo,!update,!errors,!web, and more. -
๐ก๏ธ Built-in Safety System
Analyzes each command and classifies it into four risk levels with detailed reasoning:- โ Safe โ Executed automatically.
- ๐ต Info Leak โ May expose sensitive data (requires confirmation).
- ๐ก Medium โ Sudo operations and system changes (requires y/n confirmation).
- ๐ด High โ Dangerous operations like file deletion (requires y/n confirmation).
This ensures potentially destructive commands are never run without user awareness.
-
๐ค AI-Powered Command Planning
Generates and refines shell commands using Google Gemini models. -
๐ Multi-Model Support with Smart Warnings
Easily switch between Gemini Pro, Flash, and Legacy models with detailed cost information and confirmation prompts for premium models. -
๐ณ Smart Cost Awareness
Real-time model pricing information with detailed cost breakdowns and confirmation prompts when switching to premium models. -
๐งช Dry-Run Mode
Preview the exact command before execution for extra safety and transparency. -
๐ Standard CLI Commands
Includes--help,--version, and other CLI flags for quick access. -
๐ฅ๏ธ Desktop Integration
Comes with a.desktopentry โ launch directly from your system's Application Menu. -
โจ๏ธ Tab Completion
Supports intelligent tab completion for both Bash and Zsh shells. -
๐ Simple Setup
Easy configuration of your API key and sudo password during first run. -
๐ Web Search Integration
When enabled, Smart-Shell performs relevant web searches in real-time to enhance command accuracy.
AI combines local knowledge with live web results to refine its suggestions โ giving you smarter, context-aware commands.
You can toggle web search anytime using the!webcommand. -
โก Modern CLI Experience
A clean and user-friendly terminal UI with colorful output and rich formatting. -
๐ ๏ธ Open Source & Extensible
Easily extend functionality or contribute โ fully open and developer-friendly.
Quick Install (Recommended)
Install Smart-Shell with a single command:
curl -sSL https://raw.githubusercontent.com/Lusan-sapkota/smart-shell/main/install.sh | bash
Our intelligent installation script:
- โ Automatically checks and installs all dependencies (including pipx if needed)
- โ Handles package installation with proper isolation
- โ Creates desktop entries and command completion
- โ Fixes common Python module path issues
- โ Runs the setup wizard to configure your API key
After installation, use Smart-Shell from any terminal:
smart-shell
The first time you run Smart-Shell, it will guide you through setting up your Google Gemini API key. You can also run the setup wizard anytime:
smart-shell setup
For manual installation and development instructions, see docs/DEVELOPMENT.md.
๏ฟฝ๏ธ Uninstall
To completely remove Smart-Shell from your system, run this single command:
curl -sSL https://raw.githubusercontent.com/Lusan-sapkota/smart-shell/main/install.sh | bash -s -- --uninstall
Manual Uninstall
If you prefer to uninstall manually, follow these steps:
1. Remove the Smart-Shell package:
# If installed with pipx (recommended)
pipx uninstall smart-shell
# If installed system-wide
sudo pip3 uninstall smart-shell
# If installed in a virtual environment
rm -rf ./venv # (from the project directory)
2. Remove configuration files:
rm -rf ~/.config/smart-shell
3. Remove desktop entry:
rm -f ~/.local/share/applications/smart-shell.desktop
4. Remove shell completion:
rm -f ~/.local/share/bash-completion/completions/smart-shell-completion.bash
5. Clean up shell configuration:
# Remove from .bashrc
sed -i '/# Smart-Shell completion/,+1d' ~/.bashrc
# Remove from .zshrc (if exists)
sed -i '/# Smart-Shell completion/,+1d' ~/.zshrc
6. Remove any remaining executables:
rm -f ~/.local/bin/smart-shell
rm -f ~/.local/bin/smart-shell.bak
After completing these steps, restart your terminal or run source ~/.bashrc (or source ~/.zshrc) to reload your shell configuration.
๏ฟฝ๐ Documentation
- Features
- Installation
- Uninstall
- Usage
- Safety
- Development
- API Reference
- Changelog
- License
- Author
- Contributing
- FAQ
- New-Version
๐ Full documentation is available at the Smart-Shell MkDocs site.
๐ License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
๐ค Author
Created by Lusan Sapkota
โ ๏ธ Disclaimer
Smart-Shell is an AI assistant and may occasionally generate incorrect or unsafe commands. Always review commands before execution, especially those involving system modifications or sensitive data.