CLI · 05

cosmo validate

Validate Signal envelopes against the spec. Pass a JSON file as the positional argument, or pipe one in on stdin; add --live to validate signals as they cross a synapse. --strict exits 1 on the first violation; --warnings surfaces advisory issues too.

$ cosmo validate --help

Validate Signal envelopes against the spec  -  from a file, stdin, or live.

Usage
  cosmo validate [FILE] [options]

Arguments
  FILE                    JSON file to validate. Reads stdin if omitted.

Options
  --live                   Validate signals live on the Synapse.
  --namespace <ns>         Namespace (--live mode only). Default: default
  --strict                 Exit 1 on the first violation.
  --warnings               Show advisory warnings too.

Examples

$ cosmo validate signal.json
   valid: TASK trace=trc_01JV… neuron=answerer

$ echo '{"type":"TASK"}' | cosmo validate
   invalid: missing required field 'id'

$ cosmo validate --live --namespace=dev --strict

Have a feature in mind?

The protocol, SDKs, and CLI are still pre-1.0. If something here is missing, ambiguous, or wrong - open an issue and propose a change. Every breaking change is debated in DECISIONS.md first.