moma

Moma

v2.1.0
documentation GitHub

MOMA / API REFERENCE

Moma Terminal components

Complete visual and functional reference for the Moma Bash library. Every public function is listed below with its signature, purpose, and terminal output where applicable.

Preview bash <(curl -fsSL https://raw.githubusercontent.com/Mgldvd/moma/master/dist/moma) preview
Load source <(curl -fsSL https://raw.githubusercontent.com/Mgldvd/moma/master/dist/moma)moma msg "Ready" --success
Install mkdir -p "$HOME/.local/bin"curl -fsSL https://raw.githubusercontent.com/Mgldvd/moma/master/dist/moma -o "$HOME/.local/bin/moma"chmod 0755 "$HOME/.local/bin/moma"

The moma <command> syntax works the same way whether the library is sourced or the executable is installed. Direct moma-* functions (for example moma-msg) remain available after sourcing, for backward compatibility with existing scripts.

Colors

Every component accepts a semantic state or any named color through --color. Nothing here needs to be memorized case by case - it's the same small palette everywhere.

Semantic states

--success, --error, --warning, and --info aren't colors of their own - each just resolves to one of the named colors below.

--success

✔ green

--error

✖ red

--warning

! yellow

--info

→ cyan

Named colors

Pass any of these to --color <name> on every component.cyan is the default when --color is left out entirely.

black
red
green
yellow
blue
purple
cyandefault
white
pink
gray

Visual

Each function names a visible terminal component; semantic meaning is selected with flags.

ASCII heading component

header

Three-line Pagga text for a prominent script or workflow identity, with one blank line above, two below, and no left indent by default.

moma header "TEXT" [--color color] [--margin-top number] [--margin-bottom number] [--margin-left number] [--no-color]

Bash examples

moma header "Moma"
moma header "Deploy 2026" --color cyan --margin-bottom 1
moma header "Build ready" --margin-top 0 --margin-bottom 0 --margin-left 2 --no-color

Output

Heading component

title

Primary identity block for the beginning of a script or major workflow.

moma title "Moma" "Terminal UI library" [--success|--error|--warning|--info] [--primary color] [--accent color] [--icon char] [--no-icon] [--border mirror|line|open] [--width number] [--max-width number]

Bash examples

moma title "Moma" "Terminal UI library"
moma title "Deploy" "Production" --primary cyan
moma title "Backup" "Nightly job" --accent yellow --min-width 48
moma title "Moma" "Terminal UI library" --success --border line
moma title "Moma" "Terminal UI library" --no-icon --border open

Output

Heading component

title-sub

Secondary heading for stages nested inside the main workflow.

moma title-sub "Deployment" "Production environment" [--success|--error|--warning|--info] [--color color] [--icon char] [--no-icon] [--border mirror|line|open] [--width number] [--max-width number]

Bash examples

moma title-sub "Dependencies" "Installing packages"
moma title-sub "Deploy" "Production" --color cyan
moma title-sub "Tests" --message "Running suite" --min-width 42
moma title-sub "Dependencies" "Installing packages" --border mirror

Output

Heading component

sub-title

Rule-first secondary heading: the same marker/padding line as moma-title-sub, but with the rule printed above the text instead of below it, and no closing row.

moma sub-title "Moma" "Terminal UI library" [--success|--error|--warning|--info] [--color color] [--icon char] [--no-icon] [--border mirror|line|open] [--min-width number] [--width number] [--max-width number]

Bash examples

moma sub-title "Moma" "Terminal UI library"
moma sub-title "Moma" "Terminal UI library" --no-icon --border open
moma sub-title "Moma" "Terminal UI library" --border line

Output

Section component

section

Strong separator that gives semantic context to the content that follows.

moma section "Dependencies ready" --success

Bash examples

moma section "Dependencies ready" --success
moma section "Configuration failed" --error
moma section "Next step" --info --icon "→"

Output

Message component

msg

Compact feedback with semantic defaults or custom color and icon overrides.

moma msg "Package installed" --success [--color value] [--icon value]

Bash examples

moma msg "Package installed" --success
moma msg "Connection refused" --error
moma msg "Downloading metadata" --color cyan --icon "→"

Output

Simple message

msg-simple

A quiet message with only a dot marker and no semantic icon.

moma msg-simple "Package installed" [--success|--error|--warning|--info] [--color value]

Bash examples

moma msg-simple "Package installed"
moma msg-simple "Package installation failed" --error
moma msg-simple "Queued" --color yellow --marker "•"

Output

List component

list

An unordered terminal list with a consistent marker for every item.

moma list "Clone repository" "Install dependencies" [--success|--error|--warning|--info]

Bash examples

moma list "Clone repository" "Install dependencies" "Start application"
moma list "Database ready" "Cache ready" --success
moma list "Review logs" "Retry deployment" --marker "→" --color yellow

Output

Notice component

box

Framed notice with automatic, fixed, or maximum width. Long content wraps inside the border.

moma box "Configuration is ready." --success [--width number] [--max-width number]

Bash examples

moma box "Configuration is ready." --success
moma box "Review the deployment settings." --warning --width 48
moma box "A long notice wraps inside its border." --info --max-width 32

Output

Content block component

resume

Titled, colored content block for grouping related information, such as a résumé section or a categorized reference list. Rows come from repeated --item (a bold term next to a muted description, aligned as a column) and --text (a plain line), interleaved in the order given. The title is a single open line by default; setting an icon switches to a boxed header, mirroring moma-title's own marker conventions.

moma resume --title "<text>" [--item "term" "description"]... [--text "line"]... [--success|--error|--warning|--info] [--color color] [--icon char] [--no-icon] [--border mirror|line|open] [--width number] [--max-width number] [--no-color]

Bash examples

moma resume --title "Shells" --color blue --item "Bash" "GNU command shell." --item "Zsh" "Interactive shell with completion."
moma resume --title "Summary" --text "All checks passed." --text "No manual follow-up required."
moma resume --title "Review" --warning --item "Environment" "production" --text "Confirm the target before deploying."
moma resume --title "Moma Terminal UI library" --no-icon --border open --text "element 1" --text "element 2"

Output

Rule component

divider

Marker-led horizontal rule, for separating sections without a full heading. Uses — (em dash) instead of the ─ box-drawing character elsewhere in Moma, and has no left box edge, only an optional bare ┌/└ pair framing the rule above and below.

moma divider [--success|--error|--warning|--info] [--color color] [--icon char] [--no-icon] [--border mirror|line|open] [--min-width number] [--width number] [--max-width number] [--no-color]

Bash examples

moma divider
moma divider --success --border line
moma divider --icon "⏻" --border line

Output

Label component

label

Print an input-style decorated label with automatic width, semantic color support, and one blank line below it.

moma label "TEXT HERE" [--width number] [--min-width number] [--max-width number] [--color color] [--icon symbol] [--edge top|bottom] [--border line|open]

Bash examples

moma label "PROJECT NAME"
moma label "DEPLOYMENT" --success
moma label "NOTES" --width 52 --color cyan --icon "→"
moma label "END OF REPORT" --edge bottom --border open

Output

Interactive

Read a value from the user, as free-form text or a yes/no confirmation.

Input component

input

Display or read a field with placeholders, validation, secret masking, and one blank line below each interactive value.

moma input --title "Project name" --read --required [--secret] [--mask symbol] [--default value] [--width number] [--max-width number]

Bash examples

moma input --title "Project name" --placeholder "my-project"
project="$(moma input --title "Project name" --read --required --trim)"
password="$(moma input --title "Password" --read --secret --required)"

Output

Prompt component

prompt

Free-text prompt with moma-title-sub's own marker + underline look instead of moma-input's boxed field - the two share the same read, validation, and secret-masking machinery, and differ only in how the question is drawn.

moma prompt "<question>" [--success|--error|--warning|--info] [--color color] [--icon char] [--no-icon] [--border mirror|line|open] [--cursor char] [--default value] [--secret] [--mask char] [--required] [--trim] [--min-width number] [--width number] [--max-width number]

Bash examples

answer="$(moma prompt "Continue with the installation?")"
answer="$(moma prompt "Deploy now?" --default "yes")"
token="$(moma prompt "API token" --secret --required)"

Output

Confirmation select

confirm

Select Yes or No with the arrow keys, Enter, or the y and n shortcuts. A successful answer leaves one blank line below the controls.

moma confirm "Create this project?" [--default yes|no] [--answer yes|no]

Bash examples

moma confirm "Create this project?" --default yes
moma confirm "Delete the cache?" --answer no
if moma confirm "Deploy now?"; then
  moma msg "Deploying" --info
fi

Output

Selection

Choose one or several values from a list with the arrow keys.

Select component

select

Select one value with the arrow keys, return it through standard output, and leave one blank line below the controls. Also available as moma single-select for existing scripts.

moma select "Development" "Staging" "Production" [--title text] [--initial number]

Bash examples

environment="$(moma select "Development" "Staging" "Production" --title "Environment")"
environment="$(moma select "Development" "Staging" "Production" --choose 2)"
region="$(moma select "US" "EU" "APAC" --title "Region" --initial 2 --color cyan)"

Output

Select component

select-groups

Select one value organized under named, non-selectable group headings. Option numbers are one-based, count only options, and follow visual order across every group.

moma single-select-groups --title text (--group name --option value...)... [--initial number] [--choose number]

Bash examples

action="$(moma single-select-groups --title "Features" --group "Docker" --option "Up" --option "Down" --option "Stop" --group "npm" --option "install" --option "run dev" --option "run deploy")"
action="$(moma single-select-groups --title "Features" --group "Docker" --option "Up" --option "Down" --option "Stop" --group "npm" --option "install" --option "run dev" --option "run deploy" --choose 4)"

Output

Multiple select

multi-select

Toggle multiple values below a decorated Moma heading and return every selection on its own line.

moma multi-select "Docker" "CI" "Tests" [--selected 1,3] [--required] [--checkbox box|brackets]

Bash examples

features="$(moma multi-select "Docker" "CI" "Tests" --title "Features")"
features="$(moma multi-select "Docker" "CI" "Tests" --choose 1,3)"
features="$(moma multi-select "Docker" "CI" "Tests" --selected 1,2 --required)"
features="$(moma multi-select "Docker" "CI" "Tests" --checkbox brackets)"

Output

Multiple select

multi-select-groups

Toggle multiple values organized under named, non-selectable group headings and return every selection on its own line, in original visual order.

moma multi-select-groups --title text (--group name --option value...)... [--selected numbers] [--choose numbers] [--required] [--checkbox box|brackets]

Bash examples

countries="$(moma multi-select-groups --title "Features" --group "North America" --option "United States" --option "Canada" --option "Mexico" --group "South America" --option "Colombia" --option "Argentina" --option "Peru")"
countries="$(moma multi-select-groups --title "Features" --group "North America" --option "United States" --option "Canada" --option "Mexico" --group "South America" --option "Colombia" --option "Argentina" --option "Peru" --choose 1,3 --required)"

Output

Decorative

A branded flourish with no functional purpose beyond identity.

Activity component

rabbit

Branded activity and completion feedback using Moma's rabbit signature.

moma rabbit "Preparing workspace" --info

Bash examples

moma rabbit "Preparing workspace" --info
moma rabbit "Deployment complete" --success
moma rabbit "Build needs attention" --warning --icon "!"

Output

Utils

Small reusable helpers for process feedback and dependency checks.

Process helper

spinner

Display progress while a process is active, then print semantic completion feedback.

moma spinner pid ["message"] [--delay seconds]

Bash examples

sleep 2 &
moma spinner "$!" "Waiting"
backup_database &
moma spinner --pid "$!" --message "Backing up"
build_project &
moma spinner "$!" "Building" --delay 0.05

Output

Dependency helper

command-check

Check whether every requested executable is available and return a useful status.

moma command-check bash curl git [--quiet]

Bash examples

moma command-check bash curl git
moma command-check docker --quiet
if ! moma command-check git; then
  exit 1
fi

Output

Self

Commands moma runs about itself: checking its version, updating, and browsing its own documentation.

Release helper

update

Download, validate, and atomically replace an executable Moma installation.

moma update

Bash examples

moma update

Output

  ▪   moma: updated successfully

Release helper

version

Print the version embedded in the installed Moma executable.

moma version

Bash examples

moma version

Output

Documentation helper

preview

Show a categorized terminal, Markdown, or browser preview of every component, without leaving the CLI.

moma preview [md|web]

Bash examples

moma preview
moma preview md
moma preview web

Output

  ────────────────────────────────────────────────────────────────
    MOMA  COMPONENT GALLERY
    Visual reference for the public terminal UI API
  ────────────────────────────────────────────────────────────────

    Legend  ● success  ● error  ● warning  ● info
    ⋮

Documentation helper

help

Print full usage: every command, its description, and the global flags.

moma help

Bash examples

moma help
moma --help
moma -h

Output

  Moma - terminal UI components for Bash

  Usage:
    moma <command> [arguments] [options]
    source dist/moma

  Commands:
    header                 Print a Pagga ASCII heading.
    msg                     Print a styled message.
    select                  Select one value (alias for single-select).
    ⋮  every command and helper, one row each

  Example:
    moma msg "Ready" --success

Command interface

The standalone file exposes every library function as a command and keeps documentation previews in the same entrypoint.

Component commands

Call any visual component without sourcing the library.

moma title | title-sub | sub-title | section | msg | msg-simple | list | box | resume | divider | label | input | prompt | select | single-select | single-select-groups | multi-select | multi-select-groups | rabbit
Helper commands

Run confirmation, spinner, executable checks, and release operations.

moma confirm | spinner | command-check | version | update
Color themes

Load themes from ~/.config/momaui/moma.confg, list them, or select one for a command.

moma themes | moma --theme NAME msg "Ready"
Documentation commands

Open terminal, Markdown, web, or usage documentation.

moma preview [md|web] | help