Skip to content

login -i with no terminal leaks a raw termios error instead of guidance #401

Description

@leggetter

Summary

hookdeck login -i with no terminal surfaces a raw Go termios error instead of an actionable message.

Reproduce

hookdeck login -i --hookdeck-config <empty.toml> </dev/null
→ Enter your CLI API key: operation not supported by device

Exit 1, instantly.

Assessment

The behaviour is correct — it fails fast rather than hanging, which is what a headless environment needs. Only the message is wrong: operation not supported by device is the termios error surfaced verbatim, and tells the user nothing about what to do.

Suggested fix

Detect the absent terminal before attempting the prompt, and emit something in the style the codebase already uses elsewhere — e.g. "interactive sign-in needs a terminal; use hookdeck login --cli-key <key> or hookdeck ci --api-key <key> instead."

The rejected-key path in pkg/login/client_login.go already produces a message of the right quality; this path should match it.

Testing

Unit, alongside the existing stubs for stdinIsTerminal in pkg/login/client_login_test.go.

Related


Filed by Claude on Phil's behalf, from release-candidate testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions