Kloudlite CLI kl
kl
is command line interface for developers to work with environments in kloudlite. This will help developers to create
local development containers which are connected to remote environments.
To install the latest version in Linux or Mac you can run the following command on terminal.
curl 'https://kl.kloudlite.io/kloudlite/kl!?select=kl' | bash
wget -qO- 'https://kl.kloudlite.io/kloudlite/kl!?select=kl' | bash
curl 'https://kl.kloudlite.io/kloudlite/[email protected]!?select=kl' | bash
curl 'https://kl.kloudlite.io/kloudlite/kl?select=kl' | bash
curl 'https://kl.kloudlite.io/kloudlite/[email protected]!?select=kl' | bash
To login and logout you can use the following commands.
kl auth login
kl auth logout
kl auth status
To work with any project you need to initialize your workspace where you can define environments, managed resouces, mounts and etc. To initialize you workspace you can use the following command.
kl init
To configure environment variables & configs mounts you can use following commands
kl add config
kl add secret
kl add config-mount <file_path>
These commands will prompt to select configs and secrets from the list of available resources in the environment.
You will be able to manage nix packages that are available in the container using the following commands.
kl pkg add <package-name>
You can search and add packages form NixHub
You can switch between remote environments using the following command.
kl use env
This command will prompt to select environment from the list of available environments.
Container will be running a ssh server. You will be able to check the configuration with kl box info
command
inside your workspace
You can ssh into the container using the following command.
kl box ssh
This command will start the container if it is not running and ssh into the container.
You can intercept applications running in remote environments to your local machine using the following commands.
kl intercept
This command will prompt to choose the application from the list of available applications in the environment.
This is the structure of kloudlite config file which will be generated by executing the command kl init
and
you can also modify this file according to your requirement.
version: v1
teamName: <kloudlite-team-name>
defaultEnv: <default-environment>
packages:
# list of nix packages
- [email protected]
# ...
# list of environment variables
envVars:
- key: ENV_VAR_NAME
secretRef: <secret-name>/<secret-key>
- key: ENV_VAR_NAME2
configRef: <config-name>/<config-key>
- key: ENV_VAR_NAME3
configRef: <mres-name>/<mres-key>
- key: ENV_VAR_NAME4
value: TEST_VALUE
# ...
mounts:
- path: <mount-path>
configRef: <config-name>/<config-key>
- path: <mount-path>
secretRef: <secret-name>/<secret-key>