Commit 79cac20
chore(auth): route browser-flow prompts + diagnostics to stderr
Move four log sites from stdout to stderr so that `--json` callers
(and anyone piping the CLI's stdout) stop seeing human/diagnostic
chatter mixed into machine-readable output:
- The OAuth browser-flow prompt ("Visit ... to authorize ..."): this
is a prompt directed at the human at the terminal; it belongs on
stderr, not on stdout where it would corrupt a piped JSON payload.
- "Authorization successful. Authenticated as ...": status message,
not data; stderr.
- The 401 response body that `authedFetch` logs when re-authenticating:
always a diagnostic; gated on `--debug` and emitted to stderr.
- The retry-link's `console.log(opts)` debug dump: stderr (was the
only stdout debug write in auth.ts).
The keychain-unavailable warning was already moved to stderr in #91.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 43d0b9a commit 79cac20
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
| 247 | + | |
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| |||
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | | - | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| |||
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | | - | |
| 373 | + | |
| 374 | + | |
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
| |||
0 commit comments