01Run it
Replace the <placeholders> with your own values, or use the builder below.
p202 ltv predict02What 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 account: {"basis":"account","caps_applied":[],"inputs":{"aov":122.2963,"customers":115,"monthly_churn_rate":0.044872,"mrr":1454,"repeat_rate":0.1739},"predicted_ltv_per_customer":148.04055,"predicted_subscriber_pool_value":32403.28044} breakdown: [{"customers":10,"id":4,"name":"Project Tool Pro Annual / US","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 10 customers (\u003c 20)","inputs":{"aov":122.2963,"customers":115,"monthly_churn_rate":0.044872,"mrr":1454,"repeat_rate":0.1739},"predicted_ltv_per_customer":148.04055,"predicted_subscriber_pool_value":32403.28044}},{"customers":24,"id":1,"name":"Spring Collection / US","prediction":{"basis":"cohort","caps_applied":[],"inputs":{"aov":122,"customers":24,"monthly_churn_rate":0.044872,"mrr":0,"repeat_rate":0.2917},"predicted_ltv_per_customer":172.2434,"predicted_subscriber_pool_value":0}},{"customers":8,"id":3,"name":"Standing Desk Launch / UK","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 8 customers (\u003c 20)","inputs":{"aov":122.2963,"customers":115,"monthly_churn_rate":0.044872,"mrr":1454,"repeat_rate":0.1739},"predicted_ltv_per_customer":148.04055,"predicted_subscriber_pool_value":32403.28044}},{"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":122.2963,"customers":115,"monthly_churn_rate":0.044872,"mrr":1454,"repeat_rate":0.1739},"predicted_ltv_per_customer":148.04055,"predicted_subscriber_pool_value":32403.28044}},{"customers":18,"id":6,"name":"Bakery Pre-orders / Local","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 18 customers (\u003c 20)","inputs":{"aov":122.2963,"customers":115,"monthly_churn_rate":0.044872,"mrr":1454,"repeat_rate":0.1739},"predicted_ltv_per_customer":148.04055,"predicted_subscriber_pool_value":32403.28044}},{"customers":30,"id":2,"name":"Coffee Subscription / US","prediction":{"basis":"cohort","caps_applied":[],"inputs":{"aov":37.2,"customers":30,"monthly_churn_rate":0.044872,"mrr":736,"repeat_rate":0},"predicted_ltv_per_customer":37.2,"predicted_subscriber_pool_value":16402.21073}},{"customers":12,"id":5,"name":"Free Trial to Paid / CA","prediction":{"basis":"account_fallback","caps_applied":[],"fallback_reason":"cohort has 12 customers (\u003c 20)","inputs":{"aov":122.2963,"customers":115,"monthly_churn_rate":0.044872,"mrr":1454,"repeat_rate":0.1739},"predicted_ltv_per_customer":148.04055,"predicted_subscriber_pool_value":32403.28044}}]
$ p202 ltv predict --by campaign --period last30 --json { "data": { "account": { "basis": "account", "caps_applied": [], "inputs": { "aov": 122.2963, "customers": 115, "monthly_churn_rate": 0.044872, "mrr": 1454, "repeat_rate": 0.1739 }, "predicted_ltv_per_customer": 148.04055, "predicted_subscriber_pool_value": 32403.28044 }, "breakdown": [ { "customers": 10, "id": 4, "name": "Project Tool Pro Annual / US", "prediction": { "basis": "account_fallback", "caps_applied": [], "fallback_reason": "cohort has 10 customers (\u003c 20)", "inputs": { "aov": 122.2963, "customers": 115, "monthly_churn_rate": 0.044872, "mrr": 1454, "repeat_rate": 0.1739 }, "predicted_ltv_per_customer": 148.04055, "predicted_subscriber_pool_value": 32403.28044 } }, { "customers": 24, "id": 1, "name": "Spring Collection / US", "prediction": { "basis": "cohort", "caps_applied": [], "inputs": { "aov": 122, "customers": 24, "monthly_churn_rate": 0.044872, "mrr": 0, "repeat_rate": 0.2917 }, "predicted_ltv_per_customer": 172.2434, "predicted_subscriber_pool_value": 0 } }, { "customers": 8, "id": 3, "name": "Standing Desk Launch / UK", "prediction": { "basis": "account_fallback", "caps_applied": [], "fallback_reason": "cohort has 8 customers (\u003c 20)", "inputs": { "aov": 122.2963, "customers": 115, "monthly_churn_rate": 0.044872, "mrr": 1454, "repeat_rate": 0.1739 }, "predicted_ltv_per_customer": 148.04055, "predicted_subscriber_pool_value": 32403.28044 } }, { "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": 122.2963, "customers": 115, "monthly_churn_rate": 0.044872, "mrr": 1454, "repeat_rate": 0.1739 }, "predicted_ltv_per_customer": 148.04055, "predicted_subscriber_pool_value": 32403.28044 } }, { "customers": 18, "id": 6, "name": "Bakery Pre-orders / Local", "prediction": { "basis": "account_fallback", "caps_applied": [], "fallback_reason": "cohort has 18 customers (\u003c 20)", "inputs": { "aov": 122.2963, "customers": 115, "monthly_churn_rate": 0.044872, "mrr": 1454, "repeat_rate": 0.1739 }, "predicted_ltv_per_customer": 148.04055, "predicted_subscriber_pool_value": 32403.28044 } }, { "customers": 30, "id": 2, "name": "Coffee Subscription / US", "prediction": { "basis": "cohort", "caps_applied": [], "inputs": { "aov": 37.2, "customers": 30, "monthly_churn_rate": 0.044872, "mrr": 736, "repeat_rate": 0 }, "predicted_ltv_per_customer": 37.2, "predicted_subscriber_pool_value": 16402.21073 } }, { "customers": 12, "id": 5, "name": "Free Trial to Paid / CA", "prediction": { "basis": "account_fallback", "caps_applied": [], "fallback_reason": "cohort has 12 customers (\u003c 20)", "inputs": { "aov": 122.2963, "customers": 115, "monthly_churn_rate": 0.044872, "mrr": 1454, "repeat_rate": 0.1739 }, "predicted_ltv_per_customer": 148.04055, "predicted_subscriber_pool_value": 32403.28044 } } ] } }
03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 ltv predictSet flags below; the command updates as you type.
04Flags
5 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --by, -bstring | Also project per cohort: campaign, ppc_account, landing_page, productcampaignppc_accountlanding_pageproduct |
| --cfstringArray | 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) |
| --period, -pstring | Period: today, yesterday, last7, last14, last30, last90, thismonth, lastmonth, thisyear, lastyear, alltimetodayyesterdaylast7last14last30last90thismonthlastmonththisyearlastyearalltime |
| --time-fromstring | 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) |
| --time-tostring | 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 |
05For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands ltv predict --json. - With
AI_AGENT,CLAUDECODEor another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with ahint. - Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
{
"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
}
]
}