KosmoKrator

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.

1 functions 0 read 1 write No credentials auth

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.

NameTypeDescription
node binary Node.js is required to render Vega-Lite charts.

Credentials

Authentication type: No credentials none. 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.

kosmo integrations:call vegalite.render_vegalite '{
  "spec": "example_spec",
  "title": "example_title",
  "width": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:vegalite render_vegalite '{
  "spec": "example_spec",
  "title": "example_title",
  "width": 1
}' --json

Agent Discovery Commands

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

All CLI Functions

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".

Parameters
spec, title, width

Generic CLI call

kosmo integrations:call vegalite.render_vegalite '{"spec":"example_spec","title":"example_title","width":1}' --json

Provider shortcut

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

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".

Operation
Write write
Schema command
kosmo integrations:schema vegalite.render_vegalite --json
ParameterTypeRequiredDescription
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.