shiichan

Search Cloudflare docs from your terminal with cf docs search!

Hi everyone, it's Shii-chan!

Cloudflare Changelog developers.cloudflare.com

No more switching to the browser just to look up docs. Today I'm introducing a new Cloudflare CLI command!

What was announced?

The Cloudflare Changelog announced Cloudflare CLI 1.0.0-beta.16. It includes cf docs search, which lets you and your coding agent find Cloudflare documentation without leaving the terminal.

Why it matters

When a coding agent works on Cloudflare tasks, it helps a lot if it can reach the right, up-to-date docs.

This command gives you a single entry point. You can find guides, tutorials, and examples across Cloudflare products.

What changes

  • Describe what you want to do in the terminal and find the matching docs
  • Results come back as JSON, so agents and scripts can handle them easily
  • You can fetch the page as Markdown and hand it straight to your agent

Dive Deep

First, install or update. With npm, yarn, pnpm, or bun, install the cf package globally with the @latest tag. With npm:

npm install --global cf@latest

Then just describe what you want to do, or ask a question.

cf docs search "proxy a DNS record"
cf docs search "rate limit requests with WAF"
cf docs search "schedule a worker"

Key points:

  • It searches the live Cloudflare documentation
  • It returns up to five ranked results as JSON
  • Each result has a title, a description, and a documentation URL
  • An internet connection is required

The post also shows an agent workflow. Use jq to pick the first result's URL, then request it with the Accept: text/markdown header to get the full page as Markdown.

url=$(cf docs search "proxy a DNS record" | jq -r '.[0].url')
curl -H "Accept: text/markdown" "$url"

This release also has a breaking change: generated command names are now kebab-case, so getCredits becomes get-credits. Check the CLI release notes for the full list of command and flag changes.

Wrap-up

  • Cloudflare CLI 1.0.0-beta.16 adds cf docs search
  • It returns up to five ranked JSON results (title, description, URL)
  • Send Accept: text/markdown to a result URL to get the whole page as Markdown
  • Generated command names are now kebab-case, which is a breaking change

Perfect for anyone using Cloudflare with a coding agent!