p202 goal validate

Check a definition without saving it (answers the canonical form)

All commands

01Run it

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

p202 goal validate

02What you get

Pick the shape you need. People get a table. Add --json, --csv or --ndjson for scripts, or -q for ids only. An AI agent gets compact JSON without asking. All output formats

03Build your command

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

p202 goal validate

Set flags below; the command updates as you type.

04Flags

18 flags, plus the global flags every command takes.

FlagWhat it does
--afterstringGoal ids that must be reached first, comma-separated
--countstringReached on the Nth matching event (default 1)
--definitionstringThe whole definition as JSON (exclusive with the quick flags)
--eventstringTrigger: the event name that reaches the goal
--file, -FstringRead the definition JSON from a file (- for stdin)
--installboolTrigger: the install itself
--namestringGoal name (unique per owner)
--no-valueboolTracked, not paid (value none)
--no-windowboolRemove the window (update)
--repeatstringHow often it can be reached (default once): once, each
onceeach
--repeat-maxstringWith --repeat each: the most times it can be reached (1-10000; required for a --sum-prop goal)
--sum-gtestringThe running-sum threshold
--sum-propstringReached when the running sum of this property (or $revenue) reaches --sum-gte
--valuestringFixed value of reaching the goal, e.g. 4.00
--value-from-propertystringValue from an event property (default the event's revenue)
--wherestringConditions on the event, "<prop> <op> <value>", several separated by ; (ANDed); ops: eq, neq, gt, gte, lt, lte, in, exists
--within-daysstringOnly events within this many days of --within-from
--within-fromstringWindow anchor: install, click
installclick

05For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands goal validate --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.
p202 commands goal validate --json
{
  "path": "p202 goal validate",
  "use": "validate",
  "short": "Check a definition without saving it (answers the canonical form)",
  "runnable": true,
  "flags": [
    {
      "name": "after",
      "type": "string",
      "default": "",
      "usage": "Goal ids that must be reached first, comma-separated",
      "required": false
    },
    {
      "name": "count",
      "type": "string",
      "default": "",
      "usage": "Reached on the Nth matching event (default 1)",
      "required": false
    },
    {
      "name": "definition",
      "type": "string",
      "default": "",
      "usage": "The whole definition as JSON (exclusive with the quick flags)",
      "required": false
    },
    {
      "name": "event",
      "type": "string",
      "default": "",
      "usage": "Trigger: the event name that reaches the goal",
      "required": false
    },
    {
      "name": "file",
      "shorthand": "F",
      "type": "string",
      "default": "",
      "usage": "Read the definition JSON from a file (- for stdin)",
      "required": false
    },
    {
      "name": "install",
      "type": "bool",
      "default": "false",
      "usage": "Trigger: the install itself",
      "required": false
    },
    {
      "name": "name",
      "type": "string",
      "default": "",
      "usage": "Goal name (unique per owner)",
      "required": false
    },
    {
      "name": "no-value",
      "type": "bool",
      "default": "false",
      "usage": "Tracked, not paid (value none)",
      "required": false
    },
    {
      "name": "no-window",
      "type": "bool",
      "default": "false",
      "usage": "Remove the window (update)",
      "required": false
    },
    {
      "name": "repeat",
      "type": "string",
      "default": "",
      "usage": "How often it can be reached (default once): once, each",
      "allowed_values": [
        "once",
        "each"
      ],
      "required": false
    },
    {
      "name": "repeat-max",
      "type": "string",
      "default": "",
      "usage": "With --repeat each: the most times it can be reached (1-10000; required for a --sum-prop goal)",
      "required": false
    },
    {
      "name": "sum-gte",
      "type": "string",
      "default": "",
      "usage": "The running-sum threshold",
      "required": false
    },
    {
      "name": "sum-prop",
      "type": "string",
      "default": "",
      "usage": "Reached when the running sum of this property (or $revenue) reaches --sum-gte",
      "required": false
    },
    {
      "name": "value",
      "type": "string",
      "default": "",
      "usage": "Fixed value of reaching the goal, e.g. 4.00",
      "required": false
    },
    {
      "name": "value-from-property",
      "type": "string",
      "default": "",
      "usage": "Value from an event property (default the event's revenue)",
      "required": false
    },
    {
      "name": "where",
      "type": "string",
      "default": "",
      "usage": "Conditions on the event, \"<prop> <op> <value>\", several separated by ; (ANDed); ops: eq, neq, gt, gte, lt, lte, in, exists",
      "required": false
    },
    {
      "name": "within-days",
      "type": "string",
      "default": "",
      "usage": "Only events within this many days of --within-from",
      "required": false
    },
    {
      "name": "within-from",
      "type": "string",
      "default": "",
      "usage": "Window anchor: install, click",
      "allowed_values": [
        "install",
        "click"
      ],
      "required": false
    }
  ]
}