MikhbarMIKHBAR
Web

Cloudflare Introduces Forge Open Source Generation Pipeline

Cloudflare has introduced Forge, an open source and pluggable generation pipeline designed to run in continuous integration workflows and build SDKs, CLIs, and documentation directly from API definitions.

Cloudflare Introduces Forge Open Source Generation Pipeline

Introduction to Forge

Cloudflare has officially introduced Forge, a fresh approach to generating software development kits, command line interfaces, documentation, and libraries. Forge is an open source, pluggable generation pipeline that anyone can deploy and run for free. According to the announcement on the Cloudflare Blog, the project is early in its lifecycle but already powers the output required for the cf CLI.

Over the coming months, the technology is scheduled to power Cloudflare's API documentation, SDKs, and additional developer surfaces. The company stated that it built Forge because it needed to treat agents as customers, making developer tools, API SDKs, MCP servers, and comprehensive documentation essential table stakes for every product.

Introducing Forge: the open source pipeline for generating SDKs, CLIs, docs, and more
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

Addressing API Scale and Coordination

Cloudflare's API encompasses more than 3,500 operations, while the hundreds of services powering these endpoints are written in a variety of programming languages, including Rust, Go, TypeScript, and Python. When engineering a command line interface for the entire API alongside SDKs and documentation, the team required a code generation pipeline capable of handling such scale.

The pipeline had to be flexible enough to accommodate different languages and distinct team workflows while reducing coordination overhead. Previously, when a product team introduced an API change, they needed to inspect a preview build before merging. To solve this, Forge runs directly in CI on each team's API repositories, linting changes and generating preview builds of the CLI, documentation, and SDKs. This concept mirrors Workers Previews, bringing full preview builds to SDK generation at scale across distributed services.

Cloudflare Introduces Forge Open Source Generation Pipeline
We needed something that generated a preview on every pull request, across hundreds of repos. · Source: Cloudflare Blog

Flexible Transformers and Cap'n Web

Forge utilizes flexible transformers that can generate virtually any target output, including Cap'n Web. Cap'n Web serves as Cloudflare's RPC system, which allows TypeScript applications to invoke a remote API as if it were a local method. With Forge, developers can take an OpenAPI specification and generate Cap'n Web directly, paving the way for bindings from Workers to other external APIs.

This capability extends beyond Cap'n Web to other popular developer tools. For instance, projects utilizing TanStack Query can generate native bindings built directly from the API specification, ensuring the code remains continuously up to date and validated against the live backend. Similar workflows apply to schemas, Model Context Protocol servers, and other interface formats.

Cloudflare Introduces Forge Open Source Generation Pipeline
Forge helps you detect problems in CI, before they cause issues downstream. · Source: Cloudflare Blog

Pluggable Architecture and Chained Targets

The platform was constructed to be pluggable and accommodate diverse input and output types. While Forge natively provides generators for command line interfaces, software development kits, and documentation, users can easily introduce custom transformers to produce library-specific packages or complete dashboard applications. Input formats currently include OpenAPI, with designs accommodating AsyncAPI and other structures in the future.

Furthermore, the system allows users to chain targets together, utilizing one target output to produce secondary formats. This flexibility ensures that teams retain full control over how their code and documentation are structured, supporting custom local-only behaviors that go beyond standard API wrappers.

Cloudflare Introduces Forge Open Source Generation Pipeline
The original OpenAPI definition is built into the TypeScript SDK, which is used to generate the cf CLI and Cap'n Web specifications. · Source: Cloudflare Blog

Open Source Availability and Future Outlook

Developers interested in exploring the codebase can access Forge available open source on GitHub. By open sourcing the project, Cloudflare aims to give the broader developer community the necessary infrastructure to generate all the surfaces required by modern automated agents.

The release of Forge also sets the stage for improved API versioning strategies, allowing the company to roll out new major API versions without breaking older clients. Additional updates regarding SDK support for languages such as TypeScript, Rust, Python, Go, PHP, and Terraform are expected to follow shortly.

Sources

  • Cloudflare BlogIntroducing Forge: the open source pipeline for generating SDKs, CLIs, docs, and more