vercel docs
The vercel docs command searches the Vercel docs and prints docs pages as Markdown. Use vercel docs search to find pages by keyword and vercel docs inspect to read a page. You don't need to log in or link a project.
Run vercel docs search with a search query to find docs pages:
vercel docs search "environment variables"Running vercel docs without a command shows its help.
Search returns one result per page, best match first. Each result displays the page title, URL, and description. When the best match is a section of the page, the result also displays the section heading, and its URL links to that section. The results go to stdout. Use JSON output to pipe results to another program.
The search query is required. Multiple words form one query, so vercel docs search edge config and vercel docs search "edge config" use the same query. The query can be up to 200 characters. Search returns up to five pages by default.
When no pages match, the command suggests searching Knowledge Base guides with vercel kb search instead.
Pass a docs page's path or its full URL to print the page as Markdown:
vercel docs inspect functions
vercel docs inspect /docs/routing/rewrites
vercel docs inspect https://vercel.com/docs/routing/rewritesThe path is the part of the URL after /docs/. A section anchor or .md suffix in the URL is ignored, so you can pass a URL from search results as is. Use /docs or https://vercel.com/docs for the docs home page.
The Markdown includes the page's frontmatter and body, and goes to stdout. Redirect it to save the page to a file:
vercel docs inspect functions > functions.mdUse --limit, or its shorthand -n, to set the number of search results. The value must be a whole number of 1 or more and defaults to 5. Values above 20 use 20 and print a warning. This option applies to search only:
vercel docs search "rewrites" --limit 10
vercel docs search "function timeout" -n 3Use --json to write structured JSON to stdout for scripts and agents. --format=json produces the same output:
vercel docs search "function timeout" --limit 3 --json
vercel docs inspect functions --jsonEach command returns a different shape:
| Command | Output |
|---|---|
vercel docs search | An object with a docs array of matching pages. |
vercel docs inspect | An object with a page that has path, url, and Markdown content fields. |
Each item in the docs array has these fields:
| Field | Description |
|---|---|
title | The page's title. |
url | The URL of the page. |
path | The page's path after /docs/, which vercel docs inspect accepts. The docs home page has an empty path. |
description | A short description of the page, or null. |
section | The matching section, with title and url fields, or null when the match is the page itself. |
With jq installed, list the URLs of the best matches:
vercel docs search "environment variables" --limit 2 --json | jq -r '.docs[].url'The output depends on the current docs, for example:
https://vercel.com/docs/environment-variables
https://vercel.com/docs/functions/runtimes/edgeSearch, then print the best-matching page as Markdown:
vercel docs inspect "$(vercel docs search "environment variables" --limit 1 --json | jq -r '.docs[0].url')"The command exits successfully when it completes a search, including when no pages match. It exits with code 1 when it can't reach the Vercel docs, is rate limited, or can't find the page you pass to inspect. It exits with code 2 for invalid input, such as a missing search query, a query longer than 200 characters, an invalid --limit value, or a value that isn't a docs path or Vercel docs URL.
With --json, errors are JSON objects on stderr containing a reason, a message, and, when one applies, a next command to recover.
The following global options can be passed when using the vercel docs command:
For more information on global options and their usage, refer to the options section.
Was this helpful?