Skip to content

CLI Reference

Synopsis

cosy [COMMAND] [OPTIONS]

Commands

render

Render an image from a template.

bash
cosy render --template <TEMPLATE> --data <DATA.json> --output <OUTPUT.png>
FlagTypeRequiredDescription
-t, --templatestringYesTemplate name (e.g. stat-card)
-d, --datapathYesPath to JSON input file
-o, --outputpathYesOutput PNG path
-s, --scalefloatNoScale factor (default: 1.0)

Example:

bash
cosy render --template og-image --data post.json --output cover.png --scale 2.0

serve

Start the HTTP API server.

bash
cosy serve --port <PORT> [--token <TOKEN>]
FlagTypeRequiredDescription
-p, --portu16YesPort to listen on
--tokenstringNoBearer token for auth. If empty, COSY_API_KEY env var is used.

TIP

If neither --token nor COSY_API_KEY is set, auth is disabled (development mode). The health endpoint is always public.

templates

List all available templates.

bash
cosy templates

validate

Validate JSON input against a template's schema.

bash
cosy validate --template <TEMPLATE> --data <DATA.json>
FlagTypeRequiredDescription
-t, --templatestringYesTemplate name
-d, --datapathYesPath to JSON input file

--version

bash
cosy --version
# cosy 0.1.0

--help

bash
cosy --help
cosy render --help
cosy serve --help

Released under the BSL-1.0 License.