rendering
Vega-Lite CLI for AI Agents
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 CLI Setup
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 --json
kosmokrator integrations:doctor vegalite --json
kosmokrator 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 credentials none. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
No credentials are required.
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call vegalite.render_vegalite '{"spec":"example_spec","title":"example_title","width":1}' --json kosmo integrations:vegalite render_vegalite '{"spec":"example_spec","title":"example_title","width":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs vegalite --json
kosmo integrations:docs vegalite.render_vegalite --json
kosmo integrations:schema vegalite.render_vegalite --json
kosmo integrations:search "Vega-Lite" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
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".
write - Parameters
- spec, title, width
kosmo integrations:call vegalite.render_vegalite '{"spec":"example_spec","title":"example_title","width":1}' --json kosmo integrations:vegalite render_vegalite '{"spec":"example_spec","title":"example_title","width":1}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
vegalite.render_vegalite 3 parameters
kosmo integrations:schema vegalite.render_vegalite --json | Parameter | Type | Required | Description |
|---|---|---|---|
spec | string | yes | 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.