A commandline utility for converting CDDL to various formats.
- Clone this repo and
cdinto it. cargo run -- [--format <type-script|zod>] path/to/file.cddl
The output is generally ugly, so you may need to format it. The easiest way is to pipe it into a formatter.
For example,
outfile=path/to/file.ts
cargo run -- path/to/file.cddl | prettier --stdin-filepath=$outfile > $outfile- Only
TypeScript(--format type-script) andZod v4(--format zod) are supported at the moment.