Rayfin

rayfin docs

Search, list, fetch, discover, and inspect Rayfin package documentation from the terminal with rayfin docs.

rayfin docs queries documentation bundled in the Rayfin packages installed in the current project. Use it when an MCP server is unavailable or when a script needs JSON output.

How docs are discovered

The CLI scans node_modules for packages with a rayfinDocs field and indexes their bundled Markdown. Results are version-locked to the project's installed packages. Areas accepted by --module are guide, host, and ts-sdk.

A package advertises docs with a rayfinDocs field in its package.json:

node_modules/@microsoft/rayfin-guide/package.json
{
  "rayfinDocs": {
    "version": 1,
    "dir": "assets/docs",
    "module": "rayfin-guide",
    "kind": "guide"
  }
}

The kind value determines the docs area exposed through --module. Guide and TypeScript SDK docs load by default. Host docs are available when installed and selected with --module host.

docs list

npx rayfin docs list --module guide
OptionDefaultDescription
-m, --module <name>all default areasLimit results to guide, host, or ts-sdk.
--jsonfalseEmit a JSON object.
--leanfalseWith --json, emit only the inner array.
--no-cachefalseRebuild the on-disk docs index cache.
npx rayfin docs search "row level security" --scope all --limit 5
OptionDefaultDescription
<query>requiredSearch query. Use quotes for multi-word phrases.
-m, --module <name>all default areasLimit to guide, host, or ts-sdk.
-s, --scope <scope>docsSearch docs, symbols, or all.
-l, --limit <n>10Maximum results, 1–50.
--jsonfalseEmit a JSON object.
--leanfalseWith --json, emit only the inner array.
--no-cachefalseRebuild the docs index cache.

docs get

Changed in 1.36

npx rayfin docs get --symbol RayfinClient

Fetch a doc entry by ID or path, or resolve a symbol name to matching sections. Rayfin 1.36 fixes symbol lookup formatting so symbols such as RayfinClient and '@entity' are resolved consistently.

OptionDefaultDescription
-i, --id <id>—Doc ID, for example guide:guide/data/overview.md.
-p, --path <path>—Doc path, for example guide/data/overview.md.
-s, --symbol <name>—Symbol name, for example RayfinClient or '@entity'.
-m, --module <name>all modulesWith --symbol, limit to guide, host, or ts-sdk.
-l, --limit <n>all matchesWith --symbol, max sections, 1–50.
--jsonfalseEmit a JSON object.
--leanfalseWith --json, emit only the inner entry or sections.
--no-cachefalseRebuild the docs index cache.

Exactly one of --id, --path, or --symbol is required.

docs discover

npx rayfin docs discover "functions secrets"

Finds Rayfin packages by free-form query when the installed corpus is missing the topic.

OptionDefaultDescription
<query>requiredFree-form package query.
--jsonfalseEmit JSON.
--leanfalseEmit compact JSON without the envelope.
-l, --limit <n>10Max results, 1–50.

docs catalog show

npx rayfin docs catalog show --json

Displays the in-memory package discovery catalog.

OptionDescription
--jsonEmit JSON.
--leanEmit compact JSON without the envelope.

When to use the CLI versus MCP

Prefer the MCP server when it is connected because agents can call structured tools instead of parsing terminal output. Use rayfin docs when MCP is unavailable, when you need an offline terminal workflow, or when a script needs --json/--lean output and exit codes.

MCP server

@microsoft/rayfin-mcp exposes the same version-locked docs corpus over MCP. rayfin init ai-files install writes the mcpServers.rayfin entry in .mcp.json:

.mcp.json
{
  "mcpServers": {
    "rayfin": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@microsoft/rayfin-mcp", "start"]
    }
  }
}

Run your agent from the project root so the server resolves that project's packages.

MCP toolClosest CLI command
search_docs(query, module)rayfin docs search <query> --module <module>
get_doc(idOrSymbol)rayfin docs get --id <id> or rayfin docs get --symbol <name>
list_docs(module)rayfin docs list --module <module>
discover_packages(query)rayfin docs discover <query>

Use CLI JSON output when MCP is unavailable:

npx rayfin docs search "row level security" --module guide --json --lean
PromptFind version-locked Rayfin docs
Run `npx rayfin docs search "externalEntraExchange" --scope all --json` from my Rayfin project root, then use `npx rayfin docs get --id <id>` on the best result and summarize whether my installed packages support the setting.
Something wrong on this page?Report an issueEdit this page

On this page