Deploy from CLI

Catalyst Slate enables you to deploy applications using the Catalyst CLI. You can execute pre-defined Catalyst commands in the terminal to initialize Slate, set up a Slate template, link or unlink local Slate apps to and from your Catalyst project in the console, and deploy a Slate app.

This section provides step-by-step instructions for performing these operations.

Initialize Slate

Prerequisite : You need to login to the Catalyst CLI using your Catalyst account and then proceed with project and Slate initialization. Refer to this CLI help documentation to know the steps to login.

You can initialize a Slate service directly in your app’s directory, or from a new directory. If you had selected Slate during the project initialization, you can follow the below listed steps:

You can also use the below command to initialize the Slate service directly:

copy
$
catalyst init slate
  1. Select the client framework of the application you wish to deploy in Slate. Press Enter to confirm.
slate-init
Note: This process automatically downloads a boilerplate template based on your chosen framework into your project directory, allowing you to customize and deploy it to Slate.
  1. Provide a name for your application and press Enter. Now, the CLI sets the default configuration for your Slate application based on the chosen framework.

This configuration includes the install and build commands and build path of the respective framework. If you wish to proceed with the default configuration, enter N. Else, enter Y to make the necessary updates.

slate-init-1
Note:
  1. The install command instals the required dependencies, typically using a package manager.

  2. The build command is the script that transforms your development code into production code.

  3. The build path is the directory where the production-ready, optimized files are generated after running the build process.

By default, the install command is auto-detected as npm install and the build command as npm run build. If you would like to change these, you can do so by entering N and providing the required package command.

Once you confirm on the configuration, the Slate template code of the chosen framework will be downloaded to the project directory, and an entry will be added to the catalyst.json file, which serves as a connection between your project directory and the Catalyst Slate service.

You can provide specific commands to be executed when serving the app locally by entering them as development commands and pressing Enter.

slate-init-2

Create an Additional Slate App

If your project directory is already linked to a Catalyst project and Slate is initialized, you can add a new Slate app to your project directory directly using the steps below. This operation will automatically add the Slate template code based on the chosen front-end framework to your project directory.

  1. Execute the following command in the terminal from the Slate service’s project directory:
copy
$
catalyst slate:create
  1. Select the required framework for your Slate application and provide a name for your application.
slate-create
  1. Based on the chosen framework, the install and build commands,the build path of the framework will be automatically detected. If you wish to proceed with the default configuration, enter N. Else, enter Y to make the necessary updates.
slate-init

You can provide specific commands to be executed when serving the app locally by entering them as development commands and pressing Enter.

After all the configurations are updated, the Slate app will be created in your project directory.

slate-init

The catalyst.json file will be updated with the details of the newly created Slate app.

You can also create a Slate application by directly providing a name for your application and the required framework. Execute the following command in your terminal:

copy
$
catalyst slate:create --name <name> --framework <framework_name>

Link a Slate App

In order to deploy an existing project to Slate, you must mandatorily link the project’s root path with the Slate service. For this you will have to initialize the Slate service first. This linking establishes a connection between your project directory and the Slate service locally and in order to deploy to the console, you must use the deploy command.

This option can be used when an application of a supported framework by Slate was not originally initialized as a Slate service, but you later prefer to deploy it as a Slate service.

In order to link the directory with Slate, please follow the below listed steps.

  1. Execute the below command in the terminal from the app’s project directory:
copy
$
catalyst slate:link

Select the source path that has to be linked to the Slate service and press Enter.

slate-link
  1. Provide a name for your application as required and press Enter.
slate-link-1
  1. The framework of the application will be automatically detected and listed along with its install, build commands, and the build path. Else, you will be able to select the framework manually from the terminal.

If you wish to proceed with the default configuration, enter N. Else, enter Y to make the necessary updates.

slate-link-2

You can provide specific commands to be executed when serving the app locally by entering them as development commands and pressing Enter.

After the configurations are set, an entry will be made in the catalyst.json file to establish a connection between the project directory’s path and the Slate service.

slate-link-3-updated

Unlink a Slate App

You can remove the connection between your project directory and the Slate service by using the steps listed below. This operation will only remove the Slate configuration in your project directory and not in the Catalyst console, if you have already deployed the application.

  1. Execute the following command in the terminal from the app’s project directory:
copy
$
catalyst slate:unlink
  1. Navigate using the arrow keys to choose the application and click Enter to confirm.
slate-unlink
  1. Enter Yes to remove the Slate configuration from your application, its entry in the catalyst.json file and the source code of the application. Enter No to remove only the entry in the catalyst.json file while retaining the source code of your application.
slate-unlink-1

For the same operation, you can also use the below command by directly providing the name of the application:

copy
$
catalyst slate:unlink --name <<app_name>>

Deploy to Slate

You can deploy your front-end web application in Catalyst Slate using the below listed steps. Before you deploy any application in Slate, please make sure the project directory has been linked to the Slate service. For this, you can use the catalyst slate:link command.

Execute the following command in your terminal from the Slate service’s project directory:

copy
$
catalyst deploy slate

This deploys all the Slate components present in your project directory to the Catalyst development environment.

You can use the below option to provide a deployment message for the Slate deployment.

copy
$
catalyst deploy slate -m "deployment message"

To deploy a specific app alone from the project directory to Slate, you can directly use the below command:

copy
$
catalyst deploy --only slate:appname

If you wish to deploy the application to the production environment, please use the below command. Please ensure you have accessed the production environment in the console before initiating a production deployment.

copy
$
catalyst deploy slate --production

Last Updated 2025-05-19 21:35:53 +0530 +0530