Skip to content

Interactive prompts and the configure prelude write to stdout, breaking --output json purity #30

Description

@Davidson3556

Summary

The interactive prompts in prompt.ts (the API-key prompt in setup/auth configure, the target prompt in agent install) write the question and masking characters to stdout, and the Configuring profile … prelude in auth.ts defaults to stdout as well.

On any interactive path this mixes UI text into stdout. Under --output json it breaks the contract that stdout is a single JSON document — a machine consumer doing JSON.parse(stdout) fails on the prompt text. The repo already enforces "stdout is a pure result stream" (the stdoutPurity helper, §8.1), but the interactive prompt path was missed.

Suggested fix

Default prompts and the informational prelude to stderr — they're interactive UI, not result data. stderr is still the user's TTY, so prompts stay visible; stdout carries only the result. Callers that inject explicit streams are unaffected.

I have a PR ready for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions