Skip to main content
Version: 0.9

Using the Kore CLI

You can interact with Kore in two ways - via the portal or via the Kore CLI. Both of these offer similar capabilities, and you can accomplish most tasks through either interface.

If you do not already have the CLI, follow these steps to download it.

To find help for any command, run kore help [command] or browse the CLI reference.

tip

Familiar with kubectl? The Kore CLI follows a similar pattern. Everything is a resource that you can list, get, create, update or delete, and these resources are grouped by team - like namespaces in kubectl.

Log in to Kore#

Before any interaction with Kore, you must first login. To do this for the first time, creating a profile (see below) in the process, use the kore login command with the URL of the Kore instance you wish to connect to:

# Log in to kore at the specified API URL and create a new profile# for it named kore-prod:kore login kore-prod -a https://api.kore-prod.myorg.io

Once you have logged in, you can re-authenticate at any time by running kore login with no parameters.

View profiles#

Kore CLI supports profiles (similar to kubectl contexts) which allow you to connect to multiple instances of Kore, or using different users / authentication methods. The example login command above will have created your first profile and named it kore-prod.

You can list your profiles, and see which is currently active, using the kore profiles list command:

$ kore profiles listPROFILE      ENDPOINT                              DEFAULT TEAM    ACTIVEkore-notprod https://api.staging.kore.yourorg.io   None            -kore-prod    https://api.kore.yourorg.io           devs            -

You can choose the current profile with kore profiles use [name] or append --profile [name] to any Kore command to temporarily use a named profile for a specific command.

Set a default team#

Almost all commands in the Kore CLI are oriented around teams. You can specify the team you are working with using -t [team] or --team [team] on any command, or you can set a default team on your current profile using kore use team TEAM-NAME.

With a default team set you can still use -t to switch team for a specific command.

You can see the default team set for each of your profiles using kore profiles list.

Make life easier with auto-completion#

If you want to save keystrokes and get commands, arguments and options completed for you, install the Kore CLI autocompletion in your shell.

Bash autocompletion:#

# Ensure you have bash autocomplete installed (Fedora / CentOS)$ dnf install bash-completion
# Source in the bash autocmpletion for the current terminal:$ source <(kore completion bash)

Place source <(kore completion bash) into your profile (${HOME}/.bash_profile) to load when opening a new terminal.

ZSH autocompletion:#

# If shell completion is not already enabled in your environment,# you must enable it.  You can execute the following once:$ echo "autoload -U compinit; compinit" >> ~/.zshrc
# To load completions for each session, execute once:$ kore completion zsh > "${fpath[1]}/_kore"

You must start a new shell for this setup to take effect.

Last updated on Aug 5, 2021