Kloudlite CLI kl
This CLI help you to work with kloudlite using your terminal.
Authentication
To login and logout you can use the following commands.
kl auth login
kl auth logout
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
See your initialized file
To see your initialized file you can use following command.
kl show
Listing Resources
With this CLI you can list accounts, projects, devices, configs, secrets, apps, lambdas and regions. To list resources you can use the following commands. For more details visit kl list
kl list accounts
kl list projects
kl list devices
kl list configs
kl list secrets
kl list apps
kl list lambdas
kl list regions
Selecting one resource to work with
Some resource needs to select before working with it like: account, project, device, region. So to select resource you can use the following commands.
kl use account
kl use project
kl use device
kl use region
with these commands you can provide the resource id. In case of you don’t provide resource it it will show you a picker. For more details visit kl use
Getting Resource
You man needs to fetch resource to work with your own tools or method. For that purpose you can get some resources like configs, secrets using following commands. For more details visit kl get
kl get config
kl get secret
Working with wireguard
To access service of cluster and tunneling your local system to the cluster. you need to setup wireguard. For that you can use the following commands.
sudo kl wg connect
sudo kl wg disconnect
sudo kl wg reconnect
kl wg expose -p <server_port>:<local_port>
kl wg expose -p <server_port>:<local_port> -d # provide -d flag to delete
Creating Resource
You can create some resource using CLI like device. you can use following command to create device. For more details visit kl create
kl create device
Working with environments
We support multiple environments to work with. these commands will help you to use and create new environments and delete environments. For more details visit kl add and kl del
# Adding
kl add config
kl add secret
kl add mres
# Deleting
kl del config
kl del secret
kl del mres
Intercepting App/Lambda
You can tunnel you local running app to the server and intercept your app to forward all the request of that app to your local system. for that you need to perform following actions.
So you can use following commands to work with interception. For more details visit kl intecept and kl leave intecept
kl intercept
kl leave intercept
Working with configs/secrets mounting
You can also mount configs/secrets into a file. For more details visit kl gen
kl gen <file_path/file_name>
KL Config File structure
This is the structure of app config file which will be generated by executing the command kl load
and
you can also modify this file according to your requirement.
version: v1
name: <project_name>
mres:
- name: service/<mres_name>
env:
- name: <env_name>
key: <local_key>
refkey: <server_key>
configs:
- name: <config_name>
env:
- key: <local_key>
refkey: <server_key>
secrets:
- name: <secret_name>
env:
- key: <local_key>
refkey: <server_key>
env:
- key: <env_key> # eg. NODE_ENV
value: <env_value> # eg. development
fileMount:
mountBasePath: <base_mount_path> # eg. ./.mounts
mounts:
- path: <mount_path> # eg. /tmp
type: <type> # eg. config or secret
name: <config_name>
Getting All environments
According to above config file you can get all the environments to your local shell. you can use the following commands for getting all environments to working shell.
kl load # will print environments in key=value format
kl load <shell> # will spawn new shell with all the environments eg. kl load zsh
kl load <cmd> # start command with all the environments eg. kl load npm start
This CLI is under development so, more information will will be updated in this doc. also if some new commands will be added to the CLI will be updated to this doc.
for more details visit docs