Visitar URL original
vercel docsSkip to content

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:

terminal
vercel docs search "environment variables"
Search the Vercel docs for pages about 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:

terminal
vercel docs inspect functions
vercel docs inspect /docs/routing/rewrites
vercel docs inspect https://vercel.com/docs/routing/rewrites
Print a page by its path, or by its URL.

The 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:

terminal
vercel docs inspect functions > functions.md
Save a docs page as a Markdown file.

Use --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:

terminal
vercel docs search "rewrites" --limit 10
vercel docs search "function timeout" -n 3
Return up to 10 or three search results.

Use --json to write structured JSON to stdout for scripts and agents. --format=json produces the same output:

terminal
vercel docs search "function timeout" --limit 3 --json
vercel docs inspect functions --json
Get search results or a single page as JSON.

Each command returns a different shape:

CommandOutput
vercel docs searchAn object with a docs array of matching pages.
vercel docs inspectAn object with a page that has path, url, and Markdown content fields.

Each item in the docs array has these fields:

FieldDescription
titleThe page's title.
urlThe URL of the page.
pathThe page's path after /docs/, which vercel docs inspect accepts. The docs home page has an empty path.
descriptionA short description of the page, or null.
sectionThe 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:

terminal
vercel docs search "environment variables" --limit 2 --json | jq -r '.docs[].url'
Print the URL of each search result, one per line.

The output depends on the current docs, for example:

output
https://vercel.com/docs/environment-variables
https://vercel.com/docs/functions/runtimes/edge

Search, then print the best-matching page as Markdown:

terminal
vercel docs inspect "$(vercel docs search "environment variables" --limit 1 --json | jq -r '.docs[0].url')"
Print the top search result as Markdown.

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?

supported.