1
0
Fork 0
docsearch/packages/docsearch-cli
2026-07-16 14:59:00 -04:00
..
src chore: Move to oxlint and oxfmt (#2923) 2026-07-16 14:59:00 -04:00
CHANGELOG.md feat(cli): add @docsearch/cli for MCP setup and search (#2911) 2026-07-14 16:46:18 +02:00
package.json feat(cli): add @docsearch/cli for MCP setup and search (#2911) 2026-07-14 16:46:18 +02:00
README.md feat(cli): add @docsearch/cli for MCP setup and search (#2911) 2026-07-14 16:46:18 +02:00
tsconfig.json chore: Move to oxlint and oxfmt (#2923) 2026-07-16 14:59:00 -04:00
vitest.config.mts feat(cli): add @docsearch/cli for MCP setup and search (#2911) 2026-07-14 16:46:18 +02:00

DocSearch CLI

Install the hosted DocSearch MCP in your AI coding agents and search public developer documentation from the terminal.

Run without installing

npx @docsearch/cli

Or install the docsearch command globally:

npm install --global @docsearch/cli

Requires Node.js 20 or later.

Set up the DocSearch MCP

Run the interactive installer:

docsearch setup

The installer asks whether to configure the current project or your global agent settings, then lets you select any detected agents. It supports:

  • Cursor
  • Claude Code
  • Codex
  • OpenCode
  • Gemini CLI

Skip the prompts with explicit flags:

docsearch setup --project --cursor --claude --yes
docsearch setup --global --all --yes

Project setup locates the repository root before writing configuration. Re-running setup is idempotent and preserves unrelated configuration.

Search documentation

Use docs for most questions:

docsearch docs Next.js "how do middleware matchers work"

For explicit docset selection, resolve a product and then query its docset:

docsearch resolve "Algolia InstantSearch React"
docsearch query repo/algolia/instantsearch "configure the React search client"

Limit the returned results when needed:

docsearch docs Next.js "cache revalidation" --max-results 3 --max-docsets 2
docsearch resolve Next.js --top-n 3

Pass --json to write the raw MCP result as JSON:

docsearch docs Next.js "cache revalidation" --json

Machine-readable results are written to stdout. Progress and errors are written to stderr.

Options

--project             Install into the current repository
--global              Install into user-level agent settings
--all                 Configure every supported agent
--cursor              Configure Cursor
--claude              Configure Claude Code
--codex               Configure Codex
--opencode            Configure OpenCode
--gemini              Configure Gemini CLI
--yes, -y             Run setup non-interactively
--endpoint <url>      Override the hosted DocSearch MCP endpoint
--json                Print raw MCP results as JSON

Set NO_COLOR to disable terminal colors.

Development

From the DocSearch monorepo root:

bun install
bun run --filter @docsearch/cli build
bun run --filter @docsearch/cli test

License

MIT