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:
{
"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| Option | Default | Description |
|---|---|---|
-m, --module <name> | all default areas | Limit results to guide, host, or ts-sdk. |
--json | false | Emit a JSON object. |
--lean | false | With --json, emit only the inner array. |
--no-cache | false | Rebuild the on-disk docs index cache. |
docs search
npx rayfin docs search "row level security" --scope all --limit 5| Option | Default | Description |
|---|---|---|
<query> | required | Search query. Use quotes for multi-word phrases. |
-m, --module <name> | all default areas | Limit to guide, host, or ts-sdk. |
-s, --scope <scope> | docs | Search docs, symbols, or all. |
-l, --limit <n> | 10 | Maximum results, 1–50. |
--json | false | Emit a JSON object. |
--lean | false | With --json, emit only the inner array. |
--no-cache | false | Rebuild the docs index cache. |
docs get
npx rayfin docs get --symbol RayfinClientFetch 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.
| Option | Default | Description |
|---|---|---|
-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 modules | With --symbol, limit to guide, host, or ts-sdk. |
-l, --limit <n> | all matches | With --symbol, max sections, 1–50. |
--json | false | Emit a JSON object. |
--lean | false | With --json, emit only the inner entry or sections. |
--no-cache | false | Rebuild 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.
| Option | Default | Description |
|---|---|---|
<query> | required | Free-form package query. |
--json | false | Emit JSON. |
--lean | false | Emit compact JSON without the envelope. |
-l, --limit <n> | 10 | Max results, 1–50. |
docs catalog show
npx rayfin docs catalog show --jsonDisplays the in-memory package discovery catalog.
| Option | Description |
|---|---|
--json | Emit JSON. |
--lean | Emit 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:
{
"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 tool | Closest 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 --leanRun `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.