You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(readme): fix WASM auth to mention API keys, add agent mode section
- Corrected WASM auth docs to show both DD_ACCESS_TOKEN and API key
options (was incorrectly stating DD_ACCESS_TOKEN was the only method)
- Added Agent Mode section documenting auto-detection environment
variables and how to enable structured JSON responses for AI agents
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
-`DD_TOKEN_STORAGE`: Token storage backend (keychain or file, default: auto-detect)
356
356
357
+
## Agent Mode
358
+
359
+
When pup is invoked by an AI coding agent, it automatically switches to **agent mode** which returns structured JSON responses optimized for machine consumption (including metadata, error details, and hints). Agent mode also auto-approves confirmation prompts.
360
+
361
+
Agent mode is **auto-detected** when any of these environment variables are set to `1` or `true`:
362
+
363
+
| Variable | Agent |
364
+
|----------|-------|
365
+
|`CLAUDE_CODE` or `CLAUDECODE`| Claude Code |
366
+
|`CURSOR_AGENT`| Cursor |
367
+
|`CODEX` or `OPENAI_CODEX`| OpenAI Codex |
368
+
|`AIDER`| Aider |
369
+
|`CLINE`| Cline |
370
+
|`WINDSURF_AGENT`| Windsurf |
371
+
|`GITHUB_COPILOT`| GitHub Copilot |
372
+
|`AMAZON_Q` or `AWS_Q_DEVELOPER`| Amazon Q |
373
+
|`GEMINI_CODE_ASSIST`| Gemini Code Assist |
374
+
|`SRC_CODY`| Sourcegraph Cody |
375
+
|`FORCE_AGENT_MODE`| Any agent (manual override) |
376
+
377
+
You can also enable it explicitly with the `--agent` flag or by setting `FORCE_AGENT_MODE=1`:
378
+
379
+
```bash
380
+
# Auto-detected (e.g., running inside Claude Code)
381
+
pup monitors list
382
+
383
+
# Explicit flag
384
+
pup monitors list --agent
385
+
386
+
# Environment variable override
387
+
FORCE_AGENT_MODE=1 pup monitors list
388
+
```
389
+
390
+
If you are integrating pup into an AI agent workflow, make sure the appropriate environment variable is set so responses are optimized for your agent. Without it, pup defaults to human-friendly output.
391
+
357
392
## WASM
358
393
359
394
Pup compiles to WebAssembly (`GOOS=js GOARCH=wasm`) for use in browser-like runtimes such as Deno, Bun, and Cloudflare Workers.
The WASM build uses**stateless authentication only** — keychain storage and browser-based OAuth login are not available. Set `DD_ACCESS_TOKEN`with a pre-obtained bearer token:
407
+
The WASM build supports**stateless authentication** — keychain storage and browser-based OAuth login are not available. Use either `DD_ACCESS_TOKEN`or API keys:
373
408
374
409
```bash
410
+
# Option 1: Bearer token
375
411
DD_ACCESS_TOKEN="your-token" DD_SITE="datadoghq.com" deno run pup.wasm monitors list
412
+
413
+
# Option 2: API keys
414
+
DD_API_KEY="your-api-key" DD_APP_KEY="your-app-key" deno run pup.wasm monitors list
376
415
```
377
416
378
417
The `pup auth status` command works in WASM and reports which credentials are configured. The `login`, `logout`, and `refresh` subcommands return guidance to use `DD_ACCESS_TOKEN`.
379
418
380
419
### Limitations
381
420
382
-
- No local token storage (keychain/file) — use `DD_ACCESS_TOKEN`
421
+
- No local token storage (keychain/file) — use `DD_ACCESS_TOKEN` or API keys
383
422
- No browser-based OAuth login flow
384
423
- Networking relies on the host runtime's Fetch API
0 commit comments