agent-dd

Datadog triage CLI for AI agents

Language
Go
Version
0.20.1
License
PolyForm Perimeter 1.0.0
Category
CLI Tool

A Datadog CLI shaped around investigation rather than administration — monitors, logs, metrics, traces, events, hosts, incidents and SLOs — plus the hardening that follows: creating and retuning monitors once you know what broke. A surface limited to what matters during triage, with classified errors so an agent can self-correct.

Features

01

Triage-shaped, not admin-shaped — the commands an investigation needs, not 200+ Datadog API endpoints

02

NDJSON everywhere by default — one object per line for lists, one line per id for gets; --format json|yaml overrides

03

Compact and null-pruned by default — monitors come back as id, name, status, type until you ask for --full

04

Errors classify themselves — fixable_by: agent means fix your parameters, human means stop and ask, retry means wait

05

Item-level misses do not lose the batch — an unresolvable id becomes an @unresolved line on stdout with exit 0

06

Monitor updates are surgical — it reads the monitor, layers your changes on and writes the whole definition back, so restricted_roles, composite sub-monitors and unmodelled options survive untouched

07

Every update reports its own diff — a changes map of exactly which fields moved, and from what to what

08

--dry-run validates against Datadog without creating anything

09

--body escape hatch — pass a whole monitor definition as inline JSON, @file or @- for options with no dedicated flag

10

Secrets stay off argv — --form uses a native OS dialog, or pipe both keys on stdin, one per line

11

Multi-org — several Datadog organizations and sites side by side, selected with --org

12

Flexible time — relative (now-15m), RFC3339 or unix epoch, on every --from and --to

13

Runs as an MCP server over stdio or HTTP, and ships a mock Datadog API for testing without an account

Install

Homebrew

>_
$ brew install shhac/tap/agent-dd

AI Agent Skill

>_
$ npx skills add shhac/agent-skills --skill agent-dd --global

GitHub Release (macOS)

>_
$ curl -L https://github.com/shhac/agent-dd/releases/latest/download/agent-dd-darwin-arm64.tar.gz | tar xz

Go Install

>_
$ go install github.com/shhac/agent-dd/cmd/agent-dd@latest

Build from Source

>_
$ git clone https://github.com/shhac/agent-dd.git && cd agent-dd && make build

Getting Started

agent-dd needs a Datadog API key and application key. Both are secrets, so keep them off the command line — they would otherwise land in shell history, ps, and any agent transcript.

01 · Add an organization without the keys touching argv

>_
$ agent-dd org add prod --form --site datadoghq.com

--form types the keys into a native OS dialog, so the agent driving the CLI never sees them. It needs a graphical session and fails cleanly with fixable_by=human over SSH.

02 · Or pipe them, for CI

>_
$ printf '%s\n%s' "$DD_API_KEY" "$DD_APP_KEY" | agent-dd org add prod --site datadoghq.com

API key first, app key second. stdin is read only when neither key was passed as a flag. DD_API_KEY and DD_APP_KEY also work directly, with no setup at all.

03 · Test the connection

>_
$ agent-dd org test

Add a second org for another region with --site datadoghq.eu, then select it per command with --org eu.

04 · See what is alerting

>_
$ agent-dd monitors list --status alert

Compact NDJSON by default. agent-dd usage prints the reference card; each domain has its own usage page.

Usage

>_ What is firing right now
$ agent-dd monitors list --status alert
>_ Errors for one service, last 15 minutes
$ agent-dd logs search --query "service:web-api status:error" --from now-15m
>_ Which facets dominate the errors
$ agent-dd logs facets --query "status:error" --from now-1h
>_ Slow requests in traces
$ agent-dd traces search --service web-api --query "@duration:>1000000000" --from now-30m
>_ Validate a new monitor without creating it
$ agent-dd monitors create --type "metric alert" --query 'avg(last_5m):avg:system.cpu.user{service:web-api} > 90' --name "CPU high on web-api" --dry-run
>_ Retune a monitor that misfired
$ agent-dd monitors update 12345 --threshold-critical 95
>_ Error budget burn
$ agent-dd slo history SLO_ID --from now-7d
>_ Raw Datadog request, unwrapped
$ agent-dd api get /api/v1/dashboard