Universal code generator for TypeScript developers

Instantly generate TypeScript from API schemas in Cursor or VS Code

Ready to use

Open source generators

We have created generators for popular TypeScript libraries to help you get started fast. You can use them immediately, customize them or combine them to create your perfect generator stack.

Want to see a generator added? Drop us an email at support@codesquared.com

export class GetFetch extends OperationInsertable {
constructor({ context, operation, settings }: OperationInsertableArgs) {
super({ context, operation, settings })
this.createAndRegisterDefinition({
identifier: Identifier.createVariable(`${settings.identifier.name}Response`),
schema: operation.toSuccessResponse().resolve().toSchema(),
schemaToValueFn: toZodValue
})
}
toString() {
return `async () => {
const response = await fetch('${this.operation.path}');
const data = await response.json();
return ${this.settings.identifier.name}Response.parse(data);
}`
}
}

Define outputs

Generate 
client code
from API schema

CodeSquared transformers use simple string templates to define output code.

Using native behaviour makes code generation accessible to all JavaScript developers. This approach also enables us to reuse and nest code generated by other transformers.

Automate development

Ready to run
output code

Use generated code as building blocks or compose them into a full application.

import { product } from '@/models/products';
import { z } from 'zod';
const productsResponse = z.array(product);
export const getProducts = async () => {
const response = await fetch('/products');
const data = await response.json();
return productsResponse.parse(data);
}