Loading...
Loading...
Datadog CLI (Go). OAuth2 auth with token refresh.
npx skill4agent add datadog-labs/agent-skills dd-pup| Task | Command |
|---|---|
| Search error logs | |
| List monitors | |
| Mute a monitor | |
| Find slow traces | |
| List active incidents | |
| Create incident | |
| Query metrics | |
| List hosts | |
| Check SLOs | |
| Who's on call | |
| Security signals | |
| Check auth | |
| Refresh token | |
# Install pup
go install github.com/datadog-labs/pup@latest
export PATH="$HOME/go/bin:$PATH"pup auth login # OAuth2 browser flow (recommended)
pup auth status # Check token validity
pup auth refresh # Refresh expired token (no browser)
pup auth logout # Clear credentialspup auth refresh # Try refresh first
pup auth login # If refresh fails, full re-auth# Use env vars or:
export DD_API_KEY=your-api-key
export DD_APP_KEY=your-app-key
export DD_SITE=datadoghq.com # or datadoghq.eu, etc.pup monitors list --limit 10
pup monitors list --tags "env:prod"
pup monitors get --id 12345
pup monitors mute --id 12345 --duration 1h
pup monitors unmute --id 12345
pup monitors create --name "High CPU" --type "metric alert" \
--query "avg(last_5m):avg:system.cpu.user{*} > 80" \
--message "CPU high @slack-ops"pup logs search --query "status:error" --duration 1h
pup logs search --query "service:payment-api" --duration 1h --limit 100
pup logs search --query "@http.status_code:5*" --duration 24h
pup logs search --query "env:prod level:error" --duration 1h --jsonpup metrics query --query "avg:system.cpu.user{*}" --duration 1h
pup metrics query --query "sum:trace.express.request.hits{service:api}" --duration 1h
pup metrics list --filter "system.*"pup apm services list
pup apm traces list --service my-service --duration 1h
pup apm traces list --service api --min-duration 500ms --duration 1h
pup apm traces list --service api --status error --duration 1h
pup apm traces get abc123def456pup incidents list --status active
pup incidents list --status resolved --duration 7d
pup incidents create --title "API Degradation" --severity SEV-2
pup incidents update --id abc-123 --status stable
pup incidents resolve --id abc-123pup dashboards list
pup dashboards list --tags "team:platform"
pup dashboards get --id abc-123
pup dashboards create --title "My Dashboard" --description "..." --widgets '[...]'pup slos list
pup slos get --id slo-123
pup slos history --id slo-123 --duration 30dpup synthetics list
pup synthetics results --test-id abc-123
pup synthetics trigger --test-id abc-123pup on-call teams list
pup on-call schedules list
pup on-call who --team platform-teampup hosts list --limit 50
pup hosts list --filter "env:prod"
pup hosts mute --hostname web-01 --duration 1h
pup hosts get --hostname web-01pup events list --duration 24h
pup events list --tags "source:deploy"
pup events post --title "Deploy started" --text "v1.2.3" --tags "env:prod"pup downtime list
pup downtime create --scope "env:staging" --duration 2h --message "Maintenance"
pup downtime cancel --id 12345pup users list
pup teams listpup security signals list --duration 24h
pup security signals list --severity criticalpup services list
pup services get --name payment-apipup notebooks list
pup notebooks get --id 12345pup workflows list
pup workflows trigger --id workflow-123 --input '{"key": "value"}'pup --help # List all commands
pup <command> --help # Command-specific help| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Token expired | |
| 403 Forbidden | Missing scope | Check app key permissions |
| 404 Not Found | Wrong ID/resource | Verify resource exists |
| Rate limited | Too many requests | Add delays between calls |
go install github.com/DataDog/pup@latest# Check if pup is in PATH
which pup
# If not found, check if it was installed
ls ~/go/bin/puppupwhich pupls ~/go/bin/pup # Standard location
ls $GOPATH/bin/pup # If GOPATH is set
ls $GOBIN/pup # If GOBIN is set# Add this line to ~/.zshrc
export PATH="$HOME/go/bin:$PATH"
# Then reload
source ~/.zshrc# Add this line to ~/.bashrc or ~/.bash_profile
export PATH="$HOME/go/bin:$PATH"
# Then reload
source ~/.bashrc# Add this line to ~/.config/fish/config.fish
fish_add_path $HOME/go/bin
# Or set permanently
set -Ux fish_user_paths $HOME/go/bin $fish_user_paths
# Then reload
source ~/.config/fish/config.fishwhich pup # Should show path
pup --version # Should show version~/go/bin/pup auth login
~/go/bin/pup monitors listalias pup="$HOME/go/bin/pup"| Site | |
|---|---|
| US1 (default) | |
| US3 | |
| US5 | |
| EU1 | |
| AP1 | |
| US1-FED | |