Skip to main content
← Back to list
01Issue
BugOpenSwamp CLIPublic
AssigneesNone

Relationships

#3831 auth login on a non-TTY stdin with no --username prompts, then fails with "Username and password are required"

Opened by reset · 10/23/2026

Run from an agent harness with no terminal and no credentials given, swamp auth login (version 20261020.024627.0-sha.26dc044f, macOS 27) skips the browser flow, prints Username or email: Password: to a stdin that will never answer, then exits with Username and password are required. Nothing in that output names the non-interactive route. swamp auth login --help on the same build already describes it: For non-interactive use (CI, agents, scripts), set the SWAMP_API_KEY environment variable (or SWAMP_API_KEY_FILE, a path to a file holding the key), and gives the piped form printf 'mypassword\n' | swamp auth login --username alice --no-browser.

Expected: with a non-TTY stdin and no --username, the command fails at once with a message that names SWAMP_API_KEY / SWAMP_API_KEY_FILE and the --username ... --no-browser piped form. Actual: an interactive prompt is rendered to a pipe, and the failure line reads as if the user forgot to type.

Steps to reproduce:

  1. In a shell with no stored credentials, swamp auth login < /dev/null (or run it from any harness without a TTY).
  2. Observe Username or email: Password: followed by Username and password are required.

#1789 (shipped) documented SWAMP_API_KEY in the help text; this is the runtime message. In the stdin branch of the login use case (// Stdin flow in the bundled source: if (!username || !password) { readCredentials(...) } then validationFailed("Username and password are required.")) there is no check that stdin is a terminal before prompting (inference from the bundled source text; file and line not identified).

Suggestion: when stdin is not a TTY and --username is absent, return the validation error without prompting, with the SWAMP_API_KEY sentence from the help text appended. Reading a piped password with --username keeps working.

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

10/23/2026, 5:21:38 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.