Spark CLI

Introduction

Spark provides a custom command line interface to improve your developer experience.

To install the Spark CLI, simply run the following command:

dotnet tool install -g Spark.CLI

Updating Spark CLI

The Spark CLI is constantly being updated. To update to the newest version, simply uninstall and reinstall it.

dotnet tool uninstall -g Spark.CLI
dotnet tool install -g Spark.CLI

Install

Install the Spark Templates. This must be ran 1 time before creating your first Spark project.

spark install

Update

Update the installed Spark Templates. It’s recommended to run this before creating new projects as Spark is being improved constantly.

spark update

Create Project

Create a Spark project.

spark new [projectName]

Open Solution

Opens a Spark solution with your default editor.

spark open

Create Migration

Create a EF Core migration.

spark make migration [migrationName]

The new migration will be under Application/Database/Migrations.

Run Migration

Runs outstanding migrations.

spark migrate

Create Component

Create an new Razor component.

spark make component [ComponentName]

The new component will be under Pages/Components.

The command accepts subfolders as well. For instance, spark make component Profile/ProfileDetails would make a new component at Pages/Components/Profile/ProfileDetails.razor.

Create Page

Create an new Blazor page.

spark make page [PageName]

The new page will be under Pages.

The command accepts subfolders as well. For instance, spark make page Profile/Index would make a new Blazor page at Pages/Profile/Index.razor.

Create Event

Create an new Event and Listener.

spark make event [eventName] [listenerName]

The new event will be under Application/Events. The new listener will be under ./Application/Events/Listeners

Create Mail

Create an new mailable.

spark make mail [mailableName]

The new mailable will be under Application/Mail.

Create Model

Create an new database model.

spark make model [modelName]

The new mailable will be under Application/Models.

Create Service

Create an new Service.

spark make service [serviceName]

The new service will be under Application/Services.

Create Job

Create an new Invocable Job.

spark make job [jobName]

The new Job will be under Application/Jobs.