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
{{ message }}
Repository navigation
Support --json errors on railway ssh, so scripts can tell a signed-out account from other failures #1244
railway ssh exits 1 for every failure and does not accept --json, so a script running it without a terminal can only tell a signed-out account from other failures by matching the message text.
Commands that call set_mode from their --json flag already print {"error", "code", "hint"} with a stable code such as UNAUTHORIZED (src/util/reporter.rs).
Reproduce (CLI 5.62.1, macOS, signed out):
echo | railway ssh --project <id> --service postgres --environment production sh -c true
# exit 1: Unauthorized. Please login with `railway login`
railway ssh --json --project <id> sh -c true
# exit 2: error: unexpected argument '--json' found
src/commands/ssh/mod.rs on master still has no --json flag.
Ask: accept --json on railway ssh and route its errors through the structured output, or give authentication failures their own exit code.
Why: our dev setup copies a database through railway ssh with piped input, and offers railway login when the account is signed out. Today that means matching "Unauthorized".
Activity