Generator — Overview
The @forge-clients/generator package is a CLI tool that:
- Downloads Atlassian’s official OpenAPI specs for Jira and Confluence
- Applies a post-processing pipeline to fix known defects in those specs
- Generates type-safe TypeScript client functions from the cleaned specs
You only need the generator if you are maintaining or contributing to @forge-clients.
If you are just using the clients in your Forge app, the generated output in
@forge-clients/jira and @forge-clients/confluence is all you need.
CLI commands
Section titled “CLI commands”Update specs
Section titled “Update specs”Download fresh specs from Atlassian and apply the post-processing pipeline:
pnpm --filter @forge-clients/generator run update-specsOptions:
--force— re-download even if cached specs are fresh--dry-run— show what would change without writing files
Regenerate clients
Section titled “Regenerate clients”Generate types.gen.ts and sdk.gen.ts from the cleaned specs:
pnpm --filter @forge-clients/generator run generateWhen to regenerate
Section titled “When to regenerate”- Atlassian releases a new API version
- A bug is found in a generated function signature
- A new patch or transform is added to fix a spec defect
- The IR or emitter logic is updated
Architecture
Section titled “Architecture”Atlassian OpenAPI specs (downloaded) ↓ Post-processing pipeline (transforms + JSON patches) ↓ Cleaned specs (committed to git) ↓ SpecToIR — converts spec to IR ↓ TypeEmitter → types.gen.ts SdkEmitter → sdk.gen.ts ↓ @forge-clients/jira, @forge-clients/confluenceThe IR (Intermediate Representation) is a product-agnostic model of the API that decouples the spec parsing from the code generation. This makes it easy to add new products or change the output format without touching the spec parsing logic.