me.PropanButan 1.2.1

dotnet tool install --global me.PropanButan --version 1.2.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local me.PropanButan --version 1.2.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=me.PropanButan&version=1.2.1
                    
nuke :add-package me.PropanButan --version 1.2.1
                    

PropanButan

A .NET CLI tool for mapping C# DTO classes and records to TypeScript interfaces.

Installation

dotnet tool install --global me.PropanButan

Usage

Map a single file

propanbutan -t ./Models/UserDto.cs

Map a directory

propanbutan -t ./Models -d ./types

Options

Flag Description
-t, --target Source file or directory to map (required)
-d, --dist Destination path. Defaults to source path with .ts extension
-e, --template Custom type mapping template file
-x, --exclude File patterns to exclude (e.g. *.generated.cs)
-a, --append Only map files whose .ts target doesn't exist yet
-s, --save-as Save invocation as a named alias for later re-use

History

propanbutan history              # show last 10 invocations
propanbutan history -l 5         # show last 5
propanbutan history -e myalias   # re-execute an alias
propanbutan history -e 3         # re-execute history record #3
propanbutan history -a           # list all saved aliases
propanbutan history --clear      # clear history (keeps aliases)

Example

Input (UserDto.cs):

public class UserDto
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public bool IsActive { get; set; }
    public DateTime? LastLogin { get; set; }
    public List<string> Roles { get; set; } = [];
}

Output (UserDto.ts):

export interface UserDto {
    id: string;
    name: string;
    isActive: boolean;
    lastLogin: Date | undefined;
    roles: string[];
};

Template

Type mappings are defined in a template.txt file. Default template:

? : undefined
int : number
long : number
string : string
bool : boolean
DateTime : Date
Guid : string
List<T> : T[]
Dictionary<K,V> : Record<K, V>

Use -e to provide a custom template.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.2.1 119 6/21/2026
1.2.0 125 6/21/2026