kloudlite / kl

Kloudlite CLI Client
GNU Affero General Public License v3.0
5 stars 1 forks source link

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.

Installation

To install the latest version in Linux or Mac you can run the following command on terminal.

Installation of kl

Install latest with curl
curl 'https://kl.kloudlite.io/kloudlite/kloudlite!?select=kl' | bash
Install latest with wget
wget -qO- 'https://kl.kloudlite.io/kloudlite/kloudlite!?select=kl' | bash
Install specific version
curl 'https://kl.kloudlite.io/kloudlite/kloudlite@v1.0.0!?select=kl' | bash
Download but don't install
curl 'https://kl.kloudlite.io/kloudlite/kloudlite?select=kl' | bash
For nightly releases
curl 'https://kl.kloudlite.io/kloudlite/kl@v1.0.8-nightly!?select=kl' | bash

Authentication

To login and logout you can use the following commands.

kl auth login
kl auth logout
kl auth status

Initialize your workspace

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

Configure Envvars & Config Mounts

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.

Manage Nix Packages

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

Switch between Environments

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.

SSH into container

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.

Intercept applications

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.

KL Config File structure

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
- neovim@0.5.1
# ...
# 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>