Configure the Kalix CLI
The Kalix command-line interface (CLI) complements the Console interface and makes most deployment and configuration operations available from the command line. This page shows the use of common commands. The List of kalix
commands page links to all commands.
Check periodically to make sure you have the latest |
Usage
Generally, kalix
is followed by a command, with optional sub-commands and parameters. You may also supply flags, preceded by --
(two hyphens) that modify the operation of the command-line client itself.
Log in
To use the kalix
CLI, you must authenticate your command line client with your Kalix account. Entering auth login
at the command line launches the Kalix login screen in your default browser. The command line client prints Waiting for UI login…
and pauses. After you log in and click Authorize, the command line prompt returns.
Upon successful authentication, if your account contains:
-
One project, the CLI reports that it is the
current
project, which will be the target of subsequent commands. -
No projects, in this case explicitly set the target project after creating a project.
-
Multiple projects, you need to explicitly set the target. Use
kalix projects list
to see all of your projects.)
To log in, enter:
kalix auth login
To set the target project to my-project
:
kalix config set project my-project
Enter kalix auth -h
at the command line, or see kalix auth for other authentication related commands.
Traversing proxies
In some corporate environments, transparent decrypting HTTP proxy servers are used, and often these proxy servers don’t support HTTP/2. The kalix
CLI uses gRPC to communicate with backend services, which requires HTTP/2. In these environments, Kalix can be configured to use grpc-web instead, which works over HTTP/1.1 and HTTP/2.
To configure kalix
to use grpc-web, when logging in, run:
kalix auth login --use-grpc-web
Once logged in, the kalix
CLI will continue to use grpc-web for all subsequent commands without requiring the --use-grpc-web
flag.
If you are already logged in, but need to enable grpc-web, this can be done by running:
kalix config set api-server-use-grpc-web true
Administer Kalix projects
Enter kalix projects -h
at the command line.
See kalix projects for a complete list of commands to manage your Kalix projects. |
Create a new project
kalix projects new sample-project "An example project in Kalix"
The kalix projects new NAME [DESCRIPTION]
command creates a new
project in your Kalix account.
To mark the new project as the current project and thus the target of subsequent commands, use the following command:
|
Add container registry credentials
kalix docker add-credentials \
--docker-server https://mydockerregistry.com \
--docker-username myself \
--docker-password secret
Allow Kalix to retrieve container images from private repositories by using the kalix docker add-credentials [flags]
command to add a set of container registry credentials to the project. The flags are:
-
--docker-server string
The docker server, for examplehttps://mydockerregistry.com
-
--docker-username string
The docker username -
--docker-password string
The docker password -
--docker-email string
The docker email address
See kalix docker -h or kalix docker for a complete list of commands to manage Docker credentials.
|
For information about using Kalix Container Registry (KCR) or other external container registries, see Configure a container registry. |
Administer services
The kalix services
commands manipulate the services in your current Kalix project.
List services
kalix services list
The kalix services list
command lists a one-line summary of all services under the current project.
Deploy a service
kalix services deploy \
my-service \
my-container-uri/container-name:tag-name
The kalix services deploy service-name docker-image
command deploys a service named service-name
using the docker-image
.
For information about setting up container registry credentials to authorize Kalix to pull from your image repository, see Configure a container registry. |
Expose a service route
kalix services expose my-service --enable-cors
The kalix services expose service-name
command creates a route to expose a service for inbound traffic. Optionally, you can enable HTTP CORS with the --enable-cors
flag.