@cosyte/cli
cosyte is a PHI-safe developer CLI over the @cosyte/* healthcare parsers. Pipe a raw message
from a hospital feed into the terminal and get typed, structured JSON back in one line, without
writing code, without reading the spec, and without ever being handed a confident wrong value or a
silent success on a malformed message.
cat adt.hl7 | cosyte parse -
@cosyte/cli is a bin package, not a library: its primary artifact is the cosyte command on
your PATH. It is a thin, honest skin over libraries that already own correctness: it routes, reads,
shapes output, and owns two disciplines of its own: a documented exit-code contract and a
value-free diagnostic posture (never a field value on stderr).
Status: pre-alpha (
0.0.x), published to npm at0.0.1. That release cannot be installed (a packaging defect: see Installation), so run the CLI from a source checkout for now.parse,validate,inspect, andfmtare wired for HL7 v2 and FHIR R4;convertandmap-codeswrap the higher-layer libraries. Acosyte-mcpMCP server exposes the same core to an LLM/agent. All eight cosyte formats are wired, with support honest per (format, operation) and NDJSON streaming for MLLP and--ndjson.
Parse a message
parse reads a file (or stdin via -), autodetects the format by content, and prints the parsed
model as typed JSON on stdout:
cosyte parse message.hl7 # autodetected → HL7 v2
cosyte parse patient.json # autodetected → FHIR
cat message.hl7 | cosyte parse - # from a pipeline
cosyte parse --format hl7 msg.txt # override autodetection
The exit code carries the outcome (0 success, 65 unparseable/undetected, 66 missing file) so
cosyte parse is safe to branch on in CI. See Quickstart.
Next
- Installation:
npx, global install, prerequisites. - Quickstart: the one-line parse, stdin, and the programmatic API.
- MCP server: expose the same parse/validate/convert core to an LLM/agent.
- API Reference: every programmatic export, generated from source.