# Cloudflare Forge
Forge is an open source, pluggable generation pipeline from [[Cloudflare]]. You feed it an API description and it produces the surfaces people (and agents) use to consume that API: SDKs, a [[Command Line Interface (CLI)|CLI]], documentation, and whatever else you plug in. Cloudflare announced it on September 28, 2026, during Birthday Week, under the [[Apache 2.0 License]].
## Why Cloudflare built it
The reason is agents. Cloudflare's own framing: CLIs, API SDKs and [[Model Context Protocol (MCP)|MCP]] servers, each with good docs, used to be a developer-product thing. Now they're table stakes for EVERY product, because agents are the customers.
Then there's scale. The Cloudflare API has over 3,500 operations, served by hundreds of services written in Rust, Go, TypeScript and Python, spread across hundreds of repositories. Cloudflare tried several hosted SDK generators (and ran some in production). None solved it, and some shut down. The failure mode was always the same: one team merges an API change that breaks generation, another team discovers it at release time, and everyone wastes time coordinating with vendors they don't control.
## How it works
- **It runs in [[Continuous Integration (CI)|CI]]**, in each team's API repo. It lints every change and builds installable previews of the CLI, docs and SDKs with your changes highlighted. Same idea as Cloudflare's Worker Previews (an isolated environment per branch), applied to SDK generation
- **Input today is the [[OpenAPI Specification|OpenAPI spec]]**. AsyncAPI, GraphQL, Cap'n Proto and Protobuf are on the "designed to allow in the future" list
- **Transformers can generate anything**. One example is Cap'n Web (Cloudflare's JavaScript RPC system that resolves a chain of dependent calls in a single round trip) straight from OpenAPI, which opens the door to generated Workers bindings for other APIs. Same story for TanStack Query bindings, Zod or Valibot schemas, or MCP servers, always in sync with the real API
- **Targets can be chained**: one output feeds the next. Cloudflare's chain goes OpenAPI → TypeScript SDK → the `cf` CLI and the Cap'n Web specs. Other generators make that choice for you (e.g., CLI and Terraform built from the Go SDK); Forge leaves it to you
That last point matters more than it looks. A CLI is more than a thin layer over the API. `cf dev` and `cf build` are handwritten, local-only commands that call TypeScript packages such as [[Vite]]; no API call backs them. That's why Cloudflare wanted the CLI in TypeScript, and why the docs pipeline has to pick up those handwritten commands too. Cloudflare says it found no existing tool that does this.
## What it already powers
The first output is `cf` ([[Cloudflare CLI]]), the new agent-first CLI for the whole Cloudflare API, announced the same day. Its launch post explains the move: [[Wrangler]] had commands for around 280 operations, hand-built by each product team with inconsistent naming (`d1 info`, `hyperdrive get`, `workflows describe`). Generating commands from an annotated OpenAPI schema let `cf` cover the full surface. Over the next months Forge is meant to power Cloudflare's API docs and SDKs too: TypeScript, Rust, Python, Go, PHP and Terraform ("especially Terraform").
It also sets up API versioning. The v4 API has been the only major version for 10 years, even though plenty of changes since then would count as breaking under [[Semantic Versioning]]. Cloudflare is working on a way to ship new major versions without breaking old clients or SDKs.
## What the repo shows
The `cloudflare/forge` repo is a TypeScript monorepo. The core package (`@cloudflare/forge`, version 0.1.0) is described as a schema-first OpenAPI code generation framework: an OpenAPI 3.x resolver, a typed schema model, JSONPath overlays and a plugin lifecycle. The README is upfront: it's early days, the team is focused on `cf`, and the other targets will become easier to use as Cloudflare ships them for its own SDKs.
Something the blog post doesn't mention: the multi-language SDKs in the repo are generated with Fern, a third-party SDK generator. There's a `fern/generators.yml` that calls the official Fern generator images, plus packages named `astro-fern` and `fern-forge` for the docs. The only comment on the main HN submission (4 points when I checked) called it rude to "clone Fern" without credit. From what I can see in the repo, Forge drives Fern's generators more than it copies them, but Fern goes unnamed in the announcement.
## My take
I like the bet. Generating every surface from one well-described contract is exactly what I argued for in my [[OpenAPI Specification]] note, and per-PR previews push breakage back to the team that caused it, before release. That's the right place for it.
Two caveats though. First, this is version 0.1.0: today it mostly produces Cloudflare's own CLI, so "anyone can deploy and run it for free" is more promise than product for now. Second, the credit question. If your pipeline leans on Fern for SDK generation, say so in the launch post.
## References
- [Introducing Forge: the open source pipeline for generating SDKs, CLIs, docs, and more](https://blog.cloudflare.com/forge-open-source-generation-pipeline/) (Dimitri Mitropoulos, Matt "TK" Taylor, Samuel Macleod; Cloudflare blog, 2026-09-28)
- [cloudflare/forge on GitHub](https://github.com/cloudflare/forge) (README, AGENTS.md, `packages/cloudflare-fern-config/fern/generators.yml`, `packages/forge/package.json`)
- [Introducing cf: the agentic CLI for the entire Cloudflare API](https://blog.cloudflare.com/cloudflare-cf-cli-launch/) (Cloudflare blog, 2026-09-28)
- [Introducing Worker Previews](https://blog.cloudflare.com/worker-previews/) (Cloudflare blog, 2026-09-22)
- [Cap'n Web](https://capnweb.com/)
- [Hacker News discussion](https://news.ycombinator.com/item?id=49877421)
## Related
- [[Cloudflare]]
- [[OpenAPI Specification]]
- [[Wrangler]] (the hand-built CLI that `cf` expands on)
- [[Cloudflare CLI]]
- [[Model Context Protocol (MCP)]]
- [[AI Agents]]
- [[Cloudflare Workers]]