The following UX elements are supported by the Bash SDK:
Format
Print
ProgressBars
Spinners
Different from the other CTO.ai SDKs, Bash has the UX elements at the top level to improve usability of these elements. For example, print is accessed by cto-ai print instead of cto-ai ux print.
Format
Formats text with rich styling
USAGE:
ux format [SUBCOMMAND]
SUBCOMMANDS:
bold Formats the provided text as boldface
italic Formats the provided text as italics
Bold:
Formats the provided text as boldface
USAGE:
ux format bold [text]...
EXAMPLE:
ux print We are $(ux format bold "permanently deleting") the existing cluster
Italic:
Formats the provided text as italics. Note: italic support in terminals is limited.
USAGE:
ux format italic [text]...
EXAMPLE:
ux print We hope you have a $(ux format italic very) good experience with CTO.ai
Print
Displays text to the user.
USAGE:
ux print [text]...
ARGS:
<text>... Text to be displayed
Example:
response=ux print This is text
echo $response
Output:
This is text
Progressbar
Displays progress bars to the user.
USAGE:
ux progressbar [SUBCOMMAND]
SUBCOMMAND:
advance Advances the current progress bar
start Starts a new progress bar
stop Stops the current progress bar
Advance:
USAGE:
ux progressbar advance [increment]
ARGS:
<increment> Length to increment the progress bar by
Start:
USAGE:
ux progressbar start [OPTIONS] --length <LENGTH>
OPTIONS:
-i, --initial <INITIAL> Initial filled length of the progress bar
-l, --length <LENGTH> Sets the full length of the progress bar
-m, --message <MESSAGE> Descriptive message accompanying the progress bar
Stop:
USAGE:
ux progressbar stop [OPTIONS]
OPTIONS:
-m, --message <MESSAGE> Message to be displayed with the complete progress bar