{"_id":"@leoflores/datadog-cli","_rev":"2-6531ed0dd2c7fa830af1c0be71569251","name":"@leoflores/datadog-cli","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"@leoflores/datadog-cli","version":"0.1.0","keywords":["datadog","cli","logs","metrics","debugging","observability"],"author":{"name":"Leonardo Flores"},"license":"MIT","_id":"@leoflores/datadog-cli@0.1.0","maintainers":[{"name":"leoflores","email":"leofcouy@gmail.com"}],"homepage":"https://github.com/leonardocouy/datadog-cli#readme","bugs":{"url":"https://github.com/leonardocouy/datadog-cli/issues"},"bin":{"datadog":"cli.ts"},"dist":{"shasum":"08ab354388a3b743cb2e5289adb9c3f7af2d6803","tarball":"https://registry.npmjs.org/@leoflores/datadog-cli/-/datadog-cli-0.1.0.tgz","fileCount":10,"integrity":"sha512-Q2Fh7Ua4liy8Y6Xyc9yjgYNXqzhfAmwDBnDtQGsYYTb1jNm51cJY66FAxEVSQAb+VEEGGmoT4PNYo0MHcGbqiA==","signatures":[{"sig":"MEYCIQCZxuus2JmRdKpduWMcGLGjldMabbQAmwZKcj4a6JybZgIhAOqUnL3g3X0+McZHKP7WRzSMLEeeM/nvNWq4Wj+IRNez","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79017},"main":"cli.ts","type":"module","module":"cli.ts","engines":{"bun":">=1.0.0"},"gitHead":"fb544174eabe32cd516b5a43eb0b5d4dc33cb523","scripts":{"dev":"bun --watch cli.ts","lint":"biome lint .","build":"bun build --compile ./cli.ts --outfile dist/datadog","check":"biome check --write .","start":"bun run cli.ts","format":"biome format --write ."},"_npmUser":{"name":"leoflores","email":"leofcouy@gmail.com"},"repository":{"url":"git+https://github.com/leonardocouy/datadog-cli.git","type":"git"},"_npmVersion":"10.9.2","description":"A powerful command-line interface for querying Datadog logs and metrics, designed for fast debugging and incident triage","directories":{},"_nodeVersion":"22.13.1","dependencies":{"@datadog/datadog-api-client":"^1.49.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@biomejs/biome":"^2.3.10"},"_npmOperationalInternal":{"tmp":"tmp/datadog-cli_0.1.0_1766434004215_0.8218764090151531","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@leoflores/datadog-cli","version":"1.1.0","description":"A powerful command-line interface for querying Datadog logs and metrics, designed for fast debugging and incident triage","author":{"name":"Leonardo Flores"},"license":"MIT","main":"cli.ts","module":"cli.ts","type":"module","publishConfig":{"access":"public"},"bin":{"datadog":"cli.ts"},"scripts":{"start":"bun run cli.ts","dev":"bun --watch cli.ts","build":"bun build --compile ./cli.ts --outfile dist/datadog","lint":"biome lint .","format":"biome format --write .","format:check":"biome format .","check":"biome check --write .","check:ci":"biome check ."},"keywords":["datadog","cli","logs","metrics","debugging","observability"],"repository":{"type":"git","url":"git+https://github.com/leonardocouy/datadog-cli.git"},"engines":{"bun":">=1.0.0"},"devDependencies":{"@biomejs/biome":"^2.3.10","@types/bun":"latest"},"dependencies":{"@datadog/datadog-api-client":"^1.49.0"},"gitHead":"09c797f11686c1a0b51a92b27eb9c361bc8f49e0","_id":"@leoflores/datadog-cli@1.1.0","bugs":{"url":"https://github.com/leonardocouy/datadog-cli/issues"},"homepage":"https://github.com/leonardocouy/datadog-cli#readme","_nodeVersion":"22.21.1","_npmVersion":"11.7.0","dist":{"integrity":"sha512-nkA0IxQ+h3BSOObPhH3i9ibMmLL98DnLTQIaJT/4pwAHusv4F/bLDXLcOwH3i5hbDkOkasX3ipnnR4gfpvKThg==","shasum":"f670a6bb70b09b7314d499ab917caa99e9fc8844","tarball":"https://registry.npmjs.org/@leoflores/datadog-cli/-/datadog-cli-1.1.0.tgz","fileCount":10,"unpackedSize":81328,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@leoflores%2fdatadog-cli@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBMHZ3zQWhq8D4/YsXavuGYib/NlKtyMa2dxPU4cpydhAiEAnHhgbuQbC0XtNjW7ka/mmi1dIrHaed70SrtqjQhPzh4="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:605b48df-54c5-42c9-87ba-1f0b90aa44ba"}},"directories":{},"maintainers":[{"name":"leoflores","email":"leofcouy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/datadog-cli_1.1.0_1766439683645_0.5841683698167042"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-22T20:06:44.106Z","modified":"2025-12-22T21:41:24.268Z","0.1.0":"2025-12-22T20:06:44.356Z","1.1.0":"2025-12-22T21:41:23.848Z"},"bugs":{"url":"https://github.com/leonardocouy/datadog-cli/issues"},"author":{"name":"Leonardo Flores"},"license":"MIT","homepage":"https://github.com/leonardocouy/datadog-cli#readme","keywords":["datadog","cli","logs","metrics","debugging","observability"],"repository":{"type":"git","url":"git+https://github.com/leonardocouy/datadog-cli.git"},"description":"A powerful command-line interface for querying Datadog logs and metrics, designed for fast debugging and incident triage","maintainers":[{"name":"leoflores","email":"leofcouy@gmail.com"}],"readme":"# datadog-cli\n\nA command-line interface for querying Datadog logs and metrics, built for fast debugging and incident triage.\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![npm version](https://img.shields.io/npm/v/@leoflores/datadog-cli)](https://www.npmjs.com/package/@leoflores/datadog-cli)\n\n## About\n\nBuilt so AI assistants (Claude, Cursor, etc.) can help investigate production issues directly from the terminal. Search logs, trace requests, compare error rates, and analyze patterns without leaving your workflow.\n\n---\n\n> **Using Claude Code?** Install the plugin and let Claude debug with Datadog for you:\n> ```bash\n> claude /plugin marketplace add leonardocouy/cc-datadog\n> claude /plugin install datadog@cc-datadog\n> ```\n> Then just ask: *\"search for errors in the last hour\"* or *\"what's causing the 500s?\"*\n\n---\n\n## Features\n\n- **Log Search** - Search, filter, and aggregate logs with Datadog query syntax\n- **Live Tail** - Stream logs in real-time as they arrive\n- **Trace Correlation** - Find all logs for a distributed trace across services\n- **Context View** - See logs before/after a specific event\n- **Error Summary** - Quick breakdown of errors by service, type, and message\n- **Period Comparison** - Compare log volumes between time periods\n- **Pattern Detection** - Group similar log messages automatically\n- **Metrics Query** - Query timeseries metrics\n- **Dashboards** - List, fetch, create, update, and delete dashboards\n- **Dashboard Lists** - Manage dashboard lists and membership\n- **Pretty Output** - Color-coded, human-readable formatting\n\n## Installation\n\nRun directly without installing:\n\n```bash\nnpx @leoflores/datadog-cli <command>\n# or\nbunx @leoflores/datadog-cli <command>\n```\n\nOr install globally:\n\n```bash\nnpm install -g @leoflores/datadog-cli\n```\n\n### Requirements\n\n- [Bun](https://bun.sh) >= 1.0.0 (for local development)\n- Datadog API key and Application key\n\n## Setup\n\nSet your Datadog API credentials:\n\n```bash\nexport DD_API_KEY=\"your-api-key\"\nexport DD_APP_KEY=\"your-app-key\"\n```\n\nGet keys from: https://app.datadoghq.com/organization-settings/api-keys\n\nFor EU or other sites, use the `--site` flag:\n\n```bash\ndatadog logs search --query \"*\" --site datadoghq.eu\n```\n\n## Usage\n\n```bash\ndatadog <command> [subcommand] [flags]\n```\n\n### Quick Examples\n\n```bash\n# Search errors in the last hour\ndatadog logs search --query \"status:error\" --from 1h --pretty\n\n# Stream logs in real-time\ndatadog logs tail --query \"service:api\" --pretty\n\n# Get error summary\ndatadog errors --from 1h --pretty\n\n# Compare error rates\ndatadog logs compare --query \"status:error\" --period 1h --pretty\n\n# List dashboards\ndatadog dashboards list --count 25 --pretty\n\n# List dashboard lists\ndatadog dashboard-lists list --pretty\n```\n\n## Commands\n\n### Log Search & Exploration\n\n```bash\ndatadog logs search --query \"status:error\" --from 1h --pretty\ndatadog logs agg --query \"service:api\" --facet status --from 24h --pretty\n```\n\n### Real-time Debugging\n\n```bash\n# Live tail\ndatadog logs tail --query \"service:api status:error\" --pretty\n\n# Trace correlation\ndatadog logs trace --id \"abc123def456\" --pretty\n\n# Context around a timestamp\ndatadog logs context --timestamp \"2024-01-15T10:30:00Z\" --service api --before 5m --after 2m --pretty\n```\n\n### Analysis & Triage\n\n```bash\n# Error summary\ndatadog errors --from 1h --pretty\ndatadog errors --service api --from 24h --pretty\n\n# Pattern detection\ndatadog logs patterns --query \"status:error\" --from 1h --pretty\n\n# Period comparison\ndatadog logs compare --query \"status:error\" --period 1h --pretty\n```\n\n### Service Discovery\n\n```bash\ndatadog services --from 24h --pretty\n```\n\n### Metrics\n\n```bash\ndatadog metrics query --query \"avg:system.cpu.user{*}\" --from 1h --pretty\n```\n\n### Dashboards\n\n```bash\n# List dashboards (summaries)\ndatadog dashboards list --count 25 --pretty\n\n# Get dashboard definition\ndatadog dashboards get --id \"abc-def-ghi\" --pretty\n\n# Create dashboard (widgets JSON via stdin)\necho '[{\"definition\":{\"type\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.cpu.user{*}\"}]}}]' | datadog dashboards create --title \"CPU\" --layout ordered --pretty\n```\n\n### Dashboard Lists\n\n```bash\n# List dashboard lists\ndatadog dashboard-lists list --pretty\n\n# Show dashboards in a list\ndatadog dashboard-lists items --id 123 --pretty\n\n# Add dashboard to a list\ndatadog dashboard-lists add-items --id 123 --dashboards '[{\"type\":\"custom_timeboard\",\"id\":\"abc-def-ghi\"}]' --pretty\n```\n\n### Export & Multi-query\n\n```bash\n# Export to file\ndatadog logs search --query \"*\" --limit 1000 --output logs.json\n\n# Multiple queries at once\ndatadog logs multi --queries \"errors:status:error,warnings:status:warn\" --from 1h --pretty\n```\n\n## Flags Reference\n\n### Log Flags\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--query` | Log search query | `*` |\n| `--from` | Start time (`1h`, `30m`, `7d`, or ISO timestamp) | 15m |\n| `--to` | End time | now |\n| `--limit` | Max logs to return | 100 |\n| `--sort` | `timestamp` or `-timestamp` | `-timestamp` |\n| `--id` | Trace ID (for `trace` command) | - |\n| `--facet` | Facet for aggregation | - |\n| `--service` | Filter by service | - |\n| `--timestamp` | Target timestamp (for `context`) | - |\n| `--before` | Context: time before target | 5m |\n| `--after` | Context: time after target | 5m |\n| `--interval` | Tail: poll interval in seconds | 2 |\n| `--period` | Compare: comparison period | 1h |\n\n### Global Flags\n\n| Flag | Description |\n|------|-------------|\n| `--pretty` | Human-readable output with colors |\n| `--output` | Write results to JSON file |\n| `--site` | Datadog site (e.g., `datadoghq.eu`) |\n\n### Dashboards Flags\n\n| Flag | Description |\n|------|-------------|\n| `--id` | Dashboard id (get/update/delete) |\n| `--title` | Dashboard title (create/update) |\n| `--layout` | Dashboard layout type: `ordered` or `free` (create/update) |\n| `--widgets` | Widgets JSON array (create/update); if omitted, reads from stdin |\n| `--description` | Dashboard description (create/update) |\n| `--read-only` | Set dashboard read-only (create/update) |\n| `--notify-list` | JSON array of user handles to notify |\n| `--template-variables` | JSON array of template variables |\n| `--count` | List dashboards: page size |\n| `--start` | List dashboards: offset |\n| `--shared` | List dashboards: only shared |\n| `--deleted` | List dashboards: only deleted |\n\n### Dashboard Lists Flags\n\n| Flag | Description |\n|------|-------------|\n| `--id` | Dashboard list id (number) |\n| `--name` | Dashboard list name (create/update) |\n| `--dashboards` | JSON array of `{id,type}` for add/update/delete items |\n\n## Time Formats\n\n- **Relative:** `30m`, `1h`, `7d`, `24h`\n- **ISO 8601:** `2024-01-15T10:30:00Z`\n\n## Incident Triage Workflow\n\n```bash\n# 1. Check error summary\ndatadog errors --from 1h --pretty\n\n# 2. Compare to previous period\ndatadog logs compare --query \"status:error\" --period 1h --pretty\n\n# 3. Find error patterns\ndatadog logs patterns --query \"status:error\" --from 1h --pretty\n\n# 4. Search specific errors\ndatadog logs search --query \"status:error service:api\" --from 1h --pretty\n\n# 5. Get context around a timestamp\ndatadog logs context --timestamp \"2024-01-15T10:30:00Z\" --service api --pretty\n\n# 6. Follow the trace\ndatadog logs trace --id \"TRACE_ID\" --pretty\n```\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Run the CLI\nbun run start\n\n# Run with watch mode\nbun run dev\n\n# Build standalone binary\nbun run build\n\n# Lint and format\nbun run check\n```\n\n## Acknowledgments\n\nInspired by [ctdio/datadog-cli](https://github.com/ctdio/datadog-cli).\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n","readmeFilename":"README.md"}