switch
You can use the switch command to change the default context.
Overview
The switch command helps you to manage the default context when you have multiple contexts available in the config.yaml file. You can run the list command to view all the available contexts in the config.yaml file, and the default context is identified with an asterisk (*).
Syntax and command line options
You can enter the command as
follows:
ocli context [switch | sw] context_name
The
context_name parameter is mandatory.- context_name
- Specify the name of the context that you want to set as default.
Example
- Run the following command to set the default context to
TEST
:ocli context switch TEST
-context
If you want to perform a command on a different context without switching contexts,
you can use the
syntax:
ocli command -context context_name
Example
The context currenly set is TEST. You can list all the folders on
the TESTPROD context without switching to it running the
command:
ocli model list folder / -context TESTPROD