| Command | Description |
|---|---|
| typesharp | Run type generation using the config file in the current directory. |
| typesharp init | Scaffold a typesharp.config file. Use --format json|js to change format. |
$ npx typesharp$ npx typesharp generate --config ./configs/my-config.json $ npx typesharp init --format json | Flag | Type | Default | Description |
|---|---|---|---|
| --config, -c | string | auto | Path to a custom typesharp.config file. |
| --format | string | ts | Config format for init: ts | json | js |
Watch mode will automatically regenerate types whenever a .cs file changes. Tracked on the roadmap.
$ typesharp generate --watch 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
}