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.

For the to-do list application, we will initialize the Advanced I/O function first, and initialize the Client component later.

Note: Ensure that you enter the function's package name or class name exactly as instructed, because the application's code contains the same name.
  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. Navigate using the arrow keys and select your preferred portal and press the Enter key. If you have no other organizations associated with the account, then the default one will be automatically selected. catalyst_todo_portal_choice
    You can find out more about Catalyst’s multi-org portal feature from this help document.

  2. The CLI will now ask you to associate a Catalyst project with the directory. Associate it with the project that we created earlier from the console. Select ToDoList from the list and press Enter. catalyst_todo_project_selection

  3. Select Functions using the space bar. Press the Enter key to initialize. As mentioned earlier, we will initialize and setup the client after we configure the function. catalyst_todo_func_cli_select

  4. The CLI will initiate the function setup. Select AdvancedIO as the function type. catalyst_todo_function_type_select

  5. Select Python 3.9 as the function stack. catalyst_todo_func_select_python_type

  6. Enter “to_do_list_function” as the package name, and “main.py” as the entry point, and press Enter. You can also just press Enter, to use the default names generated by Catalyst, or enter any name of your preference. catalyst_todo_python_setup_complete

The project and function initialization is now complete.

The current project directory will be created in the standard structure. The functions directory will be created in your project directory with the configuration files and dependencies, along with the catalyst.json and a hidden .catalystrc file.

This is the structure of the ToDoList project’s directory without the Client component. catalyst_todo_python_func_directory


Last Updated 2024-06-12 17:41:34 +0530 +0530