KosmoKrator

monitoring

Datadog CLI for Shell Scripts

Use the Datadog CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.

10 functions 6 read 4 write API key auth

Datadog CLI for Shell Scripts

Call integration functions from shell scripts with stable JSON input and output.

Use shell scripts for small local automations that need one or more integration calls. The Datadog CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.

Command Shape

# Datadog CLI for Shell Scripts
kosmokrator integrations:configure datadog --set api_key="$DATADOG_API_KEY" --set app_key="$DATADOG_APP_KEY" --enable --read allow --write ask --json
kosmo integrations:call datadog.datadog_list_monitors '{"name":"example_name","tags":"example_tags","page":1,"page_size":1}' --json

Discovery Before Execution

Agents and scripts can inspect Datadog docs and schemas before choosing a function.

kosmo integrations:docs datadog --json
kosmo integrations:docs datadog.datadog_list_monitors --json
kosmo integrations:schema datadog.datadog_list_monitors --json
kosmo integrations:search "Datadog" --json
kosmo integrations:list --json

Useful Datadog CLI Functions

FunctionTypeParametersDescription
datadog.datadog_list_monitors Read name, tags, page, page_size List Datadog monitors. Optionally filter by name or tags. Returns monitor IDs, names, types, states, and query definitions.
datadog.datadog_get_monitor Read monitor_id Get full details of a specific Datadog monitor by ID. Returns the monitor query, thresholds, message, and current state.
datadog.datadog_create_monitor Write type, query, name, message, priority, options, tags Create a new Datadog monitor. Specify the monitor type, query, name, and optional message and thresholds. Common types: "metric alert", "service check", "event alert".
datadog.datadog_update_monitor Write monitor_id, type, query, name, message, priority, options, tags Update an existing Datadog monitor. Provide the monitor ID and the fields to update (name, query, message, options, tags, etc.).
datadog.datadog_delete_monitor Write monitor_id Delete a Datadog monitor by ID. This action is permanent and cannot be undone.
datadog.datadog_query_metrics Read from, to, query Query Datadog metrics between two timestamps. Use Datadog query syntax (e.g., "avg:system.cpu.user{env:production} by {host}"). Returns time series data points.
datadog.datadog_list_dashboards Read none List all Datadog dashboards. Returns dashboard IDs, titles, descriptions, and modification dates.
datadog.datadog_get_dashboard Read dashboard_id Get full details of a specific Datadog dashboard by ID. Returns the dashboard layout, widgets, and template variables.
datadog.datadog_post_event Write title, text, priority, tags, alert_type, date_happened, source_type_name, host, aggregation_key Post an event to the Datadog event stream. Specify title, text, priority, tags, and alert type. Events appear in the event timeline.
datadog.datadog_get_current_user Read none Get the currently authenticated Datadog user. Useful for verifying credentials and identifying the connected account.

Automation Notes

Related Datadog CLI Pages