| name | mayar |
| display_name | Mayar CLI |
| version | 0.1.9 |
| description | Interact with the Mayar payment platform (invoices, products, payments, customers, transactions, webhooks, QR codes) from any AI agent or shell. Zero dependencies — Node.js 18+ only.
|
| author | Mayar bot |
| license | MIT |
| homepage | https://github.com/mayarid/mayar-cli |
| repository | https://github.com/mayarid/mayar-cli.git |
| tags | ["payments","invoices","mayar","indonesia","cli","tool"] |
| runtime | node>=18 |
| install_command | npx -y mayar@latest |
| invoke_prefix | npx -y mayar@latest |
| env | {"MAYAR_API_KEY":{"description":"Mayar API key. Obtain from web.mayar.id → Integration → API Key.","required":true,"secret":true},"MAYAR_API_URL":{"description":"Override API base URL. Defaults to https://api.mayar.id.","required":false,"default":"https://api.mayar.id"}} |
| auth | {"type":"bearer","resolution_order":[{"flag":"--api-key"},{"env":"MAYAR_API_KEY"},{"file":"~/.config/mayar/config.json"}]} |
| capabilities | ["invoices","products","payments","customers","transactions","reviews","webhooks","qrcode","balance","whoami"] |
Mayar CLI — Agent Skill
This document describes how AI agents (Claude Code, OpenClaw, and others)
should install, authenticate, and use the mayar CLI tool.
Quick start for agents
npx -y mayar@latest whoami
Authentication flow
Step 1 — detect active user
Run whoami to check if a valid API key is already configured:
npx -y mayar@latest whoami --json
Successful output contains "valid": true and the merchant's name, email,
and accountId. If the key is valid, proceed directly to the requested task.
Step 2 — handle missing or invalid key
If whoami exits non-zero or returns "valid": false, the agent MUST stop
and ask the user for their API key using one of the following options:
Option A — environment variable (recommended for non-interactive agents):
Ask the user to set:
export MAYAR_API_KEY=<their_key>
Then re-run the original command.
Option B — one-time flag (single command):
Ask the user to provide the key and pass it as:
npx -y mayar@latest --api-key <their_key> whoami
Option C — interactive setup (terminal agents only):
If the agent has access to an interactive TTY:
npx -y mayar@latest init
Agents must NEVER fabricate or guess an API key. Always stop and ask the user.
Get a key at: https://web.mayar.id → Integration → API Key
Usage reference
All commands use the pattern:
npx -y mayar@latest <command> [subcommand] [args] [flags]
Account
npx -y mayar@latest whoami
npx -y mayar@latest balance