
howdoi
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.
Installation
# via pip
pip install howdoi
# via Homebrew
brew install howdoi

Alternatives & related tools
Maigret
OSINT CLI that searches about 5,900 sites for accounts by username and extracts profile data into reports, with no API keys required.
sherlock
CLI tool that searches for usernames across 400+ social networks and websites
rga
Line-oriented search tool that extends ripgrep to search inside PDFs, archives, documents, and multimedia files
peco
Interactive line filter written in Go that reads stdin, filters incrementally as you type, and prints selected lines to stdout. Single binary, no dependencies.
skim
Fuzzy finder written in Rust with interactive search capabilities and shell integration
add a badge to your README
Maintain howdoi? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/howdoi?utm_source=badge)<a href="https://www.trmn.sh/tools/howdoi?utm_source=badge"><img src="https://www.trmn.sh/badge/howdoi.svg" alt="Featured on trmn" height="20"></a>