Skip to main content
Version: Unreleased 🚧

Getting Started

Capact features a command-line interface that wraps common functionality and formats output. The Capact CLI is a single static binary. It is a wrapper around the Capact GraphQL API and Kubernetes API.

Install

Capact has two types of release channels: Stable and Latest:

Stable - from the latest release

Depending on the system, install Capact CLI binary with homebrew or curl:

brew install capactio/tap/capact

Run capact -h or capact <command> -h to see the help output which corresponds to a given command.

Latest - from the latest main commit

Install Capact CLI binary with curl:

curl -Lo capact https://storage.googleapis.com/capactio-binaries/latest/capact_darwin_amd64/capact

Copy to binary directory:

chmod +x capact && mv capact /usr/local/bin/capact

Run capact -h or capact <command> -h to see the help output which corresponds to a given command.

First use

NOTE: This section requires acess to an existing Capact installation. To learn how to install Capact, see the Installation guides.

To begin working with Capact using the capact CLI, start with log in interactively into a given cluster:

# start interactive setup
capact login

If you do not know the authorization details, you can obtain them from the cluster where Capact was installed:

export CAPACT_GATEWAY_HOST=$(kubectl -n capact-system get ingress capact-gateway -ojsonpath='{.spec.rules[0].host}')
export CAPACT_GATEWAY_USERNAME=$(kubectl -n capact-system get secret capact-gateway -ogo-template='{{.data.username | base64decode }}')
export CAPACT_GATEWAY_PASSWORD=$(kubectl -n capact-system get secret capact-gateway -ogo-template='{{.data.password | base64decode}}')

# provide all information from command line
capact login "$CAPACT_GATEWAY_HOST" -u "$CAPACT_GATEWAY_USERNAME" -p "$CAPACT_GATEWAY_PASSWORD"

If URL and credentials are valid, the output is:

Login Succeeded

Now you are ready to interact with the cluster via CLI. For example, fetch all available Interfaces:

capact hub interfaces get

NOTE: The capact action watch command calls the Kubernetes API directly. If you want to use this command, kubeconfig has to be configured with the same cluster as the one which the Gateway points to.

Log into multiple servers

NOTE: We do not support setting kubeconfig per server. You need to manage it manually by changing the kubeconfig context, for example via kubectl.

You can log into multiple clusters. To check in which cluster you already logged in, run:

capact config get-contexts

Example output:

                      SERVER                       AUTH TYPE    DEFAULT
+------------------------------------------------+------------+---------+
https://gateway.capact.local Basic Auth YES
https://gateway.capact.io Basic Auth NO

To change the default context, run:

# Selects which Hub server to use of via a prompt
capact config set-context

If you want to log out, run:

# Select what server to log out of via a prompt
capact logout

Autocompletion

To learn how to enable capact autocompletion, run:

capact completion -h

NOTE: Be sure to restart your shell after installing autocompletion.

When you start typing a capact command, press the <tab> character to show a list of available completions. Type -<tab> to show available flag completions.

Credential store options

The capact login uses keyring library to store credentials securely. The supported store backends are:

Use the CAPACT_CREDENTIALS_STORE_BACKEND environment variable to change the default backend.

Next steps

✨ After setting up Capact CLI, you are ready to start a journey with the Capact project. Check out our Mattermost installation example to learn how to use Capact CLI to provision an example application.

See also

If you would rather manage Capact resources using UI, read the Dashboard Overview document.