sof-cli
v1.0.0
Published
Search StackOverflow in your terminal
Downloads
121
Maintainers
Readme
Installation
npm install -g sof-cliOr run directly with npx:
npx sof-cli search "vim exit"Usage
Search questions
stackoverflow search <query> [options]Examples:
stackoverflow search "PrismaClientKnownRequestError: Invalid `this.prisma.user.upsert()` invocation in" --json
stackoverflow search "pnpm workspace internal packages typescript" --limit 10Options:
| Option | Description | Default |
| ---------------------- | ---------------------------------------------------------- | ------- |
| -l, --limit <number> | Number of results to return | 5 |
| --json | Output results as JSON (useful for scripting or AI agents) | — |
Get question details
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 | — |
Rate Limits
This tool uses the Stack Exchange API. By default, unauthenticated requests are limited to 300 requests per day per IP address.
Increasing the limit to 10,000 requests/day
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 |
License
MIT License
