@letterstory/cli 0.177.43 → 0.177.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli.mjs CHANGED
@@ -88,7 +88,7 @@ import {
88
88
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
89
89
 
90
90
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
91
- export const VERSION = "0.177.43";
91
+ export const VERSION = "0.177.45";
92
92
 
93
93
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
94
94
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -399,6 +399,10 @@ export const BOOLEAN_FLAGS = new Set([
399
399
  "no-first-touch-only",
400
400
  "no-unsubscribe-links",
401
401
  "now",
402
+ // `billing lago move --fee-on-stripe`, `billing lago fee --stripe | --lago`.
403
+ "fee-on-stripe",
404
+ "stripe",
405
+ "lago",
402
406
  "opt-out-footer",
403
407
  "postal-address-footer",
404
408
  "redesign",
@@ -6270,8 +6270,10 @@ const LAGO_USAGE = `Usage: admin billing desk [--json] the Billing desk: s
6270
6270
  signups end <org-id> --why "…" end an org's signup in flight (not yet provisioned), so one on other terms can open
6271
6271
  cap <org-id> <dollars|off> [--why "…"] set an account's monthly spend cap on overage (off: no cap)
6272
6272
  cancel <org-id> --why "…" --yes end an account's Lago plan now (its plan fee refunded in its first month, once per org)
6273
- move <org-id> --plan starter [--ratio 4] [--why "…" above 4x] [--reason "…"] [--complimentary 20000] [--review 2027-05-01] [--stripe-subscription sub_…] [--now] [--dry]
6274
- move an existing customer from Stripe to Lago at their renewal (--now: today, the first invoice credited)
6273
+ move <org-id> --plan starter [--ratio 4] [--why "…" above 4x] [--reason "…"] [--complimentary 20000] [--review 2027-05-01] [--stripe-subscription sub_…] [--now [--fee-on-stripe]] [--dry]
6274
+ move an existing customer from Stripe to Lago at their renewal (--now: today, the first invoice credited; --fee-on-stripe: Stripe keeps billing the fee)
6275
+ fee <org-id> (--stripe [--stripe-subscription sub_…] | --lago) --why "…"
6276
+ who bills a Lago plan's fee: Stripe (Lago's fee $0, its tokens kept) or Lago (Stripe ends at its period end)
6275
6277
  changes [--org <org-id>] term changes waiting to take effect (moves, cheaper plans, new ratios)
6276
6278
  changes cancel <org-id> take back an org's scheduled change before it takes effect`;
6277
6279
 
@@ -6934,6 +6936,7 @@ async function cmdAdminBilling(ctx) {
6934
6936
  reviewAt: flagStr(flags.review),
6935
6937
  stripeSubscriptionId: flagStr(flags["stripe-subscription"]),
6936
6938
  startNow: flags.now ? true : undefined,
6939
+ feeOnStripe: flags["fee-on-stripe"] ? true : undefined,
6937
6940
  dryRun: flags.dry ? true : undefined,
6938
6941
  })
6939
6942
  );
@@ -6941,9 +6944,36 @@ async function cmdAdminBilling(ctx) {
6941
6944
  const credit = p.to.firstInvoiceCreditCents ?? 0;
6942
6945
  ok(
6943
6946
  ctx,
6944
- p.to.startsAt && p.to.startsAt !== p.from.renewsAt
6945
- ? `${result.dryRun ? "Would move" : "Moving"} ${p.orgId} from Stripe ${p.from.stripeSubscriptionId} (${p.from.product ?? "subscription"}) to Lago ${p.to.plan} now: ${p.to.includedTokens} tokens from today, the first invoice $${((p.to.amountCents - credit) / 100).toFixed(2)} after $${(credit / 100).toFixed(2)} Stripe already took. Stripe stops at ${p.from.renewsAt}, when Lago charges $${(p.to.amountCents / 100).toFixed(2)} next.`
6946
- : `${result.dryRun ? "Would move" : "Moving"} ${p.orgId} from Stripe ${p.from.stripeSubscriptionId} (${p.from.product ?? "subscription"}) to Lago ${p.to.plan} at its renewal ${p.from.renewsAt}: Stripe stops then, Lago charges $${(p.to.amountCents / 100).toFixed(2)} then (${p.to.includedTokens} tokens included, overage $${p.to.overageUsdPerToken} a token). Bonus when it takes effect: ${(p.to.bonusTokens ?? 0).toLocaleString("en-US")} tokens (signup × ${p.to.ratio}x), once.`
6947
+ p.to.feeOnStripe
6948
+ ? `${result.dryRun ? "Would put" : "Putting"} ${p.orgId} on Lago ${p.to.plan} now: ${p.to.includedTokens} tokens from today. Stripe ${p.from.stripeSubscriptionId} keeps billing the fee; Lago's is $0 and charges only overage.`
6949
+ : p.to.startsAt && p.to.startsAt !== p.from.renewsAt
6950
+ ? `${result.dryRun ? "Would move" : "Moving"} ${p.orgId} from Stripe ${p.from.stripeSubscriptionId} (${p.from.product ?? "subscription"}) to Lago ${p.to.plan} now: ${p.to.includedTokens} tokens from today, the first invoice $${((p.to.amountCents - credit) / 100).toFixed(2)} after $${(credit / 100).toFixed(2)} Stripe already took. Stripe stops at ${p.from.renewsAt}, when Lago charges $${(p.to.amountCents / 100).toFixed(2)} next.`
6951
+ : `${result.dryRun ? "Would move" : "Moving"} ${p.orgId} from Stripe ${p.from.stripeSubscriptionId} (${p.from.product ?? "subscription"}) to Lago ${p.to.plan} at its renewal ${p.from.renewsAt}: Stripe stops then, Lago charges $${(p.to.amountCents / 100).toFixed(2)} then (${p.to.includedTokens} tokens included, overage $${p.to.overageUsdPerToken} a token). Bonus when it takes effect: ${(p.to.bonusTokens ?? 0).toLocaleString("en-US")} tokens (signup × ${p.to.ratio}x), once.`
6952
+ );
6953
+ printResult(io, flags, result);
6954
+ return 0;
6955
+ }
6956
+ case "fee": {
6957
+ const orgId = requirePositional(positionals, 2, "org-id");
6958
+ const by = flags.stripe ? "stripe" : flags.lago ? "lago" : null;
6959
+ if (!by || !flagStr(flags.why)) throw new CliError(LAGO_USAGE);
6960
+ const result = await staffPost(
6961
+ ctx,
6962
+ `${LAGO}/fee`,
6963
+ compact({
6964
+ orgId,
6965
+ by,
6966
+ stripeSubscriptionId: flagStr(flags["stripe-subscription"]),
6967
+ why: flagStr(flags.why),
6968
+ })
6969
+ );
6970
+ ok(
6971
+ ctx,
6972
+ result.unchanged
6973
+ ? `Stripe ${result.stripeSubscriptionId} already bills ${orgId}'s fee.`
6974
+ : result.by === "stripe"
6975
+ ? `Stripe ${result.stripeSubscriptionId} bills ${orgId}'s fee; Lago's is $0 and the plan's tokens stay.`
6976
+ : `Lago bills ${orgId}'s fee from its next renewal; Stripe ${result.stripeSubscriptionId} ends${result.stripeEndsAt ? ` at ${result.stripeEndsAt}` : ""}.`
6947
6977
  );
6948
6978
  printResult(io, flags, result);
6949
6979
  return 0;
@@ -52,6 +52,8 @@ export function ideaLines(item, n) {
52
52
  if (item.detail && item.detail !== item.why) lines.push(`${pad}${item.detail}`);
53
53
  if (item.queued?.line) lines.push(`${pad}${item.queued.line}`);
54
54
  if (item.start) lines.push(`${pad}${item.start.label}: ${item.start.does}`);
55
+ // A start that goes live says so, as Ideas asks before it (2026-11-13 audit: the terminal never showed it).
56
+ if (item.start?.live) lines.push(`${pad}Goes live: ${item.start.live} Confirm with a person first.`);
55
57
  else if (item.action && !item.action.callable && item.action.href && item.status === "ready")
56
58
  lines.push(`${pad}Done in the app: ${item.action.href}`);
57
59
  return lines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.43",
3
+ "version": "0.177.45",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",