Skip to content

πŸ’» Build automation using The Ops Platform and our Bash SDK πŸš€

License

Notifications You must be signed in to change notification settings

cto-ai/sdk-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SDK Bash

SDK for creating ops using bash.

Prompts

Input

$ ux prompt input -a \
  --message="Some message" \
  --name="input" \
  --default=Value

Editor

$ ux prompt editor \
   --message="Some message" \
   --name="input" \
   --default=Value

Confirm

$ ux prompt confirm --default-true \
  --message="Some message" \
  --name="input name"

Autocomplete

Example 1

$ ux prompt list --autocomplete \
 -n "autocomplete" \
 -m "Autocomplete Message" \
 -d val3 \
 val1 val2 val3 val4

Example 2

$ ls list_fixture | xargs ux prompt list -a \
 -n "autocomplete" \
 -m "Autocomplete Message" \
 -d file1.js

Example 3

$ cat list_fixture/list.txt | tr "\n" " " | xargs ux prompt list \
 -a \
 -n "autocomplete" \
 -m "Autocomplete Message" \
 -d "item 1"

Checkbox

$ cat list_fixture/list.txt | tr "\n" " " | xargs ux prompt checkbox \
 -n "checkout" \
 -m "Checkout Message"

List

$ cat list_fixture/list.txt | tr "\n" " " | xargs ux prompt list \
 -n "list" \
 -m "List Message" \
 -d "item 1"

Datetime

# $(date +%Y-%m-%dT%H:%M:%S%Z)
# Formats "2019-12-11T21:37:12-08:00" or "2019-12-11T13:39:37Z"
# date -u +%FT%TZ

$ ux prompt datetime \
 -n "datetime" \
 -m "Datetime Message" \
 -d "2019-12-20T00:00:00-08:00" \
 --min="2019-12-11T00:00:00-08:00" \
 --max="2019-12-28T00:00:00-08:00" \
 --date

Number

$ ux prompt number \
 -n "number" \
 -m "Number Message" \
 -d 5 \
 --min=1 \
 --max=10

Password

$ ux prompt password \
 -n "password" \
 -m "Password Message" \
 --confirm

Secret

$ ux prompt secret -n "secret" -m "Secret Message"

Spinner

$ ux spinner start -m "Starting process"
$ sleep 5
$ ux spinner stop -m "Done!"

Progress Bar

$ ux progressbar start -l 5 -m Downloading
$ for ((i=1;i<=5;++i)); do sleep 1; ux progressbar advance; done
$ ux progressbar stop -m 'Download Done!'

Print

$ ux print some text

Secrets

Get

$ sdk secret get name

Set

$ sdk secret set -k name -v secret

State

Get

$ sdk state get name

Get All

$ sdk state get -a

Set

$ sdk state set -k name -v state

Config

Get

$ sdk config get name

Get All

$ sdk config get -a

Set

$ sdk config set -k name -v config