ScriptsMay 24, 2026·2 min read

howdoi — Instant Coding Answers from the Command Line

Search Stack Overflow and programming documentation from your terminal and get concise code snippets without leaving your workflow.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
howdoi Overview
Direct install command
npx -y tokrepo@latest install 4dd1c181-576b-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

howdoi fetches concise answers to programming questions directly from your terminal. It scrapes top-voted Stack Overflow responses and returns code snippets, saving developers from context-switching to a browser.

What howdoi Does

  • Answers free-form programming questions with code snippets from Stack Overflow
  • Returns the top-voted answer by default or all answers with the -a flag
  • Supports colorized output with syntax highlighting
  • Provides a REPL mode for interactive question sessions
  • Caches responses locally to speed up repeated queries

Architecture Overview

howdoi is a Python CLI that uses search engines to find relevant Stack Overflow threads, then parses the HTML to extract the highest-scored code blocks. It employs a local cache (file-based or optional Redis) to avoid repeated network calls. The tool can use Google, Bing, or DuckDuckGo as the search backend.

Self-Hosting & Configuration

  • Install via pip install howdoi or pipx install howdoi
  • Set HOWDOI_SEARCH_ENGINE to choose between google, bing, or duckduckgo
  • Configure cache directory with HOWDOI_CACHE environment variable
  • Use HOWDOI_COLORIZE=1 to enable syntax-highlighted output
  • Integrate into editors via the included Emacs and Vim plugins

Key Features

  • Answers returned as ready-to-paste code snippets
  • Multiple search engine backends for reliability
  • Local caching reduces latency for repeated lookups
  • Colorized terminal output with language detection
  • Importable as a Python library for programmatic use

Comparison with Similar Tools

  • cheat.sh — serves curated cheat sheets; howdoi searches live Stack Overflow answers
  • tldr-pages — short man-page alternatives for commands; howdoi answers arbitrary coding questions
  • Stack Overflow CLI — official SO search; howdoi extracts code snippets rather than full pages
  • ShellGPT — LLM-powered answers; howdoi uses proven human-written solutions from SO

FAQ

Q: Does howdoi require an API key? A: No. It uses web scraping to retrieve answers without authentication.

Q: How accurate are the answers? A: howdoi returns the top-voted Stack Overflow answer, which reflects community consensus but may not always fit your exact context.

Q: Can I use howdoi in scripts? A: Yes. Import it as a Python library with from howdoi import howdoi and call howdoi.howdoi(query).

Q: Does it support languages other than English? A: Queries work best in English since it searches English-language Stack Overflow.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets