StackOverflow CLI - Search StackOverflow in your terminal.
Stackoverflow CLI provides official plugins for Claude Code that integrate seamlessly with the AI-powered development environment. These plugins make it easy to search StackOverflow directly from Claude Code, fetch question details, and analyze results with AI assistance.
Installation
1. Add the Stackoverflow Plugin Marketplace
First, add the Stackoverflow plugin marketplace to Claude Code:
/plugin marketplace add greatsumini/stackoverflow-cli2. Install Plugins
Install the plugins using the following commands:
/plugin install stackoverflow-search@stackoverflow-searchNow you and your claude can use the stackoverflow-search skill in Claude Code 😄
npm install -g sof-cliOr run directly with npx:
npx sof-cli search "vim exit"stackoverflow search <query> [options]Examples:
stackoverflow search "PrismaClientKnownRequestError: Invalid `this.prisma.user.upsert()` invocation in" --json
stackoverflow search "pnpm workspace internal packages typescript" --limit 10
stackoverflow search "python error" --tagged python --accepted
stackoverflow search "react hook" --sort votes --order asc --limit 10
stackoverflow search "sql injection" --title "prevent" --fromdate 2022-01-01Options:
| Option | Description | Default |
|---|---|---|
-l, --limit <number> |
Number of results to return | 5 |
--tagged <tags> |
Filter by tags (semicolon-separated, e.g. "python;django") |
— |
--nottagged <tags> |
Exclude questions with these tags (semicolon-separated) | — |
--title <text> |
Text that must appear in the question title | — |
--body <text> |
Text that must appear in the question body | — |
--accepted |
Only return questions with an accepted answer | — |
--answers <number> |
Minimum number of answers | — |
--views <number> |
Minimum number of views | — |
--user <id> |
Only return questions by this user ID | — |
--sort <sort> |
Sort order: activity, creation, votes, relevance |
relevance |
--order <order> |
Sort direction: asc or desc |
desc |
--fromdate <date> |
Only return questions after this date (YYYY-MM-DD) |
— |
--todate <date> |
Only return questions before this date (YYYY-MM-DD) |
— |
--json |
Output results as JSON (useful for scripting or AI agents) | — |
Fetch the full question body and top answers by question ID.
stackoverflow get_question <id> [options]
# Alias:
stackoverflow get <id> [options]Examples:
stackoverflow get 11828270
stackoverflow get 11828270 --max-answers 5 --jsonOptions:
| Option | Description | Default |
|---|---|---|
--max-answers <number> |
Number of answers to fetch | 3 |
--json |
Output results as JSON | — |
This tool uses the Stack Exchange API. By default, unauthenticated requests are limited to 300 requests per day per IP address.
Register a Stack Exchange application at stackapps.com to get a free App Key, then configure it:
stackoverflow init --key <YOUR_APP_KEY>The key is saved to ~/.config/sof-cli/config.json and applied to all subsequent requests automatically.
| Without Key | With Key | |
|---|---|---|
| Daily request limit | 300 | 10,000 |
MIT License
