skmtc

Your OpenAPI schema, turned into code you’d have written yourself

skmtc generates typed clients, Zod schemas, TanStack Query hooks, forms and mocks straight from your API schema — following your naming and file conventions, regenerable every time the API changes.

curl -fsSL https://skm.tc/install | sh

The CLI runs on Deno; the generated code drops into your ordinary npm, Vite or Next.js project. Also on JSR and GitHub.

Schema in, working code out

One operation from a schema becomes a validated model and a ready-to-use hook.

openapi.yaml
paths:
  /pets/{id}:
    get:
      operationId: getPet
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pet'
components:
  schemas:
    Pet:
      type: object
      required: [id, name]
      properties:
        id: { type: integer }
        name: { type: string }
        tag: { type: string }
src/generated/useGetPet.generated.ts
export const pet = z.object({
  id: z.number().int(),
  name: z.string(),
  tag: z.string().optional()
})

export type Pet = z.infer<typeof pet>

export const useGetPet = ({ id }: GetPetArgs) =>
  useQuery({
    queryKey: ['pets', id],
    queryFn: async () => {
      const res = await fetch(`${baseUrl}/pets/${id}`)
      return pet.parse(await res.json())
    }
  })

Illustrative output from gen-zod + gen-tanstack-query-fetch-zod. Every generator is string-template based — no ASTs — so the output reads like handwritten code.

Up and running in four commands

Install the CLI, scaffold a project, add generators, generate.

1

Install the CLI

curl -fsSL https://skm.tc/install | sh
2

Scaffold a project and choose where generated code lands in your app

skmtc init petstore src/generated
3

Add generators from the registry

skmtc install @skmtc/gen-zod petstore
4

Point it at your OpenAPI schema — a URL or a local file

skmtc generate petstore https://petstore3.swagger.io/api/v3/openapi.json

Built for the questions you're already asking

Codegen tools earn trust by answering these up front.

Is the output actually good?
Generators are string templates, not AST gymnastics — the output is idiomatic TypeScript that reads like your own, and you control naming and file structure.
What happens when I regenerate?
Generated files belong to the schema, not your editor. Customize through generator settings and enrichments — or clone a generator and make it yours — then regenerate without fear of clobbering hand edits.
Do I have to write generators?
No. Most teams only ever install stock generators and configure them. Writing your own is there when you outgrow them — generators compose, so you extend rather than fork.

Ready when you are

curl -fsSL https://skm.tc/install | sh