CLI Config File

Introduction

Configuration files in general are files that define parameters and values for any software or codebase settings. In this case, Catalyst provides CLI commands that enable you to set and manage the location of Python, and certain versions of Java downloaded in your local system, in a specific configuration file.

This particular configuration file is a hidden local file maintained in your system in varied locations, based on the OS installed in your system. It controls the operations of various utilities in your system. It also contains the configurations that allow the system to communicate effectively with the CLI.

Note: You can only set the Python, Java 11, or Java 17 path information in this configuration file for now. Catalyst currently does not support adding any other information in this file through the CLI.

Set a Key-Value Pair

You can add an entry to the config file in your local machine specifying the path of Python, Java 11, or Java 17 stored in your system, by providing the inputs in the form of a key-value pair. To do so, execute the command mentioned below from your system’s terminal:

copy
$
catalyst config:set <key=value>

You can set the path information for the function stacks in the following manner:

  • Python:
copy
$
catalyst config:set python3_9.bin=/Users/amelia-426/Downloads/Python-3.9.16
  • Java 8:
copy
$
catalyst config:set java8.bin=/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/bin
  • Java 11:
copy
$
catalyst config:set java11.bin=/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin
  • Java 17:
copy
$
catalyst config:set java17.bin=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin

Note:
  • Currently, you can only set the key as python3_9.bin, java8.bin, java11.bin, or java17.bin
  • Replace the path listed in the above commands with your JDK or Python path
  • If your local system is running on Windows OS, kindly enclose the path in double-quotes. For example, you will set the Java 11 path in the following manner:
    
copy
catalyst config:set java11.bin="/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin"

Get the Value of a Specific Key

You can fetch the value of any specific key in this particular configuration file by executing the terminal command below with the key:

copy
$
catalyst config:get <key>
  • Python:
copy
$
catalyst config:get python3_9.bin
  • Java 8:
copy
$
catalyst config:get java8.bin
  • Java 11:
copy
$
catalyst config:get java11.bin
  • Java 17:
copy
$
catalyst config:get java17.bin

This will return the path or the value of the key stored in the config file. For example:

  • Python: /Users/amelia-426/Downloads/Python-3.9.16
  • Java 8: /Library/Java/JavaVirtualMachines/jdk1.8.0_291
  • Java 11: /Library/Java/JavaVirtualMachines/jdk-11.0.17
  • Java 17: /Library/Java/JavaVirtualMachines/jdk-17
Note:
  • Currently, you can only retrieve the Python, Java 8, Java 11, or Java 17 path information from this file using this CLI command.
  • Replace the path listed in the above commands with your JDK or Python path
  • If your local system is running on Windows OS, kindly enclose the path in double-quotes. For example, you will set the Java 11 path in the following manner:
    
copy
catalyst config:get java11.bin="/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin"

List Configurations

You can retrieve the list of all configurations (key-value pairs) that are present in the configuration file by executing the following command:

copy
$
catalyst config:list

catalyst_cli_config

Note: Currently, this CLI command only retrieves the configuration information of the Python, Java 8, Java 11, or Java 17 path in your system.

Delete Key

You can delete an entry in the configuration file by executing the CLI command mentioned below:

copy
$
catalyst config:delete <key>

You must specify the key name of the entry that you want to delete.

  • Python:
copy
$
catalyst config:delete python3_9.bin
  • Java 8:
copy
$
catalyst config:delete java8.bin
  • Java 11:
copy
$
catalyst config:delete java11.bin
  • Java 17:
copy
$
catalyst config:delete java17.bin

This will delete the key-value pair from the file.

Last Updated 2024-06-18 12:08:24 +0530 +0530