forge README

The project's README from github.com/cloudflare/forge. As one markdown file: README.md.

Forge

Forge is a schema-first OpenAPI code generation and surface tooling framework. It provides a plugin-based architecture for resolving OpenAPI 3.x specifications, applying JSONPath-based overlays, and generating typed SDKs, CLI interfaces, runtime helpers, and documentation.

It's still early-days for Forge and we're laser focused on the first Forge output, the cf CLI. Rest assured, in short order we'll be making it easier and easier for other targets (namely, TypeScript, Go, Python, Terraform, etc. - and docs for all of the above), but that will track in parallel to us releasing those targets for our own SDKs. That's just how we do things at Cloudflare: we often open source as soon as we can (often, sooner than others might) and always test our products on ourselves first.

Documentation

The guides and reference for Forge, its model and its plugins are in the Forge documentation source. Start with About Forge and Get started.

Rust library

Forge's Rust package is named cloudflare-forge. Registry publishing is currently paused. Depend on the repository and rename the package to forge so Rust code imports its API through forge:::

[dependencies.forge]
package = "cloudflare-forge"
git = "https://github.com/cloudflare/forge"
default-features = false

The default cli feature also builds the forge command. Enable wasm to run WebAssembly plugins from a Rust host. The Rust API reference lists the public model and plugin interfaces.

License

Apache-2.0 © Cloudflare, Inc.

forge (cloudflare/forge)

Searching Database…

What is this?Forge is a schema-first OpenAPI code generation and surface tooling framework that resolves OpenAPI 3.x specs, applies JSONPath overlays, and generates typed SDKs, CLIs, runtime helpers and documentation.
Is it a single CLI app or something bigger?It is a plugin-based framework shipped as a monorepo of packages, built around a core OpenAPI resolver and JSONPath overlay engine, rather than one standalone app.
How do I generate an SDK from my OpenAPI spec?Install the standalone Forge CLI and point it at a bundled OpenAPI specification to generate a TypeScript SDK; you can also pipe the spec in via stdin using '-'.
Do I need Docker to use this?Full SDK generation requires Docker; the README specifies this is needed for the complete generation pipeline beyond basic CLI usage.
Can Forge generate SDKs for languages other than TypeScript right now?The monorepo includes workspace wrapper packages for Python, Go, Java, PHP, C#, Ruby, Rust and Swift, but the only generator the README documents as standalone is the TypeScript one.
What does the CLI output directory contain?It contains the finalized OpenAPI document, the generated SDK source code, and an sdk-map.json file.
What is astro-fern for?It is a generic Astro engine for rendering Fern-based API documentation, used by the docs-site package to build the API reference website.
Why does the monorepo include fern-forge?fern-forge is an astro-fern extension that validates and adapts Forge's OpenAPI metadata so it renders correctly in the Fern-based documentation site.
Can I generate SDKs in languages besides TypeScript?There are workspace wrapper packages for Python, Go, Java, PHP, C#, Ruby, Rust and Swift, but the documented standalone generator only covers TypeScript today.
Creator
cloudflare
Size
65.7 MB
Stars
1.2K
Age
2mo
Commits · 90 Days