Delete Functions

Delete Command Execution

You can permanently delete functions of your Catalyst project using the CLI. You can choose to delete functions from the remote console or from your local project directory while executing this command.

Note: If a function exists in both locations, it will only be deleted from the location you choose. For example, even if you delete a function from the remote console, it will still be present in your local project directory until you delete it from the local machine separately.

  1. To delete functions in your project, execute the following command from your project directory:
copy
$
catalyst functions:delete

  1. The CLI will ask you to choose between the functions in the remote console or the functions in your local project directory. Select an option and press Enter .
    Delete Functions in CLI

  1. The CLI will list all the functions in your remote console or in your local directory, based on the options you chose. Select the functions that need to be deleted and press Enter .
    Delete Functions in CLI

  1. The CLI will ask for a confirmation. Enter “Y " to and press Enter to confirm. The selected functions will be deleted from the chosen location.
    Delete Functions in CLI

Note: You can use the catalyst pull command to pull resources from the remote console to the local directory, or catalyst deploy to deploy resources to the remote console from the local directory if you require synchronization.

You can also directly specify the function to be deleted by including the function’s name or ID with the along with the command like:

copy
$
catalyst functions:delete [function_name_or_id]

For example:

copy
$
catalyst functions:delete InvoiceFetch

The CLI will then prompt you to select between the remote console or the local directory, then ask you for the delete confirmation in the same manner.

Note: You can specify the function name or ID directly to delete a function from the remote console. However, to delete a function from the local directory, you must only provide the function name and not the ID.

Delete Functions Options

You can directly choose to list the functions in either the remote console or in your local project directory to delete using the respective options.

To list functions available in your local project directory, execute the catalyst functions:delete command as follows:

copy
$
catalyst functions:delete --local

To list functions available in the remote console of your project, execute the catalyst functions:delete command as follows:

copy
$
catalyst functions:delete --remote

The CLI will list the functions accordingly, and you can delete the required functions as explained previously.

You can also directly delete a function from the remote console or the local directory as shown below:

copy
$
catalyst functions:delete InvoiceFetch --remote

Note: If you are a Visual Studio Code IDE user, you can install the Catalyst Tools extension, and perform CLI operations using your IDE in place of the CLI. Steps to delete Catalyst functions using Visual Studio Code IDE can be found here

Last Updated 2024-01-09 17:07:13 +0530 +0530