@docsearch/cli
v0.0.2
Published
Command-line tools for installing and querying DocSearch MCP.
Readme
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/cliOr install the docsearch command globally:
npm install --global @docsearch/cliRequires Node.js 20 or later.
Set up the DocSearch MCP
Run the interactive installer:
docsearch setupThe 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 --yesProject 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 3Pass --json to write the raw MCP result as JSON:
docsearch docs Next.js "cache revalidation" --jsonMachine-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 JSONSet 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