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
fix(cli): os login --json refuses in a non-interactive shell instead of prompting on stdout (#6728) (#6985)
The non-TTY fallback below the device flow wrote `readline`'s prompt to the
`output` stream it was built on — `process.stdout`, unconditionally, `--json`
or not. Measured on origin/main @ 73bff86, `os login --json --url … <
/dev/null` produced exit 13 and a stdout consisting entirely of `Email: `,
with no trailing newline. `--password` alone gave the same; `--email` alone
gave `Password: `.
Per the maintainer ruling of 2026-08-09 (shape 1), a `--json` run that would
otherwise have to prompt now emits one record through the existing
`emitRecord()` NDJSON emitter and exits 1:
{"success":false,"error":"email and password are required in a non-interactive shell"}
Separately and in the same PR: EOF on stdin now produces a defined
`CliExitCode`. Exit 13 was Node's unsettled-top-level-await teardown —
`readline`'s question promise is abandoned rather than rejected at EOF, so
nothing threw and the command never decided anything. Every prompt is now
bound to an abort that fires on the interface's `close`, which puts the
failure back on the path that ends in `this.exit(1)`. The non-`--json` path
keeps its prompts and gains a named error instead of a teardown.
The two non-TTY prompts share one readline interface now; `promptPassword`
loses its non-TTY branch, which was the second interface the unsettleable
question lived in.
Claude-Session: https://claude.ai/code/session_01USNUyHEr7uaU6MoEWXitei
Co-authored-by: Claude <noreply@anthropic.com>
'Machine-readable output as NDJSON — one compact JSON document per line. Unlike every other ObjectStack command, whose --json stdout is a single document, this one is a stream: the device flow reports the verification URL as its own record BEFORE you authorize, then the result as a second record. Parse stdout line by line.',
275
+
'Machine-readable output as NDJSON — one compact JSON document per line. Unlike every other ObjectStack command, whose --json stdout is a single document, this one is a stream: the device flow reports the verification URL as its own record BEFORE you authorize, then the result as a second record. Parse stdout line by line. Implies non-interactive: without --email and --password to work from, the command refuses with a record instead of prompting.',
0 commit comments