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
-`DD_TOKEN_STORAGE`: Token storage backend (keychain or file, default: auto-detect)
341
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
+
392
+
## WASM
393
+
394
+
Pup compiles to WebAssembly (`GOOS=js GOARCH=wasm`) for use in browser-like runtimes such as Deno, Bun, and Cloudflare Workers.
395
+
396
+
### Building
397
+
398
+
```bash
399
+
GOOS=js GOARCH=wasm go build -o pup.wasm .
400
+
401
+
# Copy the Go WASM support file
402
+
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js".
403
+
```
404
+
405
+
### Authentication
406
+
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:
408
+
409
+
```bash
410
+
# Option 1: Bearer token
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
415
+
```
416
+
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`.
418
+
419
+
### Limitations
420
+
421
+
- No local token storage (keychain/file) — use `DD_ACCESS_TOKEN` or API keys
422
+
- No browser-based OAuth login flow
423
+
- Networking relies on the host runtime's Fetch API
0 commit comments