Commands

CommandDescription
typesharpRun type generation using the config file in the current directory.
typesharp initScaffold a typesharp.config file. Use --format json|js to change format.

Usage

$ npx typesharp
$  npx typesharp generate --config ./configs/my-config.json 
$  npx typesharp init --format json 

Flags

FlagTypeDefaultDescription
--config, -cstringautoPath to a custom typesharp.config file.
--formatstringtsConfig format for init: ts | json | js

Watch mode planned

Watch mode will automatically regenerate types whenever a .cs file changes. Tracked on the roadmap.

$ typesharp generate --watch

Config file

Instead of passing flags every time, create a typesharp.config.json at your project root:

{
    "input": "./Models",
    "output": "./app/types",
    "casing": "camel",
    "enumMode": "const",
    "split": true
}