Skmtc is a declarative code generation framework
npm install @skmtc/core
Skmtc is a declarative code generation framework. It lets you generate TypeScript code from OpenAPI schemas without complex ASTs.
- ๐๏ธ Fast - Generates 550k+ tokens per second
- ๐งต Easy to edit code generators - Outputs specified using string templates, not ASTs
- ๐ฅ Stackable generators - Compose complex functionality by combining generators
- ๐๏ธ Use your own code conventions - Full control over naming and file structure
``bashRun directly with npx
npx skmtc
`
`bash
npx skmtc generate @skmtc/supabase-backend https://petstore3.swagger.io/api/v3/openapi.jsonGenerated 9 files (507 lines, 3,383 tokens) in 9ms
npx skmtc generate @skmtc/supabase-react-client https://raw.githubusercontent.com/cloudflare/api-schemas/refs/heads/main/openapi.json
$3
`typescript
import { ZodInsertable } from '@skmtc/gen-zod'class ZodFetch extends BaseTransformer {
zodName: string;
constructor({context, operation, settings}){
super({context, operation, settings})
// Generate Zod schema for API response and insert it into current file
const response = operation.toSuccessResponse()?.resolve().toSchema()
const zodResponse = this.insert(ZodInsertable, response)
// Grab Zod schema name to use in output code
this.zodName = zodResponse.identifier.name
}
// Define code output
toString(){
return
() => { return ${zodName}.parse(data)
}``
}
}
Choose from our growing collection of generators, combone them or create your own:
- Tanstack Query - React Query hooks with Zod validation
- MSW - Mock Service Worker handlers from OpenAPI examples
- Zod Schemas - Runtime validation schemas
- TypeScript Types - Pure type definitions
- Supabase/Hono Functions - Edge function handlers
- See full list at https://github.com/skmtc/skmtc-generators
We welcome contributions! Check out our Contributing Guide to get started.
- GitHub Issues - Bug reports and feature requests
- Discord Community - Get help and share your experience
Apache 2.0 ยฉ Skmtc Contributors
---


