New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

mayartui

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mayartui

Terminal UI dashboard for the Mayar.id headless API.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

mayartui

A terminal UI dashboard for the Mayar.id headless API. Built with OpenTUI on Bun, written in TypeScript.

┌── mayartui ───────────────────────────────────────────────────┐
│ Sat, 2 May 2026  ·  14:30:45  ●                               │
│                                                               │
│ ███╗   ███╗ █████╗ ██╗   ██╗ █████╗ ██████╗     BALANCE       │
│ ████╗ ████║██╔══██╗╚██╗ ██╔╝██╔══██╗██╔══██╗                  │
│ ██╔████╔██║███████║ ╚████╔╝ ███████║██████╔╝    Rp 12.345.678 │
│ ██║╚██╔╝██║██╔══██║  ╚██╔╝  ██╔══██║██╔══██╗                  │
│ ╚═╝     ╚═╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝   active … pending│
└────────────────────────────────────────────────── production ─┘
┌── menu ──────┐┌── list ──────────────────────┐┌── detail ────┐
│ 1 Tx Paid   ││ Andi Setiawan      Rp 250 000 ││ ID 8af33…    │
│ 2 Tx Unpaid ││ Putri Hidayat      Rp 480 000 ││ STATUS       │
│ 3 Invoices  ││ Bambang R.         Rp 125 000 ││ SUCCESS      │
│ 4 Payments  ││ Dewi Lestari        Rp 99 000 ││ AMOUNT       │
│ 5 Products  ││ Rama Wijaya        Rp 750 000 ││ Rp 250 000   │
│ 6 Customers ││                              ││ ...           │
└──────────────┘└───────────────────────────────┘└──────────────┘
 tab focus(menu) · s settings · r reload · ←/→ page · q quit

Features

  • Three-column layout — menu / list / detail.
  • Live clock with blinking indicator and a chunky ASCII balance widget in the header.
  • Resources: paid transactions, unpaid transactions, invoices, single payments, products, customers, reviews (with star ratings).
  • Theme switcher: Matrix, Mayar (brand light theme), Tokyo Night, Goblin Mode, Dracula, Synthwave, Nord, Rosé Pine.
  • Configurable loading spinner (dots, line, arrow, pulse, matrix, bounce) with a global "animations off" toggle.
  • Production / Sandbox environment toggle.
  • Persists configuration to ~/.config/mayartui/config.json (mode 0600).
  • API key can be supplied via MAYAR_API_KEY environment variable to override the saved value.

Requirements

Bun ≥ 1.1 is required at runtime. OpenTUI's native renderer ships Bun-only FFI bindings (Node.js / Deno support is in progress upstream), so mayartui runs on Bun even when installed through npm.

Install Bun once if you don't already have it:

curl -fsSL https://bun.sh/install | bash

Install

Install globally from npm:

npm install -g mayartui
mayartui

Or one-off via npx / bunx:

npx mayartui
# or
bunx mayartui

Or run from source:

git clone https://github.com/moerdowo/mayar-tui.git
cd mayar-tui
bun install
bun run start

Configuration

On first launch you'll see a setup card asking for your API key. Generate one at https://web.mayar.id/api-keys. The key is stored at ~/.config/mayartui/config.json (mode 0600).

Environment variables

VariableEffect
MAYAR_API_KEYOverrides the saved API key for this run.
MAYAR_ENVproduction or sandbox.
XDG_CONFIG_HOMEStandard XDG override for the config path.

Keys

KeyAction
↑ / ↓Move within the focused list
Tab / S-TabCycle focus between menu / list / detail
EnterConfirm menu selection
1–7Jump straight to a resource
← / →Previous / next page
rReload current resource and balance
sOpen the settings overlay
EscClose settings
q / Ctrl+CQuit

Programmatic use

mayartui also exposes a small library surface — useful if you want to embed the API client or mount the TUI inside another OpenTUI app:

import {
  MayarClient,
  MayarApp,
  THEMES,
  SPINNERS,
} from "mayartui";

const client = new MayarClient({
  apiKey: process.env.MAYAR_API_KEY!,
  env: "production",
});

const balance = await client.balance();
const paid = await client.paidTransactions({ page: 1, pageSize: 20 });

API endpoints used

All endpoints are documented at https://docs.mayar.id. The base URL is https://api.mayar.id/hl/v1 (production) or https://api.mayar.club/hl/v1 (sandbox). Authentication is Authorization: Bearer <api_key>.

MethodPathResource
GET/balanceaccount balance
GET/transactionspaid transactions
GET/transactions/unpaidunpaid transactions
GET/invoiceinvoices
GET/paymentsingle payment requests
GET/productproducts
GET/customercustomers
GET/reviewscustomer reviews

Development

bun install
bun run dev          # run the TUI from source
bun run typecheck    # tsc --noEmit
bun run build        # bundle to dist/ + emit .d.ts

There is a small smoke harness in scripts/ that mounts the renderer in testing mode (no real TTY) to catch regressions:

bun run scripts/smoke.ts
bun run scripts/smoke-theme.ts
bun run scripts/smoke-settings.ts

License

MIT

Keywords

mayar

FAQs

Package last updated on 10 May 2026

Related posts