Introducing Forge: the open source pipeline for generating SDKs, CLIs, docs, and more
Short summary
Cloudflare released Forge, an open source tool that automatically generates SDKs, CLIs, API documentation, and other developer artifacts from API specifications. The company built it to handle its own 3,500+ API operations across multiple languages and teams, then open sourced it because they believe API tooling should be freely available to everyone.
- Forge runs in CI on individual team repos and generates preview builds for each change, letting developers test modifications before they ship, similar to how preview deployments work for web apps.
- The tool supports chaining transformers—you can generate outputs from other outputs and control the order yourself, so a Python shop can generate a Python CLI instead of being forced into whatever the generator decided.
- Forge handles the messy reality of real APIs: it lets you feed handwritten CLI commands and custom behaviors back into documentation, solving a problem existing generators don't address.
- Cloudflare plans to use Forge for a new v5 API versioning strategy that won't break existing clients on the decade-old v4 API.
Full summary
Cloudflare built Forge because their API grew too unwieldy to manage with existing tools. They have over 3,500 API operations spread across hundreds of services written in Rust, Go, TypeScript, and Python. When product teams made API changes, they couldn't preview how those changes would affect the CLI, SDKs, and docs before shipping. Existing hosted code generation tools either couldn't scale to this complexity or shut down entirely, leaving them stuck coordinating between teams and vendors. Forge runs directly in CI on each team's repos, linting changes and generating preview builds so developers can test before merging—the same model as their Workers Previews feature.
What makes Forge different is its flexibility. Most SDK generators chain outputs in fixed ways: they generate a Go SDK, then produce a CLI and Terraform provider from that. Cloudflare wanted their TypeScript CLI to be the source, which no existing tool supports. Forge lets you chain transformers however you want—generate from one output to produce others. This matters because CLIs need hand-written commands that don't come from API specs. The cf CLI has commands like `cf dev` and `cf build` that call TypeScript APIs from Vite. Forge handles feeding those custom commands back into docs so they're documented alongside generated content. The system also goes beyond typical SDK generation: you can generate TanStack Query bindings, Zod schemas, MCP servers, or Capn Web RPC interfaces directly from your OpenAPI spec.
They're open-sourcing Forge under Apache 2.0 because they think API tooling shouldn't require a SaaS subscription. You own what you generate, run it wherever you want, and can modify it freely. Cloudflare plans to use it for TypeScript, Rust, Python, Go, PHP, and Terraform SDKs. They're also rethinking API versioning—their v4 API has been the only major version for a decade, and they're working toward releasing v5 without breaking existing clients, which Forge's versioning approach will support.