AI Setup CLI
An interactive CLI that uses AI agents to automatically instrument projects with Datadog. Instead of manual SDK integration, this tool leverages Claude to detect your project structure, modify your codebase, and set up Datadog products — frontend, backend, infrastructure, AI, security, and CI testing.
Quick Start
Run it interactively — the CLI walks you through sign-in / sign-up, picks a product group, confirms the workspace, and instruments your code:
npx @datadog/ai-setup-cli --site datadoghq.com
Or skip the picker by passing --product:
npx @datadog/ai-setup-cli --site datadoghq.com --product rum
Headless mode
Use --headless for automated runs (CI, agents, scripts). It skips the
interactive UI and requires both --site and --product:
DD_API_KEY=... DD_APP_KEY=... \
npx @datadog/ai-setup-cli \
--headless \
--site datadoghq.com \
--product rum
Set the DD_API_KEY and DD_APP_KEY environment variables (both are
required together), or set DD_ACCESS_TOKEN to a pre-obtained OAuth access
token (for example, the one pup forwards to its extensions). Omit all three
to use browser OAuth, the only step that may need user input. In remote or
fully unattended environments, use the env vars; browser OAuth needs a
localhost callback. Keys and DD_ACCESS_TOKEN cannot be combined.
By using --headless, you confirm that source-code upload and automatic
command execution are authorized for the target project.
Arguments
| Argument | Description | Required | Default |
|---|---|---|---|
--site | Datadog site (see Supported Sites) | Yes | — |
--product | Product to instrument (see Supported Products). Required with --headless; otherwise the CLI shows an interactive picker. | No | — |
--auto-approve | Auto-approve all bash commands without prompting | No | false |
--headless | Run without the interactive terminal UI. Requires --site and --product. Auth via DD_API_KEY / DD_APP_KEY, DD_ACCESS_TOKEN, or browser OAuth. | No | false |
-h, --help | Show help (includes all product-specific flags) | — | — |
Product-specific arguments
Each product can define additional flags in its products/<name>/config.yaml. Pass them as --flag=value. The full set is also printed by --help.
| Product | Flag | Description |
|---|---|---|
rum | --app-id / --rum-application-id | RUM Application ID |
rum | --rum-client-token | RUM client token |
rum | --rum-framework | Framework (e.g. react, browser) |
error-tracking | --app-id | RUM Application ID for Error Tracking |
product-analytics | --app-id | RUM Application ID |
llm-obs | --api-key | Datadog API Key |
llm-obs | --llm-obs-app | LLM application name (DD_LLMOBS_ML_APP) |
infra-monitoring (Kubernetes) | --k8s-products / --enabled-products | Comma-separated products to enable (apm, logs, infrastructure, otel). --enabled-products wins if both are set. |
infra-monitoring | --k8s-distro | gke, eks, minikube, aks, … |
infra-monitoring | --k8s-cluster-name | Cluster name |
infra-monitoring | --k8s-env-name | DD_ENV value |
infra-monitoring | --k8s-library-versions | e.g. java:v1,python:v4,js:v5 |
infra-monitoring | --k8s-target-namespaces | Namespaces to include |
infra-monitoring | --k8s-disabled-namespaces | Namespaces to exclude |
infra-monitoring | --k8s-registry | Override container registry |
docker | --products | Comma-separated products (infra, apm, logs). Default: infra,apm,logs. |
docker | --library-versions | Language tracer/library versions |
docker | --env | DD_ENV value |
linux | --products | Comma-separated products (infra, apm, logs, otel). Default: infra,apm,logs. |
linux | --env | DD_ENV value |
ecs | --ecs-launch-type | ECS launch type (fargate, ec2). Prompts if omitted. |
ecs | --ecs-deployment-method | Deployment method (terraform, cdk, cloudformation, cli). Prompts if omitted. |
serverless | --api-key | Datadog API Key |
serverless | --serverless-compute-type | aws-lambda, gcp-cloud-run, gcp-cloud-run-functions, azure-container-apps (inferred if omitted) |
serverless | --serverless-runtime | nodejs, python, java, ruby, dotnet, go, php (inferred if omitted; php only on Cloud Run/Container Apps) |
serverless | --development-framework | aws-cdk, aws-sam, serverless-framework, terraform, ci, other (inferred if omitted) |
test-optimization | --api-key | Datadog API Key |
ci_code_coverage | --api-key | Datadog API Key |
Environment variables
| Variable | Description | Values |
|---|---|---|
COLOR_THEME | Force light/dark color theme (default: auto-detect via COLORFGBG, falls back to dark) | light, dark |
COLOR_SCHEME | Switch color scheme | datadog (default), high-contrast |
DD_API_KEY | Datadog API key used by --headless; must be set with DD_APP_KEY | API key |
DD_APP_KEY | Datadog application key used by --headless; must be set with DD_API_KEY | Application key |
DD_ACCESS_TOKEN | OAuth access token used by --headless; cannot be combined with DD_API_KEY / DD_APP_KEY | Access token |
AI_SETUP_CLI_PACKAGE_MANAGER | Package manager to use in headless mode when it cannot be detected | npm, yarn, pnpm, bun, expo |
AI_SETUP_CLI_CLAUDE_PERMISSION_MODE | Claude permission mode (defaults to bypassPermissions; use acceptEdits when running as root) | bypassPermissions, acceptEdits |
Supported Sites
| Site | Value |
|---|---|
| US1 | datadoghq.com |
| US3 | us3.datadoghq.com |
| US5 | us5.datadoghq.com |
| EU1 | datadoghq.eu |
| AP1 | ap1.datadoghq.com |
| AP2 | ap2.datadoghq.com |
| UK1 | uk1.datadoghq.com |
Supported Products
Shown in the interactive picker, grouped by category:
| Group | Product | --product value |
|---|---|---|
| Infrastructure (pick one) | Kubernetes | infra-monitoring |
| Infrastructure | Docker | docker |
| Infrastructure | Linux | linux |
| Infrastructure | Serverless | serverless |
| Infrastructure | Amazon ECS | ecs |
| Frontend Monitoring | RUM | rum |
| Frontend Monitoring | Error Tracking | error-tracking |
| Frontend Monitoring | Product Analytics | product-analytics |
| LLM-Based applications | LLM Observability | llm-obs |
| CI Testing | Test Optimization | test-optimization |
| CI Testing | Code Coverage | ci_code_coverage |
Hidden from the picker but installable via --product=<value>:
| Product | --product value |
|---|---|
| App and API Protection | app_and_api_protection |
| OpenTelemetry | otel |
| Studio | studio |