// FRGMNT for developers

Your revenue,
scriptable.

The same framework-free engine that powers the app drives a terminal CLI and an MCP server. Query True MRR, today's cash and transactions from your shell — or let Claude do it. Read-only keys, run locally, nothing stored.

// One engine, four surfaces

The revenue adapters (Stripe, Lemon Squeezy, Gumroad, App Store, Demo) are pure TypeScript with no app dependencies — so the exact same code runs in the iOS app, the CLI, the MCP server and the push worker.

# src/sources — pure adapters → aggregate()
   Stripe ─┐
Lemon Sqz. ─┤
  Gumroad ─┼─▶ aggregate() ─▶ ┌─ iOS app
App Store ─┤                  ├─ frgmnt CLI
     Demo ─┘                  ├─ MCP server
                             └─ Cloudflare worker → Expo Push

// The CLI — frgmnt

Run via npm run cli -- <command> (or npx tsx cli/frgmnt.ts). Add --demo to any data command to run without keys.

mrr [--demo] [--json]True MRR + ARR + per-platform breakdown
$ npm run cli -- mrr --demo

  TRUE MRR  $6,622.73    ARR $79,473    313 subs
    STRP      $4,475.61
    APPL      $1,005.54
    LEMN        $767.32
    GUMR        $374.26
today [--demo] [--json]Cash collected today, net of refunds & fees
$ npm run cli -- today

  TODAY   gross $78,901.00   refunds $4,334.00   fees $2,288.13   net $72,278.87   (347 txns)
transactions [--platform <p>] [--limit <n>] [--json]Recent transactions, newest first (alias: txns)
$ npm run cli -- transactions --limit 5

  14:10:37  LEMN  ADDON_ENABLE                +$79.00
  14:09:36  APPL  PRO_YEARLY_NEW              +$19.00
  14:08:31  STRP  ADDON_ENABLE                +$99.00
  14:07:19  STRP  TEAM_UPGRADE               +$999.00
  14:06:38  STRP  PRO_MONTHLY_NEW            +$240.00
validate <platform> <key>Check an API key is valid & readable
$ npm run cli -- validate stripe rk_live_xxx
  ✓ STRP valid (stripe)
push-test <expoToken> [message…]Fire a test "cha-ching" via Expo Push
$ npm run cli -- push-test "ExponentPushToken[xxx]" "New sale \$49.00 via Stripe"
sourcesList which platforms are configured
$ npm run cli -- sources

  config: ~/.frgmnt/config.json
    STRP   configured (rk_liv…)
    APPL   —
    LEMN   configured (eyJ0eX…)
    GUMR   —

// The MCP server

A stdio Model Context Protocol server exposing your revenue to any MCP client. Add it to Claude Code:

$ claude mcp add frgmnt -- npx tsx /path/to/frgmnt/mcp/server.mts

Then ask Claude things like "what's my MRR?" or "list today's Stripe transactions." Tools:

get_mrr{ demo?: boolean }
True MRR + ARR + active subs + per-platform breakdown.
get_today{ demo?: boolean }
Today's gross, refunds, platform fees and net.
list_transactions{ limit?: number, platform?: string, demo?: boolean }
Recent transactions, newest first.
validate_key{ platform: string, key: string }
Validate an API key for a platform.
send_test_push{ token: string, message?: string }
Send a test push notification via Expo.

// Configuration

The CLI and MCP server read keys from environment variables first, then ~/.frgmnt/config.json (override the path with FRGMNT_CONFIG). Use read-only / restricted keys.

PlatformEnv varconfig.json keyFormat
StripeFRGMNT_STRIPE_KEYstriperk_live_… (restricted, read)
Lemon SqueezyFRGMNT_LEMON_KEYlemonsqueezyAPI key
GumroadFRGMNT_GUMROAD_KEYgumroadaccess token
App StoreFRGMNT_APPSTORE_KEYappstoreISSUER_ID:KEY_ID:base64(.p8)

Example ~/.frgmnt/config.json:

{
  "stripe": "rk_live_xxx",
  "lemonsqueezy": "eyJ0eXAi…",
  "gumroad": "gum_pat_xxx",
  "appstore": "ISSUER_ID:KEY_ID:BASE64_OF_P8"
}

KEYS STAY ON YOUR MACHINE · CALLS GO DIRECT TO EACH PLATFORM · NOTHING IS STORED OR PROXIED.