Command-line tool that provides instant coding answers by querying Stack Overflow without opening a browser.
howdoi is a command-line search tool that fetches programming answers directly from Stack Overflow and other StackExchange sites. Instead of opening a browser to search for coding solutions, developers can query howdoi from the terminal using natural language questions like howdoi format date bash or howdoi print stack trace python. The tool returns code snippets and explanations extracted from the top Stack Overflow answers.
The tool supports multiple search engines (Google, Bing, DuckDuckGo) and allows customization through various flags. Users can specify the number of answers to return with -n, get colorized output with -c, view full answer text with -a, or return results in JSON format with -j. It also includes a stashing feature to save frequently accessed answers locally for offline reference.
howdoi can search across different StackExchange properties by setting the HOWDOI_URL environment variable, enabling queries to specialized communities like cooking.stackexchange.com. The tool integrates with popular development environments through extensions for VSCode, Emacs, Slack, Discord, and Alfred. It requires Python 3.7 or newer and works by parsing web search results to extract relevant code snippets and explanations from community-driven Q&A sites.
# via pip
pip install howdoi
# via Homebrew
brew install howdoi
