Dashboard Compiler CLI¶
The kb-dashboard-cli CLI tool allows you to compile YAML dashboard configurations to Kibana's NDJSON format and optionally upload them directly to Kibana.
Prerequisites¶
- uv (recommended) - Enables running the CLI via
uvxwith zero setup - Or Python 3.12+ with pip for traditional installation
Note: When using uvx, Python and all dependencies are handled automatically. The VS Code Extension does not require Python either - it includes a bundled binary. See VS Code Extension Documentation for zero-configuration setup.
When to Use the CLI¶
Use the CLI when:
- ✅ Building CI/CD pipelines for dashboard deployment
- ✅ Batch processing multiple dashboards
- ✅ Scripting dashboard generation (e.g., templates, dynamic data)
- ✅ Integrating with other automation tools
- ✅ Running in headless/server environments without GUI
- ✅ Using Docker containers or serverless functions
Use the VS Code Extension when:
- ✅ Developing dashboards interactively
- ✅ Learning the YAML schema
- ✅ Making frequent visual adjustments
- ✅ Needing live preview and validation
See: VS Code Extension Documentation for interactive development workflow.
Installation¶
Using uvx (Recommended)¶
Run the CLI directly without cloning or installing anything:
This downloads and runs the published package automatically. No Python environment setup required!
Development Installation¶
For contributors or development workflows, clone the repository:
See DEVELOPING.md for full development setup.
Basic Usage¶
Compile Dashboards¶
Compile YAML dashboards to NDJSON format:
This will:
- Find all YAML files in
inputs/(by default) - Compile them to Kibana JSON format
- Output NDJSON files to
output/directory - Create individual NDJSON files per scenario
- Create a combined
compiled_dashboards.ndjsonfile
Compile a Single File¶
Compile a specific YAML file without scanning a directory:
When --input-file is provided, --input-dir is ignored.
Export Individual JSON Files¶
For workflows that require one JSON file per dashboard, choose the format based on your target workflow:
# Generic per-dashboard JSON export
uvx kb-dashboard-cli compile --format json --output-dir ./output
# Elastic integrations/Fleet package workflow (recommended for integrations)
uvx kb-dashboard-cli compile --format elastic-integrations --output-dir ./output
Format differences:
--format json: Pretty-printed JSON files named by dashboard ID, with nested saved-object fields (for examplepanelsJSON/optionsJSON) kept as JSON strings.--format elastic-integrations: JSON files named by dashboard ID with nested saved-object fields unwrapped as JSON objects/arrays, matching Elastic integrations packaging expectations.
Migration guidance for Fleet/integration workflows:
- If your pipeline currently uses
--format jsonfor Elastic integrations assets, switch to--format elastic-integrations. --elastic-package-nameis deprecated for filename generation and is ignored with--format elastic-integrations(filenames are dashboard-ID-based).
CI Sync Detection¶
Use the --exit-non-zero-on-change flag to detect when YAML and JSON files are out of sync in CI pipelines:
uvx kb-dashboard-cli compile --format elastic-integrations --output-dir ./dashboards --exit-non-zero-on-change
if [ $? -ne 0 ]; then
echo "Dashboard JSON files are out of sync with YAML sources"
exit 1
fi
When this flag is enabled, the exit code equals the number of files that changed (capped at 125). By default, the command exits with code 0 on success regardless of whether files changed.
Compile and Upload to Kibana¶
Compile dashboards and upload them directly to Kibana:
This will compile the dashboards and upload them to a local Kibana instance.
Screenshot Dashboards¶
Generate a PNG screenshot of a dashboard:
This will use Kibana's Reporting API to take a screenshot.
Export Dashboard for Issue¶
Export a dashboard from Kibana and create a pre-filled GitHub issue:
This will export the dashboard and open your browser with a pre-filled GitHub issue containing the dashboard NDJSON export.
Disassemble Dashboards¶
Break down a Kibana dashboard JSON into components for easier LLM-based conversion:
This will extract the dashboard into separate files:
metadata.json- Dashboard metadata (id, title, description, version)options.json- Dashboard display optionscontrols.json- Control group configurationfilters.json- Dashboard-level filtersreferences.json- Data view referencespanels/- Individual panel JSON files
For a comprehensive guide on using this tool to convert dashboards from JSON to YAML, see the Dashboard Decompiling Guide.
Decompile Dashboards¶
Generate a YAML dashboard stub from Kibana NDJSON output:
This command emits:
- Dashboard metadata (name/id/description where available)
- Panel stubs with
id,title,size, andposition - TODO comments containing original panel JSON for non-trivial manual conversion
Upgrade Legacy YAML Schema¶
Upgrade legacy dashboard YAML from 0.2.7 format to canonical 0.4.0 schema:
Run in check mode (no writes) and fail CI if upgrades are needed:
kb-dashboard upgrade targets 0.2.7 -> 0.4.0 only; 0.3.x compatibility is intentionally not preserved.
Configuration¶
Environment Variables¶
The CLI supports configuration via environment variables:
export KIBANA_URL=http://localhost:5601
export KIBANA_USERNAME=elastic
export KIBANA_PASSWORD=changeme
export KIBANA_SPACE_ID=my-space # Optional: target a specific Kibana space
# OR use API key instead
export KIBANA_API_KEY=your-api-key-here
Then simply run:
Command-Line Options¶
All options can also be specified on the command line:
uvx kb-dashboard-cli compile \
--upload \
--kibana-url http://localhost:5601 \
--kibana-username elastic \
--kibana-password changeme
To upload to a specific Kibana space:
Or with environment variables:
Command Reference¶
The following commands are available in the kb-dashboard-cli CLI. For detailed information about each command and its options, see the auto-generated reference below.
kb-dashboard¶
Kibana Dashboard Compiler - Compile YAML dashboards to Kibana format.
This tool helps you manage Kibana dashboards as code by compiling YAML configurations into Kibana's NDJSON format and optionally uploading them to your Kibana instance.
\b Common workflows: 1. Compile dashboards: kb-dashboard compile 2. Compile and upload: kb-dashboard compile --upload 3. Take a screenshot: kb-dashboard screenshot --dashboard-id ID --output file.png 4. Export for issue: kb-dashboard export-for-issue --dashboard-id ID 5. Disassemble dashboard: kb-dashboard disassemble dashboard.ndjson -o output_dir 6. Decompile dashboard: kb-dashboard decompile dashboard.ndjson -o dashboard.yaml 7. Compare disassembly: kb-dashboard compare original_disassembled compiled_disassembled 8. Upgrade YAML schema: kb-dashboard upgrade --input-dir ./dashboards --write
\b Authentication: Use either username/password OR API key (not both): - Basic auth: --kibana-username USER --kibana-password PASS - API key: --kibana-api-key KEY (recommended for production)
Use environment variables (KIBANA_URL, KIBANA_USERNAME, KIBANA_PASSWORD, KIBANA_API_KEY) to avoid passing credentials on the command line.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--version |
boolean | Show the version and exit. | False |
--loglevel |
choice (DEBUG | INFO | WARNING | ERROR) |
Set logging verbosity level for compilation output. | WARNING |
--help |
boolean | Show this message and exit. | False |
compare¶
Compare two disassembled dashboard directories for panel count/type mismatches.
ORIGINAL_DIR and COMPILED_DIR should each be output from kb-dashboard disassemble.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
compile¶
Compile YAML dashboard configurations to NDJSON format.
This command finds all YAML files in the input directory (or compiles a single file provided via --input-file), compiles them to Kibana's JSON format, and outputs them as NDJSON files.
Optionally, you can upload the compiled dashboards directly to Kibana using the --upload flag.
The --format option controls output format: - ndjson (default): Groups dashboards by directory into NDJSON files - json: Creates individual pretty-printed JSON files named by dashboard ID - elastic-integrations: Creates individual JSON files with nested saved-object JSON fields unwrapped
By default, the command exits with code 0 on success. Use --exit-non-zero-on-change to enable CI sync detection mode, where the exit code equals the number of files that changed (capped at 125).
\b Examples: # Compile dashboards from default directory kb-dashboard compile
# Compile a single dashboard file
kb-dashboard compile --input-file ./dashboards/example.yaml
# Compile with custom input and output directories
kb-dashboard compile --input-dir ./dashboards --output-dir ./output
# Compile to individual JSON files per dashboard
kb-dashboard compile --format json --output-dir ./output
# Compile and upload to Kibana using basic auth
kb-dashboard compile --upload --kibana-url https://kibana.example.com \
--kibana-username admin --kibana-password secret
# Compile and upload using API key (recommended)
kb-dashboard compile --upload --kibana-url https://kibana.example.com \
--kibana-api-key "your-api-key-here"
# Use environment variables for credentials
export KIBANA_URL=https://kibana.example.com
export KIBANA_API_KEY=your-api-key
kb-dashboard compile --upload
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--input-dir |
directory | Directory containing YAML dashboard files to compile. | /home/runner/work/kb-yaml-to-lens/kb-yaml-to-lens/packages/kb-dashboard-cli/inputs |
--input-file |
file | Path to a single YAML dashboard file to compile. When provided, --input-dir is ignored. | None |
--output-dir |
directory | Directory where compiled NDJSON files will be written. | /home/runner/work/kb-yaml-to-lens/kb-yaml-to-lens/packages/kb-dashboard-cli/output |
--output-file |
text | Filename for the combined output NDJSON file containing all dashboards. | compiled_dashboards.ndjson |
--format |
choice (ndjson | json | elastic-integrations) |
Output format: "ndjson" for combined files (default), "json" for individual pretty-printed files named by dashboard ID, or "elastic-integrations" for individual JSON files with unwrapped nested JSON fields (panelsJSON/optionsJSON/etc). | ndjson |
--elastic-package-name |
text | Deprecated for filename generation. elastic-integrations output filenames are now based on dashboard IDs. | None |
--upload |
boolean | Upload compiled dashboards to Kibana immediately after compilation. | False |
--kibana-url |
text | Kibana base URL. Example: https://kibana.example.com (env: KIBANA_URL) | http://localhost:5601 |
--kibana-username |
text | Kibana username for basic authentication. Must be used with --kibana-password. Mutually exclusive with --kibana-api-key. (env: KIBANA_USERNAME) | Sentinel.UNSET |
--kibana-password |
text | Kibana password for basic authentication. Must be used with --kibana-username. Mutually exclusive with --kibana-api-key. (env: KIBANA_PASSWORD) | Sentinel.UNSET |
--kibana-api-key |
text | Kibana API key for authentication (recommended for production). Mutually exclusive with --kibana-username/--kibana-password. (env: KIBANA_API_KEY) | Sentinel.UNSET |
--kibana-space-id |
text | Kibana space ID to upload dashboards to. If not specified, uses the default space. (env: KIBANA_SPACE_ID) | Sentinel.UNSET |
--kibana-no-ssl-verify |
boolean | Disable SSL certificate verification (useful for self-signed certificates in local development). | False |
--no-browser |
boolean | Prevent browser from opening automatically after successful upload. | False |
--overwrite / --no-overwrite |
boolean | Whether to overwrite existing dashboards in Kibana (default: overwrite). | True |
--exit-non-zero-on-change |
boolean | Exit with non-zero code when files change (useful for CI sync detection). | False |
--help |
boolean | Show this message and exit. | False |
decompile¶
Decompile a Kibana dashboard NDJSON file into YAML stubs.
This command generates a YAML dashboard skeleton from a Kibana dashboard NDJSON export. It preserves panel structure (types, size, position, title) and adds TODO comments with original panel JSON where manual conversion is still required.
\b Examples: # Decompile a dashboard NDJSON file to YAML kb-dashboard decompile dashboard.ndjson -o dashboard.yaml
# Read from stdin
cat dashboard.ndjson | kb-dashboard decompile -o dashboard.yaml
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-o, --output |
path | Output YAML file path for decompiled dashboard stubs. | Sentinel.UNSET |
--help |
boolean | Show this message and exit. | False |
disassemble¶
Disassemble a Kibana dashboard NDJSON file into components.
This command breaks down a Kibana dashboard JSON file (in NDJSON format) into separate files for easier processing by LLMs. This enables incremental conversion of large dashboards to YAML format.
The dashboard is split into: - metadata.json: Dashboard metadata - options.json: Dashboard display options - controls.json: Dashboard control group configuration - filters.json: Dashboard-level filters - references.json: Data view and index pattern references - panels/: Directory containing individual panel JSON files
\b Examples: # Disassemble a dashboard NDJSON file kb-dashboard disassemble dashboard.ndjson -o output_dir
# Read from stdin
cat dashboard.ndjson | kb-dashboard disassemble -o output_dir
# Download and disassemble directly
curl -u user:pass http://localhost:5601/api/saved_objects/dashboard/my-id | \
kb-dashboard disassemble -o output_dir
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-o, --output |
path | Output directory for component files. | Sentinel.UNSET |
--help |
boolean | Show this message and exit. | False |
docs¶
Access bundled LLM documentation.
\b Examples: kb-dashboard docs list-guides # List available guides kb-dashboard docs llms-full # Output full documentation kb-dashboard docs llms-full | pbcopy # Copy to clipboard (macOS) kb-dashboard docs guide otel-dashboard-guide # Get specific guide
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
guide¶
Output a specific workflow guide.
NAME is the guide name (with or without .md extension).
\b Examples: kb-dashboard docs guide otel-dashboard-guide kb-dashboard docs guide breaking-changes kb-dashboard docs guide esql-language-reference kb-dashboard docs guide dashboard-style-guide
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
list-guides¶
List available workflow guides.
Displays names of bundled guides that can be accessed with the 'guide' subcommand.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
llms-full¶
Output bundled llms-full documentation content.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
export-for-issue¶
Export a dashboard from Kibana and create a pre-filled GitHub issue.
This command downloads a dashboard export (NDJSON) from Kibana and generates a GitHub issue URL with the dashboard NDJSON pre-filled in the body. You can then submit the issue to request support for compiling the dashboard from YAML.
\b Examples: # Export dashboard and open pre-filled issue in browser kb-dashboard export-for-issue --dashboard-id my-dashboard-id
# Export with API key authentication
kb-dashboard export-for-issue --dashboard-id my-dashboard-id \
--kibana-api-key "your-api-key"
# Export and print URL without opening browser
kb-dashboard export-for-issue --dashboard-id my-dashboard-id --no-browser
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--dashboard-id |
text | Kibana dashboard ID to export. Find this in the dashboard URL. | Sentinel.UNSET |
--kibana-url |
text | Kibana base URL. Example: https://kibana.example.com (env: KIBANA_URL) | http://localhost:5601 |
--kibana-username |
text | Kibana username for basic authentication. Must be used with --kibana-password. Mutually exclusive with --kibana-api-key. (env: KIBANA_USERNAME) | Sentinel.UNSET |
--kibana-password |
text | Kibana password for basic authentication. Must be used with --kibana-username. Mutually exclusive with --kibana-api-key. (env: KIBANA_PASSWORD) | Sentinel.UNSET |
--kibana-api-key |
text | Kibana API key for authentication (recommended for production). Mutually exclusive with --kibana-username/--kibana-password. (env: KIBANA_API_KEY) | Sentinel.UNSET |
--kibana-space-id |
text | Kibana space ID to upload dashboards to. If not specified, uses the default space. (env: KIBANA_SPACE_ID) | Sentinel.UNSET |
--kibana-no-ssl-verify |
boolean | Disable SSL certificate verification (useful for self-signed certificates in local development). | False |
--no-browser |
boolean | Do not open browser automatically with pre-filled issue. | False |
--help |
boolean | Show this message and exit. | False |
extract-sample-data¶
Extract data from Elasticsearch to NDJSON format.
This command queries Elasticsearch and exports the results to an NDJSON file that can be used as sample data for dashboards. Each line in the output file is a separate JSON document.
\b Examples: # Extract logs data kb-dashboard extract-sample-data --index logs-* --output sample-logs.ndjson
# Extract with custom query
kb-dashboard extract-sample-data --index metrics-* --output sample-metrics.ndjson \
--query 'host.name:server01'
# Extract limited number of documents
kb-dashboard extract-sample-data --index logs-* --output sample.ndjson --max-docs 100
# With authentication
kb-dashboard extract-sample-data --index logs-* --output sample.ndjson \
--es-url https://es.example.com --es-api-key "your-api-key"
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--index |
text | Elasticsearch index pattern to extract data from (e.g., logs-, metrics-). | Sentinel.UNSET |
--output |
path | Path where the NDJSON file will be saved. | Sentinel.UNSET |
--query |
text | Elasticsearch query to filter documents (default: * for all documents). | * |
--max-docs |
integer | Maximum number of documents to extract (default: 1000). | 1000 |
--es-url |
text | Elasticsearch base URL. Example: https://elasticsearch.example.com (env: ELASTICSEARCH_URL) | http://localhost:9200 |
--es-username |
text | Elasticsearch username for basic authentication (env: ELASTICSEARCH_USERNAME) | Sentinel.UNSET |
--es-password |
text | Elasticsearch password for basic authentication (env: ELASTICSEARCH_PASSWORD) | Sentinel.UNSET |
--es-api-key |
text | Elasticsearch API key for authentication (env: ELASTICSEARCH_API_KEY) | Sentinel.UNSET |
--es-no-ssl-verify |
boolean | Disable SSL certificate verification for Elasticsearch connections. | False |
--help |
boolean | Show this message and exit. | False |
fetch¶
Fetch a dashboard from Kibana and save it to a file.
This command retrieves a dashboard's NDJSON from Kibana using a dashboard URL or ID. The dashboard and all its dependent objects (panels, data views) are exported and saved to the specified output file.
URL_OR_ID can be: - A Kibana dashboard URL (e.g., https://kibana.example.com/app/dashboards#/view/my-id) - A plain dashboard ID (e.g., my-dashboard-id)
\b Examples: # Fetch using dashboard URL kb-dashboard fetch "https://kibana.example.com/app/dashboards#/view/my-id" \ --output dashboard.ndjson
# Fetch using plain dashboard ID
kb-dashboard fetch my-dashboard-id --output dashboard.ndjson
# Fetch with API key authentication
kb-dashboard fetch my-dashboard-id --output dashboard.ndjson \
--kibana-api-key "your-api-key"
# Fetch from specific space
kb-dashboard fetch my-dashboard-id --output dashboard.ndjson \
--kibana-space-id "my-space"
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
-o, --output |
path | Output file path for the dashboard NDJSON. | Sentinel.UNSET |
--kibana-url |
text | Kibana base URL. Example: https://kibana.example.com (env: KIBANA_URL) | http://localhost:5601 |
--kibana-username |
text | Kibana username for basic authentication. Must be used with --kibana-password. Mutually exclusive with --kibana-api-key. (env: KIBANA_USERNAME) | Sentinel.UNSET |
--kibana-password |
text | Kibana password for basic authentication. Must be used with --kibana-username. Mutually exclusive with --kibana-api-key. (env: KIBANA_PASSWORD) | Sentinel.UNSET |
--kibana-api-key |
text | Kibana API key for authentication (recommended for production). Mutually exclusive with --kibana-username/--kibana-password. (env: KIBANA_API_KEY) | Sentinel.UNSET |
--kibana-space-id |
text | Kibana space ID to upload dashboards to. If not specified, uses the default space. (env: KIBANA_SPACE_ID) | Sentinel.UNSET |
--kibana-no-ssl-verify |
boolean | Disable SSL certificate verification (useful for self-signed certificates in local development). | False |
--help |
boolean | Show this message and exit. | False |
load-sample-data¶
Load sample data bundled with dashboards into Elasticsearch via Kibana.
This command scans the input directory for YAML dashboard configurations that include sample data, and loads that data into Elasticsearch through Kibana's console proxy API. The sample data will be automatically transformed so the maximum timestamp becomes "now", making the data appear as if it just happened.
\b Examples: # Load sample data from default directory kb-dashboard load-sample-data
# Load with custom input directory
kb-dashboard load-sample-data --input-dir ./dashboards
# Load with Kibana authentication
kb-dashboard load-sample-data --kibana-url https://kibana.example.com \
--kibana-username admin --kibana-password secret
# Use API key (recommended)
kb-dashboard load-sample-data --kibana-url https://kibana.example.com \
--kibana-api-key "your-api-key-here"
# Load to a specific Kibana space
kb-dashboard load-sample-data --kibana-url https://kibana.example.com \
--kibana-api-key "your-api-key" --kibana-space-id "my-space"
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--input-dir |
directory | Directory containing YAML dashboard files with sample data. | None |
--kibana-url |
text | Kibana base URL. Example: https://kibana.example.com (env: KIBANA_URL) | http://localhost:5601 |
--kibana-username |
text | Kibana username for basic authentication. Must be used with --kibana-password. Mutually exclusive with --kibana-api-key. (env: KIBANA_USERNAME) | Sentinel.UNSET |
--kibana-password |
text | Kibana password for basic authentication. Must be used with --kibana-username. Mutually exclusive with --kibana-api-key. (env: KIBANA_PASSWORD) | Sentinel.UNSET |
--kibana-api-key |
text | Kibana API key for authentication (recommended for production). Mutually exclusive with --kibana-username/--kibana-password. (env: KIBANA_API_KEY) | Sentinel.UNSET |
--kibana-space-id |
text | Kibana space ID to upload dashboards to. If not specified, uses the default space. (env: KIBANA_SPACE_ID) | Sentinel.UNSET |
--kibana-no-ssl-verify |
boolean | Disable SSL certificate verification (useful for self-signed certificates in local development). | False |
--help |
boolean | Show this message and exit. | False |
lsp¶
Start the Language Server Protocol (LSP) server for IDE integration.
The LSP server provides real-time compilation, validation, and code completion for YAML dashboard files in supported IDEs like VS Code.
This server communicates via stdin/stdout using the Language Server Protocol specification.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |
screenshot¶
Generate a PNG screenshot of a Kibana dashboard.
This command uses Kibana's Reporting API to generate a screenshot of the specified dashboard. You can optionally specify a time range for the dashboard data.
Examples: # Screenshot with default settings kb-dashboard screenshot --dashboard-id my-dashboard --output dashboard.png
# Screenshot with custom time range
kb-dashboard screenshot --dashboard-id my-dashboard --output dashboard.png \
--time-from "2024-01-01T00:00:00Z" --time-to "2024-12-31T23:59:59Z"
# Screenshot with relative time range
kb-dashboard screenshot --dashboard-id my-dashboard --output dashboard.png \
--time-from "now-7d" --time-to "now"
# Screenshot with custom dimensions
kb-dashboard screenshot --dashboard-id my-dashboard --output dashboard.png \
--width 3840 --height 2160
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--dashboard-id |
text | Kibana dashboard ID to capture. Find this in the dashboard URL. | Sentinel.UNSET |
--output |
path | Path where the PNG screenshot will be saved. Example: ./dashboard.png | Sentinel.UNSET |
--time-from |
text | Start time for dashboard data range. Accepts ISO 8601 format ("2024-01-01T00:00:00Z") or relative time ("now-7d", "now-24h", "now-1M"). If omitted, uses dashboard default. | Sentinel.UNSET |
--time-to |
text | End time for dashboard data range. Accepts ISO 8601 format ("2024-12-31T23:59:59Z") or relative time ("now", "now-1h"). If omitted, uses dashboard default. | Sentinel.UNSET |
--width |
integer range (1 and above) |
Screenshot width in pixels. Standard resolutions: 1920 (Full HD), 3840 (4K). Default: 1920 | 1920 |
--height |
integer range (1 and above) |
Screenshot height in pixels. Standard resolutions: 1080 (Full HD), 2160 (4K). Default: 1080 | 1080 |
--browser-timezone |
text | Browser timezone for rendering time-based data. Examples: "UTC", "America/New_York", "Europe/London". Default: UTC | UTC |
--timeout |
integer range (1 and above) |
Maximum time in seconds to wait for screenshot generation. Increase for complex dashboards. Default: 300 | 300 |
--kibana-url |
text | Kibana base URL. Example: https://kibana.example.com (env: KIBANA_URL) | http://localhost:5601 |
--kibana-username |
text | Kibana username for basic authentication. Must be used with --kibana-password. Mutually exclusive with --kibana-api-key. (env: KIBANA_USERNAME) | Sentinel.UNSET |
--kibana-password |
text | Kibana password for basic authentication. Must be used with --kibana-username. Mutually exclusive with --kibana-api-key. (env: KIBANA_PASSWORD) | Sentinel.UNSET |
--kibana-api-key |
text | Kibana API key for authentication (recommended for production). Mutually exclusive with --kibana-username/--kibana-password. (env: KIBANA_API_KEY) | Sentinel.UNSET |
--kibana-space-id |
text | Kibana space ID to upload dashboards to. If not specified, uses the default space. (env: KIBANA_SPACE_ID) | Sentinel.UNSET |
--kibana-no-ssl-verify |
boolean | Disable SSL certificate verification (useful for self-signed certificates in local development). | False |
--help |
boolean | Show this message and exit. | False |
upgrade¶
Upgrade dashboard YAML schema from 0.2.7 to 0.4.0.
This command only targets the 0.2.7 -> 0.4.0 migration path. 0.3.x compatibility is intentionally not preserved.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--input-dir |
directory | Directory containing dashboard YAML files. | inputs |
--input-file |
file | Single YAML dashboard file to upgrade. When provided, --input-dir is ignored. | None |
--write |
boolean | Write changes in-place. Without this flag, runs in check mode. | False |
--fail-on-change |
boolean | Exit with non-zero status if upgrades are needed. | False |
--help |
boolean | Show this message and exit. | False |
Justfile Shortcuts (Development)¶
For contributors working from a cloned repository, the project includes convenient justfile targets:
# Compile only
just cli compile
# Compile and upload (uses environment variables for Kibana config)
just cli upload
See DEVELOPING.md for the full development workflow.
Authentication¶
The CLI supports two authentication methods:
Basic Authentication¶
Use username and password:
Or via environment variables:
export KIBANA_USERNAME=elastic
export KIBANA_PASSWORD=changeme
uvx kb-dashboard-cli compile --upload
API Key Authentication¶
Use a Kibana API key:
Or via environment variable:
To create an API key in Kibana:
- Go to Stack Management → API Keys
- Click "Create API key"
- Give it a name and set appropriate privileges
- Copy the encoded key and use it with the CLI
Troubleshooting¶
Connection Refused¶
If you get a connection refused error:
- Verify Kibana is running:
curl http://localhost:5601/api/status - Check the Kibana URL is correct
- Ensure there are no firewall rules blocking the connection
Authentication Failed¶
If you get authentication errors:
- Verify your credentials are correct
- Check that the user has appropriate permissions
- For API keys, ensure the key hasn't expired
Upload Errors¶
If objects fail to upload:
- Check the Kibana logs for detailed error messages
- Verify the NDJSON format is valid
- Use
--no-overwriteif you want to preserve existing objects
Dashboard Linter CLI¶
The kb-dashboard-lint CLI tool checks YAML dashboard configurations for best practices and common issues.
Basic Usage¶
Check a single dashboard file:
Check all dashboards in a directory:
Severity Levels¶
The linter reports issues at three severity levels:
| Level | Description |
|---|---|
| error | Critical issues that should be fixed |
| warning | Problems that may affect usability |
| info | Suggestions for improvement |
By default, the linter exits with code 0 for info-only results. Use --severity-threshold to fail on warnings:
List Available Rules¶
See all lint rules and their descriptions:
Configuration¶
Create a .dashboard-lint.yaml file to customize rule behavior:
Output Formats¶
Get machine-readable output for CI integration:
Linter Command Reference¶
kb-dashboard-lint¶
Dashboard Linter - Check YAML dashboards for best practices.
This tool analyzes dashboard configurations and flags potentially problematic patterns based on configurable rules.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--version |
boolean | Show the version and exit. | False |
--help |
boolean | Show this message and exit. | False |
check¶
Check dashboard YAML files for issues.
Examples: kb-dashboard-lint check --input-dir ./inputs
kb-dashboard-lint check --input-file dashboard.yaml
kb-dashboard-lint check --config .dashboard-lint.yaml
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--input-dir |
directory | Directory containing YAML dashboard files. | None |
--input-file |
file | Single YAML file to check. | None |
--config |
file | Path to lint configuration file. | None |
--severity-threshold |
choice (error | warning | info) |
Exit non-zero if violations at this severity or higher are found. | warning |
--format |
choice (text | json) |
Output format. | text |
--help |
boolean | Show this message and exit. | False |
list-rules¶
List all available lint rules.
Usage:
Options:
| Name | Type | Description | Default |
|---|---|---|---|
--help |
boolean | Show this message and exit. | False |