Command-line tool

Kinogaki CLI

Validate Prism documents, convert between formats through Prism, and pack a whole directory tree into a single file with one self-contained binary.

The command line for Prism files

kinogaki is the automation surface for the platform: a single C++20 binary that depends only on Kinogaki Core, validates documents, converts between formats, and packs directory trees into bundles. Each format lives as a codec looked up in a registry, so the CLI stays a thin, scriptable front end over the same machinery everything else uses.

kinogaki check   <file>
kinogaki convert <in> <out> [--compress] [--from <fmt>] [--to <fmt>]
kinogaki pack    <dir> <out>
kinogaki unpack  <in>  <dir>
kinogaki compose <file>

check: validate and locate errors

$ kinogaki check scene.prisma
scene.prisma: valid kinogaki document (12 elements, 3 connections)

$ kinogaki check broken.prisma
broken.prisma:4:18: error: invalid value for its declared type

A file-absolute line:column and a message for text documents; a short diagnosis for binary, bundle, or other input. Exit 0 if valid, 1 if not, so it drops straight into a pre-commit hook or CI.

convert: any format, through Prism

convert reads the input into a Document and writes the Document out in the target format. The input format is sniffed from content, the output inferred from extension, and either can be forced with --from / --to:

kinogaki convert notes.md    notes.prisma          # markdown → Prism document
kinogaki convert notes.prisma notes.html           # → html (same document model)
kinogaki convert data.json   data.prisma           # json → path-addressed elements
kinogaki convert world.prisma world.prism --compress   # text → compressed binary
kinogaki convert logo.png    logo.prism            # any binary → wrapped losslessly

Native .prisma.prism is Kinogaki Core's own serialization. json, markdown, html, svg are codecs onto canonical models. text wraps a file as lines and blob wraps it as bytes, so any format round-trips byte-exact (convert logo.png logo.prism then back reproduces the original). Every file survives the trip.

pack / unpack: a tree as one file

kinogaki pack   ./site site.prism      # html + svg + css + images → one compressed file
kinogaki unpack site.prism ./out       # byte-identical tree back out

Packing walks a directory into a bundle Document: documents and vectors stored structurally, binaries byte-exact, the whole thing compressed by default. Unpacking materialises each file by its name's extension. A .prisma target gives you a readable text bundle instead of a binary one.

compose: flatten references into one document

compose resolves every reference a document names, including wildcard references like /parts/*, and writes the single flattened document to stdout:

kinogaki compose garage.prisma > flat.prisma   # references pulled in, one Document

References resolve relative to each file's own directory and recursively; a cycle or a missing file is a clean error.

Eating its own food

The CLI is the clearest demonstration that the model holds: it routes every format through Kinogaki Core's codecs and reuses its parsers. Add a new codec to the library and the CLI gains a new format for free, on both the read and write sides, while its own code stays put. It is the same kinogaki convert that turns the Markdown of these very pages into the .prisma documents the site renderer consumes.