A lightweight Python-based CLI tool that uses Google Gemini to generate and explain shell commands based on user input. No more browser detours during development. Just search and get the results instantly.
"Who likes to visit the browser every time? ๐"
- ๐ง Generates and explains CLI commands in a single line.
- ๐ Gives a usage example for better understanding.
- โก Uses
gemini-1.5-flash-latest(Google Gemini API) for fast results. - โฑ๏ธ Displays time taken for the response in milliseconds.
- ๐ฅ๏ธ Works fully within your terminal โ no context switching.
- โ Prints usage help if no command is passed.
search git commands to configure username and email globally
Output:
It sets the username and email used for Git commits globally, preventing you from having to specify them for each repository; `git config --global user.name "Your Name" && git config --global user.email "your.email@example.com"`
โจ Time taken: 2524 ms
Ensure Python 3+ is installed:
pip install google-generativeai
or
pip install -r requirements.txt
- Generate new API key from Google AI Studio
- Open .zshrc or .bash depending on your system.
- Add this line then save the file and reload the terminal.
export GEMINI_API_KEY="your-gemini-api-key"- Confirm it worked (gives API key as output)
echo $GEMINI_API_KEYmv search.py search
chmod +x searchsudo mv search /usr/local/bin/Now you can call it like any other shell command:
search docker stop $(docker ps -q)search/
โโโ search.py # Python script
โโโ README.md # Project documentation
โโโ requirements.txt # Dependencies
- Uses
sys.argvto collect the shell command from your input - Calls Gemini API's
generate_content()with a natural prompt - Displays the explanation and example usage with response time in ms
If no input is passed:
searchYou'll see:
Usage: search <your-command>
search git reset --hardsearch how to install nodemon globally- ๐ Python 3
- ๐ฎ Google Gemini API (google-generativeai)
- ๐ก Developer laziness ๐ (the good kind)
Made with โค๏ธ and โ๏ธ by Prajwal Gaikwad
If this tool saved you a trip to Browser, drop a โญ!