1- # Fetch - Datadog API CLI Wrapper
1+ # Pup - Datadog API CLI Wrapper
22
33## Overview
44
5- Fetch is a Go-based command-line wrapper that provides easy interaction with Datadog APIs. It builds upon the foundation of the [ datadog-api-claude-plugin] ( https://github.com/DataDog/datadog-api-claude-plugin ) to provide a native Go experience for developers who need to interact with Datadog's comprehensive monitoring and observability platform.
5+ Pup is a Go-based command-line wrapper that provides easy interaction with Datadog APIs. It builds upon the foundation of the [ datadog-api-claude-plugin] ( https://github.com/DataDog/datadog-api-claude-plugin ) to provide a native Go experience for developers who need to interact with Datadog's comprehensive monitoring and observability platform.
66
77## Project Goals
88
@@ -16,7 +16,7 @@ Fetch is a Go-based command-line wrapper that provides easy interaction with Dat
1616
1717### Authentication
1818
19- Fetch supports two authentication methods:
19+ Pup supports two authentication methods:
2020
2121#### 1. API Key Authentication (Traditional)
2222``` bash
@@ -38,20 +38,20 @@ OAuth2 authentication with PKCE flow provides enhanced security features:
3838** OAuth2 Commands:**
3939``` bash
4040# Login via browser-based OAuth flow
41- fetch auth login
41+ pup auth login
4242
4343# Check authentication status
44- fetch auth status
44+ pup auth status
4545
4646# Manually refresh access token
47- fetch auth refresh
47+ pup auth refresh
4848
4949# Logout and clear stored tokens
50- fetch auth logout
50+ pup auth logout
5151```
5252
5353** OAuth2 Flow:**
54- 1 . User runs ` fetch auth login`
54+ 1 . User runs ` pup auth login`
55552 . CLI performs Dynamic Client Registration with Datadog
56563 . CLI generates PKCE code verifier and challenge
57574 . Browser opens to Datadog authorization page
@@ -81,19 +81,19 @@ fetch auth logout
8181### Command Structure
8282
8383``` bash
84- fetch < domain> < action> [options]
84+ pup < domain> < action> [options]
8585```
8686
8787Example:
8888``` bash
89- fetch metrics query --query=" avg:system.cpu.user{*}" --from=" 1h" --to=" now"
90- fetch monitors list --tag=" env:production"
91- fetch logs search --query=" status:error" --from=" 1h"
89+ pup metrics query --query=" avg:system.cpu.user{*}" --from=" 1h" --to=" now"
90+ pup monitors list --tag=" env:production"
91+ pup logs search --query=" status:error" --from=" 1h"
9292```
9393
9494### Core Domains
9595
96- Based on the datadog-api-claude-plugin architecture, Fetch organizes commands into functional domains:
96+ Based on the datadog-api-claude-plugin architecture, Pup organizes commands into functional domains:
9797
9898#### Data & Observability
9999Query and analyze telemetry data:
@@ -192,7 +192,7 @@ Following the pattern from the TypeScript plugin PR #84, implement secure token
192192 - Linux: Secret Service / Keyring
193193
1941942 . ** Fallback Storage** : Encrypted file
195- - Location: ` ~/.config/fetch /tokens.enc `
195+ - Location: ` ~/.config/pup /tokens.enc `
196196 - Encryption: AES-256-GCM with machine-specific key derivation
197197
1981983 . ** Token Migration** : Support migrating from API key to OAuth2 authentication
@@ -315,7 +315,7 @@ Configuration values are resolved in the following order (highest to lowest prio
315315
3163161 . Command-line flags
3173172 . Environment variables
318- 3 . Configuration file (` ~/.config/fetch /config.yaml ` )
318+ 3 . Configuration file (` ~/.config/pup /config.yaml ` )
3193194 . Default values
320320
321321### Security Considerations
@@ -348,7 +348,7 @@ Based on the TypeScript plugin implementation:
3483481 . Clone the repository:
349349 ``` bash
350350 git clone https://github.com/DataDog/fetch.git
351- cd fetch
351+ cd pup
352352 ```
353353
3543542 . Install dependencies:
@@ -358,7 +358,7 @@ Based on the TypeScript plugin implementation:
358358
3593593 . Build the project:
360360 ``` bash
361- go build -o fetch .
361+ go build -o pup .
362362 ```
363363
3643644 . Run tests:
@@ -474,7 +474,7 @@ Copyright 2024-present Datadog, Inc.
474474- [ ] Encrypted file fallback storage
475475- [ ] Automatic token refresh
476476- [ ] Token migration utilities
477- - [ ] ` fetch auth` command suite
477+ - [ ] ` pup auth` command suite
478478
479479### Phase 3: Core Domains
480480- [ ] Logs domain commands
@@ -546,13 +546,13 @@ Copyright 2024-present Datadog, Inc.
546546
547547``` bash
548548# OAuth2 login (recommended)
549- fetch auth login
549+ pup auth login
550550
551551# Check authentication status
552- fetch auth status
552+ pup auth status
553553
554554# Logout
555- fetch auth logout
555+ pup auth logout
556556
557557# API key authentication (legacy)
558558export DD_API_KEY=" your-api-key"
@@ -563,93 +563,93 @@ export DD_APP_KEY="your-app-key"
563563
564564``` bash
565565# List all metrics
566- fetch metrics list
566+ pup metrics list
567567
568568# Filter metrics by pattern
569- fetch metrics list --filter=" system.*"
569+ pup metrics list --filter=" system.*"
570570
571571# Query metric data
572- fetch metrics query --query=" avg:system.cpu.user{*}" --from=" 1h" --to=" now"
572+ pup metrics query --query=" avg:system.cpu.user{*}" --from=" 1h" --to=" now"
573573
574574# Query with custom aggregation
575- fetch metrics query --query=" sum:app.requests{env:prod} by {service}" --from=" 4h"
575+ pup metrics query --query=" sum:app.requests{env:prod} by {service}" --from=" 4h"
576576```
577577
578578### Monitors
579579
580580``` bash
581581# List all monitors
582- fetch monitors list
582+ pup monitors list
583583
584584# Filter monitors by tag
585- fetch monitors list --tag=" env:production"
585+ pup monitors list --tag=" env:production"
586586
587587# Get specific monitor
588- fetch monitors get 12345678
588+ pup monitors get 12345678
589589
590590# Search monitors by name
591- fetch monitors search " CPU"
591+ pup monitors search " CPU"
592592
593593# Delete monitor (requires confirmation)
594- fetch monitors delete 12345678
594+ pup monitors delete 12345678
595595```
596596
597597### Logs
598598
599599``` bash
600600# Search for errors
601- fetch logs search --query=" status:error" --from=" 1h" --to=" now"
601+ pup logs search --query=" status:error" --from=" 1h" --to=" now"
602602
603603# Search by service
604- fetch logs search --query=" service:web-app status:warn"
604+ pup logs search --query=" service:web-app status:warn"
605605
606606# Complex query with attributes
607- fetch logs search --query=" @user.id:12345 status:error" --limit=100
607+ pup logs search --query=" @user.id:12345 status:error" --limit=100
608608```
609609
610610### Dashboards
611611
612612``` bash
613613# List all dashboards
614- fetch dashboards list
614+ pup dashboards list
615615
616616# Get dashboard details
617- fetch dashboards get " abc-123-def"
617+ pup dashboards get " abc-123-def"
618618
619619# Get dashboard public URL
620- fetch dashboards url " abc-123-def"
620+ pup dashboards url " abc-123-def"
621621```
622622
623623### Output Formatting
624624
625625``` bash
626626# JSON output (default)
627- fetch monitors list --output=json
627+ pup monitors list --output=json
628628
629629# Table output
630- fetch monitors list --output=table
630+ pup monitors list --output=table
631631
632632# YAML output
633- fetch monitors list --output=yaml
633+ pup monitors list --output=yaml
634634
635635# Custom fields
636- fetch monitors list --fields=" id,name,type,status"
636+ pup monitors list --fields=" id,name,type,status"
637637```
638638
639639### Advanced Usage
640640
641641``` bash
642642# Use custom config file
643- fetch --config=/path/to/config.yaml monitors list
643+ pup --config=/path/to/config.yaml monitors list
644644
645645# Specify Datadog site
646- fetch --site=datadoghq.eu monitors list
646+ pup --site=datadoghq.eu monitors list
647647
648648# Verbose output for debugging
649- fetch --verbose monitors list
649+ pup --verbose monitors list
650650
651651# Silent mode (no prompts)
652- fetch --yes monitors delete 12345678
652+ pup --yes monitors delete 12345678
653653```
654654
655655## Testing Strategy
@@ -772,12 +772,12 @@ func TestOAuthLogin(t *testing.T) {
772772** Token Refresh Fails:**
773773- Verify refresh token hasn't expired
774774- Check network connectivity
775- - Try ` fetch auth logout` and ` fetch auth login` to re-authenticate
775+ - Try ` pup auth logout` and ` pup auth login` to re-authenticate
776776
777777** Keychain Access Denied:**
778778- Grant keychain access permissions
779779- Falls back to encrypted file storage automatically
780- - Check ` ~/.config/fetch /tokens.enc ` exists
780+ - Check ` ~/.config/pup /tokens.enc ` exists
781781
782782** API Rate Limiting:**
783783- Implement exponential backoff
@@ -790,11 +790,11 @@ Enable verbose logging for troubleshooting:
790790
791791``` bash
792792# Enable debug logging
793- fetch --verbose monitors list
793+ pup --verbose monitors list
794794
795795# Or set environment variable
796796export FETCH_LOG_LEVEL=debug
797- fetch monitors list
797+ pup monitors list
798798```
799799
800800### Getting Help
@@ -803,7 +803,7 @@ fetch monitors list
8038032 . Search existing GitHub issues
8048043 . Review Datadog API documentation
8058054 . Open new GitHub issue with:
806- - Fetch version (` fetch version` )
806+ - Pup version (` pup version` )
807807 - Command that failed
808808 - Error message and stack trace (if available)
809809 - Steps to reproduce
0 commit comments