Alethia Labs

TUI Components

Terminal UI components — interactive selectors, progress steppers, and Bubble Tea spinners.

TUI Components

alethia uses the Charmbracelet suite for rich terminal UI. Three libraries are used:

LibraryPurpose
huhInteractive forms and selection prompts
bubbleteaFull TUI framework (used for the login spinner)
lipglossTerminal styling and layout

Interactive Selectors

When --spec-id is omitted from plan, apply, or destroy, alethia launches a two-step TUI selector:

Step 1: Zone Selector

? Select a zone:
  > api-backend (3 Specs)
    data-platform (1 Spec)
    internal-tools (2 Specs)

Navigate with arrow keys, confirm with Enter.

Step 2: Spec Selector

? Select a Spec:
  > production / eu-west-1 (ACTIVE)
    staging / eu-west-1 (DRAFT)
    development / us-east-1 (PROVISIONING)

Each Spec shows its environment stage, region, and current status.

Standalone Usage

alethia selectors

Runs the full selection flow and prints the selected IDs.

Progress Stepper

The visual progress stepper shows deployment phase progress using diamond icons:

◆ Authentication     ← completed
◆ Configuration      ← completed
◈ Terraform Plan     ← current (running)
◇ Cost Analysis      ← pending
◇ Reporting          ← pending
  • (filled diamond) — completed step
  • (diamond with dot) — currently executing
  • (empty diamond) — pending

Login Spinner

The alethia login command uses a Bubble Tea model for the authentication flow:

🔐 Waiting for browser authentication...

  Visit: https://alethia.example.com/cli/login?device_code=abc123
  Enter the verification code shown in your browser:

  > _

  ⠋ Waiting for approval...

The spinner animates while polling the exchange endpoint every 2 seconds.

Config Printer

Job details and Spec configurations are displayed with formatted JSON output using lipgloss styling:

  • Monospace font for values
  • Color-coded keys
  • Indented structure for nested objects
  • Truncated long values with ellipsis

On this page