p202 ltv predict

Predictive LTV — deterministic projection with guards; every number ships with its inputs

All commands

01Run it

Replace the <placeholders> with your own values, or use the builder below.

p202 ltv predict

02What you get

Captured from the real binary, run against a demo store with 30 days of traffic. Switch tabs to see the same run as JSON, the shape scripts and agents parse.

p202 ltv predict --by campaign --period last30
$ p202 ltv predict --by campaign --period last30
account:    {"basis":"account","caps_applied":[],"inputs":{"aov":118.52174,"customers":114,"monthly_churn_rate":0.055556,"mrr":1277,"repeat_rate":0.2105},"predicted_ltv_per_customer":150.12253,"predicted_subscriber_pool_value":22985.81611}
breakdown:  [{"customers":13,"id":4,"name":"Project Tool Pro Annual / US","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 13 customers (\u003c 20)","inputs":{"aov":118.52174,"customers":114,"monthly_churn_rate":0.055556,"mrr":1277,"repeat_rate":0.2105},"predicted_ltv_per_customer":150.12253,"predicted_subscriber_pool_value":22985.81611}},{"customers":25,"id":1,"name":"Spring Collection / US","prediction":{"basis":"cohort","caps_applied":[],"inputs":{"aov":115.89474,"customers":25,"monthly_churn_rate":0.055556,"mrr":0,"repeat_rate":0.52},"predicted_ltv_per_customer":241.44737,"predicted_subscriber_pool_value":0}},{"customers":5,"id":3,"name":"Standing Desk Launch / UK","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 5 customers (\u003c 20)","inputs":{"aov":118.52174,"customers":114,"monthly_churn_rate":0.055556,"mrr":1277,"repeat_rate":0.2105},"predicted_ltv_per_customer":150.12253,"predicted_subscriber_pool_value":22985.81611}},{"customers":23,"id":6,"name":"Bakery Pre-orders / Local","prediction":{"basis":"cohort","caps_applied":[],"inputs":{"aov":61.2,"customers":23,"monthly_churn_rate":0.055556,"mrr":0,"repeat_rate":0.3043},"predicted_ltv_per_customer":87.96895,"predicted_subscriber_pool_value":0}},{"customers":13,"id":7,"name":"Holiday Gift Cards / AU","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 13 customers (\u003c 20)","inputs":{"aov":118.52174,"customers":114,"monthly_churn_rate":0.055556,"mrr":1277,"repeat_rate":0.2105},"predicted_ltv_per_customer":150.12253,"predicted_subscriber_pool_value":22985.81611}},{"customers":26,"id":2,"name":"Coffee Subscription / US","prediction":{"basis":"cohort","caps_applied":[],"inputs":{"aov":38,"customers":26,"monthly_churn_rate":0.055556,"mrr":608,"repeat_rate":0},"predicted_ltv_per_customer":38,"predicted_subscriber_pool_value":10943.91245}},{"customers":9,"id":5,"name":"Free Trial to Paid / CA","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 9 customers (\u003c 20)","inputs":{"aov":118.52174,"customers":114,"monthly_churn_rate":0.055556,"mrr":1277,"repeat_rate":0.2105},"predicted_ltv_per_customer":150.12253,"predicted_subscriber_pool_value":22985.81611}}]
Real output · p202 1.9.78 · demo dataexit 0

03Build your command

Pick values and the command line writes itself, quoted and ready to paste.

p202 ltv predict

Set flags below; the command updates as you type.

04Flags

5 flags, plus the global flags every command takes.

FlagWhat it does
--by, -bstringAlso project per cohort: campaign, ppc_account, landing_page, product
campaignppc_accountlanding_pageproduct
--cfstringArrayOnly customers whose custom field matches: key=value, or key.min=value / key.max=value for a number or date field (repeatable, at most 3; p202 ltv fields list shows the keys)
--period, -pstringPeriod: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltime
todayyesterdaylast7last14last30last90thismonthlastmonththisyearlastyearalltime
--time-fromstringAcquisition window start: unix seconds, a date (2026-10-01, from its first second in the account's timezone) or a time with its offset (2026-10-01T09:30:00Z)
--time-tostringAcquisition window end, inclusive: unix seconds, a date (2026-10-01, through its last second in the account's timezone) or a time with its offset

05For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands ltv predict --json.
  • With AI_AGENT, CLAUDECODE or another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with a hint.
  • Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure, 6 no Pro licence on the install.
p202 commands ltv predict --json
{
  "path": "p202 ltv predict",
  "use": "predict",
  "short": "Predictive LTV — deterministic projection with guards; every number ships with its inputs",
  "runnable": true,
  "flags": [
    {
      "name": "by",
      "shorthand": "b",
      "type": "string",
      "default": "",
      "usage": "Also project per cohort: campaign, ppc_account, landing_page, product",
      "allowed_values": [
        "campaign",
        "ppc_account",
        "landing_page",
        "product"
      ],
      "required": false
    },
    {
      "name": "cf",
      "type": "stringArray",
      "default": "[]",
      "usage": "Only customers whose custom field matches: key=value, or key.min=value / key.max=value for a number or date field (repeatable, at most 3; `p202 ltv fields list` shows the keys)",
      "required": false
    },
    {
      "name": "period",
      "shorthand": "p",
      "type": "string",
      "default": "",
      "usage": "Period: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltime",
      "allowed_values": [
        "today",
        "yesterday",
        "last7",
        "last14",
        "last30",
        "last90",
        "thismonth",
        "lastmonth",
        "thisyear",
        "lastyear",
        "alltime"
      ],
      "required": false
    },
    {
      "name": "time-from",
      "type": "string",
      "default": "",
      "usage": "Acquisition window start: unix seconds, a date (2026-10-01, from its first second in the account's timezone) or a time with its offset (2026-10-01T09:30:00Z)",
      "required": false
    },
    {
      "name": "time-to",
      "type": "string",
      "default": "",
      "usage": "Acquisition window end, inclusive: unix seconds, a date (2026-10-01, through its last second in the account's timezone) or a time with its offset",
      "required": false
    }
  ]
}