A web-search CLI tool assisted with AI for quick research in between commands.
A lightweight shell function that lets you ask questions directly from your terminal. The AI automatically searches the web when needed and provides real-time answers with proper citations.
- 🔍 Automatic web search - AI decides when to search for current information
- 🌀 Live status indicators - Shows "🔎 Searching" and "🤔 Thinking" spinners
- 🎯 Smart context - Searches for weather, news, current events, and more
- ⚡ Fast & lightweight - Minimal dependencies, runs in any terminal
- Python 3.7+
- OpenAI API key
# Clone or download the install script, then run:
bash install.sh
# Or manually:
pip install -r requirements.txt
chmod +x shellsearch.py-
Set your OpenAI API key:
export OPENAI_API_KEY="sk-..."
Or store it in
~/keys/openaikey.json:{ "OPENAI_API_KEY": "sk-..." } -
Reload your shell:
source ~/.zshrc
Simply use ? followed by your question:
? what's the weather in tokyo right now
? latest news on AI
? explain kubernetes in simple terms
? upcoming movies in 2024The tool will:
- Show a thinking spinner while the AI processes your query
- Automatically search the web if needed (yellow "Searching" spinner)
- Display the final answer with sources
# Current information
? what's the stock price of AAPL
# Weather queries
? weather in amsterdam now
# General knowledge
? how does photosynthesis work
# News & current events
? latest updates on space explorationEdit ~/scripts/shellsearch.py to customize:
- Spinner style: Change
SPINNER_STYLEto"arc"or"pulse" - Model: Change
model="gpt-4o-mini"to other OpenAI models - Prompt wrapper: Modify the wrapper in
.zshrcfunction
See requirements.txt: