S2T
CLI Tool for Modern Developers

GenerateTypeScriptfrom Swagger

Transform your OpenAPI specifications into production-readyTypeScript code with TanStack Query, RTK Query, SWR, and more.

bash

Works seamlessly with your favorite tools

TypeScript
React
TanStack Query
Next.js
Open Source
1.2k+ Stars

See it in Action

Watch how easy it is to generate TypeScript code from your Swagger specs

Swagger to TanStack DemoComing Soon

How It Works

Swagger to TanStack transforms your OpenAPI/Swagger specification into fully-typed, production-ready TypeScript code with your favorite data-fetching library

Parse Swagger

The CLI reads your OpenAPI/Swagger JSON or YAML file and parses all endpoints, schemas, and parameters into an intermediate representation.

Generate Types

TypeScript interfaces and types are generated from your Swagger schemas, including request/response types, path parameters, and query parameters.

Create Hooks

Custom hooks are generated for each endpoint using your chosen template (TanStack Query, SWR, RTK Query) with full type safety and IntelliSense support.

Key Benefits

100% type-safe with full IntelliSense support
Automatic request/response type inference
Built-in error handling and loading states
Support for file uploads and form data
Optimistic updates and cache management
Automatic retry logic and request deduplication

Why Swagger to TanStack?

Incremental Generation

Preserve custom code while updating from Swagger changes

Multiple Structure Options

Choose between split, group, or group-hooks file structures

Tag Filtering

Generate only the endpoints you need with tag inclusion/exclusion

File Upload Support

Automatic detection and handling of multipart/form-data

Watch Mode

Automatically regenerate code when Swagger files change

Base Path Stripping

Clean URLs by removing common base paths automatically

10k+
Downloads
5+
Templates
100%
Type Safe

Ready to get started?

Install the CLI and generate your first TypeScript code in minutes

Read the Documentation

👋 Hello and welcome!

I'm Armel Dakayao, Front-End Developer & creator of swagger-to-tanstack CLI.

Armel Dakayao

Senior Front-End Developer. I build scalable, user-friendly web & mobile apps with React,React Native, Next.js, and TypeScript.