Console Domain
The Console domain is your program's voice. It handles basic interactions with the terminal. Whether you're debugging with a quick print, logging a status update, or asking the user for input, this is where your program talks to the human running it.
aivi
use aivi.consoleFunctions
| Function | Explanation |
|---|---|
log message | Prints message to standard output with a trailing newline. |
println message | Alias for log. |
print message | Prints message without a trailing newline. |
error message | Prints message to standard error. |
readLine 😦) | Reads a line from standard input. |
color color text | Wraps text in ANSI foreground color codes. |
bgColor color text | Wraps text in ANSI background color codes. |
style style text | Applies multiple ANSI attributes to text. |
strip text | Removes ANSI escape sequences from text. |
ANSI Types
aivi
type AnsiColor = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White | Default
type AnsiStyle = {
fg: Option AnsiColor
bg: Option AnsiColor
bold: Bool
dim: Bool
italic: Bool
underline: Bool
blink: Bool
inverse: Bool
hidden: Bool
strike: Bool
}