CLI Options

Catalyst provides the following CLI options that you can use with any of the CLI commands:

-v | --version

This option prints the version number of the Catalyst CLI that you are currently using. You can type -v or
--version with the catalyst command in the following way:

copy
$
catalyst --version


catalyst_cli_options_version


-p | --project <name_or_project_id> --org <org_id>

The -p or --project option is used to provide the name or the ID of the Catalyst project the CLI command must be executed for. This option is highly beneficial when you have not initialized or made a project active for your working directory in the CLI. You can also use this option if you are executing Catalyst CLI commands from a remote system, such as a remote code repository or CI system, without an active login session using a token.

You can execute the Catalyst command by directly specifying the project the command is intended for, without having to initialize or enable a project in the CLI. The name or the ID of the project must be mentioned with the option.

For example, to enable the API Gateway in a project called ShipmentTracking, you can execute the following CLI command with this option:

copy
$
catalyst apig:enable -p|--project ShipmentTracking

You can also optionally use the --org option to provide the ID of the Catalyst organization the project belongs to, and for which the CLI command must be executed.

For example, to deploy the web client of a project from the CLI, we execute the following CLI command with both these options:

copy
$
catalyst deploy --only client -p|--project Test --org 72760298

Note:If you do not use the --org option following the -p or --project option, the default org will be considered for the command execution.


catalyst_cli_options_project


--token <token>

The --token option is used to authenticate the execution of a Catalyst CLI command. The Catalyst CLI tokens allow you to execute CLI commands from a remote system, such as a CI tool, without an active user session logged in. You can learn more about Catalyst CLI tokens from the Working with Tokens help page .

You must generate a token when you are logged in to a user account from the CLI. You can then use that token from any remote system to perform all CLI operations without an active login session. This is done by specifying the token as an option following the CLI command. This token acts as an authenticating factor for that user account, and continues to map your command executions to the project you specify.

For example, you can initialize the functions component of a Catalyst project from a remote system to your project directory using the --token option as follows:

copy
$
catalyst init --only functions --token xxxxxxxxxxxxx

This will prompt Catalyst to verify the token, and begin the initialization process if the token is found to be valid.

catalyst_cli_options_token

--dc<us|eu|in|au|ca>

The --dc<us|eu|in|au|ca> option enables you to execute a command from a specific DC login. Catalyst is currently available in five data centers: US , EU, IN, AU, and CA. You can generally select the data center that you will be accessing Catalyst from while logging in to the CLI.

Catalyst enables you to maintain different logins from each data center simultaneously. That is, you can have one valid token in both data centers each, to authenticate your command executions. You can then choose to execute a command from any one of the data centers, by specifying it using this option.

For example, if you have a valid login in both EU and US DC simultaneously, you can initialize a project and its resources in your directory for the user account associated with the US data center by executing the command in the following way:

copy
$
catalyst init --dc us

This will enable Catalyst to initialize a project, after verifying the credentials in the data center that you specify.

catalyst_cli_options_dc


Note: If you have different logins maintained in both data centers and you don't use this option to specify the data center to execute this command from, then the most recent login will be used by default.

--verbose

The --verbose option is used to display detailed information about the actions taking place when a CLI command is executed. Information including the details of the HTTP request sent to the server when the command is executed, details of the responses received, details about the CLI environment, the authorization tokens used to contact the server, and the cookies set are displayed.

The --verbose option helps you debug and troubleshoot the CLI command executions and enables you to identify the source of an error. You can execute any CLI command with the --verbose option.

For example, you can projects list command using the verbose option as follows:

copy
$
catalyst project:list --verbose

-h | --help

The -h or --help option is used to get help with a CLI command. This provides a brief description of the command’s functionality and lists the options that are available for the command and their syntax.

For example, if you require help with the catalyst functions:shell command, you can execute the following command:

copy
$
catalyst functions:shell -h|--help


You can also get help for the command by executing catalyst help functions:shell .

Last Updated 2024-04-05 23:41:34 +0530 +0530