Skip to content

contexts create

Overview

Add a new context to the CLI

Aliases: create, add

Usage:

quix contexts create [<name>] [options]

Arguments:

  • <name> : Name of the context

Options:

  • -e, --endpoint <endpoint> : Portal endpoint
  • -b, --sdk-broker-address <sdk-broker-address> : SDK broker configuration address
  • -c, --use-quix-cloud-broker : Set the SDK broker configuration to the one in your Quix Cloud environment
  • -l, --use-local-broker : Set the SDK broker configuration to one accessible from your local machine

How It Works

The quix contexts create command allows you to add a new context to the Quix CLI. This context includes configurations such as the portal endpoint and the SDK broker configuration address. If you do not provide the name or options, the command starts an interactive mode to guide you through the context creation process.

Warning

Creating multiple contexts is intended for advanced users who need to store and access different sets of configurations. Use this feature only if you require distinct environments or settings.

Example Usage

If you run the command without specifying the name or options, it will start an interactive mode:

$ quix ctx add

You will then be prompted to enter the context details:

? Select a context name:

You will then be prompted to enter the portal API URL:

✓ Context name: byoc
? Enter Portal API URL: (https://portal-api.platform.quix.io):

Note

Changing the portal API URL is only necessary if you need to use a different portal API, such as for BYOC (Bring Your Own Cloud).

Once you enter a valid URL, you will be prompted for the SDK broker configuration address:

✓ Portal API URL: https://quix.example.com 

Handling Invalid URLs

If you enter an invalid URL, you will receive an error message:

✗ https://quix.example.com is not a valid Portal API URL
? Enter SDK local broker address: (localhost:19092):

After entering the SDK broker configuration address, you will be asked if you want to use a SDK broker configuration:

✓ SDK local broker address: localhost:9092
? Use 'Local' as SDK broker configuration? [y/n] (y):

Confirm your choice to use a SDK broker configuration:

✓ Use 'Local' as SDK broker configuration?: ✓

By following these steps, you can easily create a new context in the Quix CLI, ensuring that all necessary configurations are set correctly.

Tip

If you need to undo all your changes and reset your contexts to their default state, use the quix contexts reset command.