Skip to content

CLI Commands

The primary way to interact with laravel-typescript is through its Artisan commands.

typescript:generate

The main command used to generate TypeScript definitions.

bash
php artisan typescript:generate

Options

OptionDescription
--stdoutOutput the generated content to stdout instead of writing to files.
--strictFail the command with a non-zero exit code if any errors occur during generation.
--no-formatDisable automatic formatting even if enabled in the configuration.
--connection=XForce a specific database connection for schema introspection.
--models=X,YOnly generate for the specified model names (comma-separated).

typescript:publish

Publishes the package configuration file.

bash
php artisan typescript:publish

Released under the MIT License.