Version: 0.7

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.

Logging 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.

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 list
PROFILE ENDPOINT DEFAULT TEAM ACTIVE
kore-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.

Setting 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 profiles set current.team [team].

To unset this, run kore profiles set current.team with no value.

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

Making 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:#

# Source in the zsh autocmpletion for the current terminal:
$ source <(kore completion zsh)

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