Pull All Resources

Command Execution

To pull features from a Catalyst project to your CLI, navigate to the project directory where you want to pull the resources to, and execute the following command:

copy
$
catalyst pull

This will initiate the pull process.

Select the resources that you want to pull. You can pull all three resources, or choose specific resources. Press Enter after selecting the resources.

Pull Resources in CLI


Pull Functions

If you selected Functions, select all the functions that you want to pull from your console to the project directory from the list. Press Enter after making the selection.

Pull Functions in CLI

This will pull each function available in the console into its own directory in the functions directory of your project, in your local machine.


Pull the Client

If you selected client , choose the client app version that you want to pull, from the list. The CLI displays all versions of your client application hosted in the remote console. Make the selection and press Enter .

Pull Client in CLI

The client files of the version you select will be pulled into the client directory of your project, in your local machine.


Pull API Gateway Rules

If you selected API Gateway Rules, a catalyst-user-rules.json file will be created in your project’s home directory. The latest definitions created for all your APIs in the remote console will be written to this file. You can learn about this file from the Working with API Gateway CLI help page .

If API Gateway is disabled for your project in the remote console, Catalyst will ask you to enable it from the CLI before pulling the API definitions. Type Y and press Enter to enable API Gateway.

Pull API Gateway Rules in CLI

If API Gateway is enabled, the API definitions will be automatically pulled and added to the catalyst-user-rules.json file.

Pull API Gateway Rules in CLI

Catalyst will also update the catalyst.json file to include the information about the API Gateway rules JSON file.

Note: If you selected a resource to be pulled and it does not exist in the remote console, the CLI will throw an error. For example, if no APIs were created in the remote console, no API Gateway rules will be pulled.

Overwrite Existing Resources

If the function or the client directory, or the catalyst-user-rules.json file, does not exist in your project’s root folder, they will be automatically created before the resources are pulled. However, if a resource is already present in your project folder, the CLI will ask you for confirmation to overwrite the existing file.

Type Y to overwrite the existing files, or N to decline, and press Enter . If you confirm the overwriting, the pull process will be initiated. If you decline, the pull process will be aborted.

Pull Resources- Overwrite Existing Resources


Last Updated 2023-05-10 13:29:53 +0530 +0530