ktm dashboards widget-template

Generate a JSON template for ktm dashboards widget-template widgets like line, counter, and customDisplay charts easily.

Output a widget template JSON to stdout

Usage

ktm dashboards widget-template <type> [flags]

Examples

# Get a line chart template
ktm dashboards widget-template line

# Get a customDisplay template (includes script API docs in _metadata)
ktm dashboards widget-template customDisplay > custom.json

# Save to file for editing
ktm dashboards widget-template counter > widget.json

Arguments

ArgumentRequired
typeYes

Details

Get a ready-to-fill JSON template for a dashboard widget type. Available types: line, area, pie, repartitionChart, counter, title, table, customDisplay.

PREREQUISITE FOR QUERY WIDGETS (all types except title):

  1. ktm metrics query --operator <op> --query 'SHOW MEASUREMENTS'
  2. ktm metrics query --operator <op> --query 'SHOW FIELD KEYS FROM "<measurement>"'
  3. Fill template measurement and field with REAL values from above — placeholders are REJECTED.

The template includes _metadata with grid constraints, schema discovery steps, and (for customDisplay) script API docs with props reference and responseList structure. Strip _metadata before submitting to add-widget.

customDisplay widgets use queries[] (NOT series[]), chartOptions (NOT chart_options), and require an IIFE script. See _metadata.notes for the full script API.

COMPUTATION BOUNDARY: Scripts can do data manipulation, calculations, simple stats, and correlation. They do NOT have access to the platform's statistical engine (EWMA, anomaly detection, SLO burn-rate) — those require MCP/CLI tools or InfluxQL aggregations. Do NOT pre-compute values with CLI tools and hardcode them into the script — widgets are live and re-query when the user changes the time range. Dynamic data must come from queries[].

Global flags (--output, --debug, --host, …) apply to every command. See the command reference overview.

What's next?

All commands

Browse the full CLI reference.

Get started

Install the CLI and authenticate.

Last updated on