Automatically generate TypeScript from C# — keep your frontend and backend types in perfect sync.
TypeSharp is a developer-first CLI tool built for teams working with ASP.NET Core backends and TypeScript frontends (Vue, Nuxt, React, Angular). Stop duplicating your models. Let TypeSharp do it.
| Repository | Description |
|---|---|
typesharp |
The core CLI — scan C# models, output TypeScript interfaces |
TypeSharp.Attributes |
C# attributes for fine-grained control over type generation |
// C# — your source of truth
public class ProductDto {
public int Id { get; set; }
public string Name { get; set; }
public decimal? Price { get; set; }
public ProductCategory Category { get; set; }
}typesharp generate --input ./Models --output ./frontend/types// Auto-generated TypeScript
export interface ProductDto {
id: number;
name: string;
price?: number;
category: ProductCategory;
}- ✅ Nullable type support (
T?→T | undefined) - ✅ Enum generation
- ✅ Inheritance & base class resolution
- ✅ Array and collection types
- ✅ Custom naming conventions (camelCase, PascalCase)
- ✅ Fine-grained control via
[TypeSharp]attributes - ✅ Perfect for ASP.NET Core + Vue/Nuxt/React projects
dotnet tool install --global TypeSharp.CliWe welcome contributions! Check out our Contributing Guide to get started.