Skip to main content
@gentleduck/gen

Client types from your server code

Duck Gen reads your TypeScript server and writes .d.ts files, so client types always match your routes and message keys.

  • Route scanning

    Walks your NestJS or TypeScript server modules and puts every route into one type graph. Verbs, params, bodies, and responses included.

  • .d.ts output

    Writes declaration files your client imports directly. No runtime and no codegen DSL, only typed modules.

  • Message keys

    Reads your i18n catalogs and emits a union of valid keys. A typo fails at compile time, not silently at runtime.

  • Zero runtime

    It ships as a CLI, so nothing lands in your bundle. The output is plain .d.ts that disappears at build time.

  • Watch mode

    Regenerates on every file change. Run it next to your dev server and client types follow the backend live.

  • Config schema

    Ships duck-gen.schema.json, so your editor validates the config with autocomplete and hover docs.

Install

Works with NestJS today. Express and Fastify are next.

  1. Install

    bun add -D @gentleduck/gen
  2. Generate types

    bunx duck-gen

Free & open source

gentleduck is MIT licensed and will always be free and open source. Every package ships with full source access — fork it, modify it, own it.

Become a Sponsor