Vibeleaderboard
← All Intel
Intel / article

Cloudflare open-sources Forge to generate SDKs, CLIs and docs in CI

Source
blog.cloudflare.com
Author
Cloudflare
Date

Context

Forge is the system Cloudflare built to generate the software that developers and agents use to work with its API, such as SDKs, command-line tools and documentation, from one machine-readable description of that API. It is now open source under the Apache 2.0 license, and anyone can run it for free. Cloudflare calls it early, but it already generates the output for the new cf command-line tool, and Cloudflare says it will power the company's API documentation and SDKs over the next few months.

The problem Forge addresses is coordination at scale. Cloudflare's API has more than 3,500 operations, served by hundreds of services written in Rust, Go, TypeScript, Python and other languages. With the hosted generation products Cloudflare had tried, one team could merge an API change that broke generation and another team would find out only at release time; some of those products have since shut down. Forge instead runs in continuous integration on each team's own API repository. It lints every change and builds preview versions of the CLI, docs and SDKs with that change highlighted, so the team can install and test the result before merging.

Forge is assembled from pluggable transformers, and the output of one can feed another. That matters for cf, which is written in TypeScript and adds handwritten commands such as cf dev and cf build that call Vite and have no API call behind them. Cloudflare wants those commands documented alongside the generated ones, says it could not find an existing tool that does this, and is building it into Forge. The same design lets Forge target more than ordinary SDKs: it can already turn an OpenAPI specification into Cap'n Web, Cloudflare's system for calling a remote API from TypeScript as if it were a local method, and Cloudflare names TanStack Query bindings, Zod or Valibot schemas and servers as the kinds of outputs the approach is meant to cover.

OpenAPI is the only input format today; AsyncAPI, GraphQL, Cap'n Proto and Protobuf are formats the design allows for later. Cloudflare also expects Forge's releases to support a new approach to API versioning, so that after ten years on its v4 API it can ship new major versions without breaking old clients or SDKs. Its regenerated SDKs, including TypeScript, Rust, Python, Go, PHP and Terraform, are announced as coming soon rather than shipped.

Terms in this piece · Glossary
  • MCP — The Model Context Protocol — an open standard that lets any AI assistant plug into any tool or data source without custom integration code.
Read the source blog.cloudflare.com
More from Cloudflare
Recommended reads
Comments

Checking sign-in…

Loading comments…