Use the Vega-Lite CLI from KosmoKrator to call Vega-Lite tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
Vega-Lite can be configured headlessly with `kosmokrator integrations:configure vegalite`.
# Install KosmoKrator first if it is not available on PATH.curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash# Configure and verify this integration.kosmokrator integrations:configure vegalite --enable --read allow --write ask --jsonkosmokrator integrations:doctor vegalite --jsonkosmokrator integrations:status --json
Runtime Requirements
Install these host dependencies before calling Vega-Lite locally.
Name
Type
Description
node
binary
Node.js is required to render Vega-Lite charts.
Credentials
Authentication type: No credentialsnone. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
No credentials are required.
Call Vega-Lite Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to Vega-Lite.
vegalite.render_vegalite
Write write
Render a Vega-Lite visualization to a PNG image. Pass a complete Vega-Lite JSON specification and get back a markdown image embed.
IMPORTANT: Always use inline data with "data": {"values": [...]}. Never use "data": {"url": "..."}.
Example spec:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": [
{"category": "A", "value": 28},
{"category": "B", "value": 55},
{"category": "C", "value": 43}
]},
"mark": "bar",
"encoding": {
"x": {"field": "category", "type": "nominal"},
"y": {"field": "value", "type": "quantitative"}
}
}
Supported mark types: bar, line, point, area, rect, circle, square, arc, text, tick, rule, trail, boxplot.
Always include "type" in encoding channels: "quantitative", "nominal", "ordinal", or "temporal".
Use these parameter tables when building CLI payloads without calling integrations:schema first.
vegalite.render_vegalite
Render a Vega-Lite visualization to a PNG image. Pass a complete Vega-Lite JSON specification and get back a markdown image embed.
IMPORTANT: Always use inline data with "data": {"values": [...]}. Never use "data": {"url": "..."}.
Example spec:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": [
{"category": "A", "value": 28},
{"category": "B", "value": 55},
{"category": "C", "value": 43}
]},
"mark": "bar",
"encoding": {
"x": {"field": "category", "type": "nominal"},
"y": {"field": "value", "type": "quantitative"}
}
}
Supported mark types: bar, line, point, area, rect, circle, square, arc, text, tick, rule, trail, boxplot.
Always include "type" in encoding channels: "quantitative", "nominal", "ordinal", or "temporal".
Complete Vega-Lite JSON specification. Must include "data" with inline "values", "mark" type, and "encoding". Always use {"data": {"values": [...]}} for data.
title
string
no
Chart title used as alt text (default: "Chart").
width
integer
no
Output width in pixels (default: 800, range: 200–4000).
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults
with integrations:configure. Add --force only for trusted automation that should bypass that policy.