Initialize the Project from the CLI

You can now begin working on your Catalyst project from the CLI. The first step is to initialize the project in an empty directory. This will be the home directory of your project and all of the project files will be saved in it.

You can learn more about this from the Project Directory Structure help page. You can learn about initializing a project in detail from the CLI help documentation.

  1. Create a folder for the project on your local machine and navigate to it from the terminal.

  2. Initialize a project by executing the following command from that directory:

copy
$
catalyst init
  1. Select the preferred portal (or organization) by navigating using the arrow keys and press Enter to confirm. If you have no other organizations associated with the account, then the default one will be selected automatically.

select_portal

  1. Now, CLI will ask you to associate a Catalyst project with the directory. Associate it with the project that we created earlier from the console. Select GitHubBot from the list and press Enter.

select_default_project

  1. Select Functions using the space bar. Press the Enter key to initialize.

select_components

  1. The CLI will initiate the function setup. Select Integration as the function type.

function_type

  1. Select Cliq as the service and press Enter.

select_service

  1. All Cliq handlers classes will be selected by default. Press Enter.

select_handlers

  1. Select Python 3.9 as the function stack, and press Enter.

select_python_runtime

  1. Press Enter to confirm the default package name as git_hub_bot_function and the entry point as main.py.

function_setup

The CLI will download and install the latest Catalyst Python SDK package.

Note: Ensure that you enter the package name and file name exactly as instructed, because the application's code contains the same names.
The functions directory is now created in the standard structure. Catalyst initialization is complete.

Your project directory is now set up with the functions directory (CATALYST_FUNCTIONS_HOME) along with configuration files and dependencies. The project directory also contains the catalyst.json, a requirements.txt file and a hidden catalyst.rc file.

This will be the final structure of your project directory.

functions_directory

Last Updated 2023-12-15 18:54:08 +0530 +0530