Skip to content

bug: coder login --first-user-trial=true unusable in non-interactive environments #23264

@blinkagent

Description

@blinkagent

Current Behavior

Running coder login --first-user-trial=true in a non-interactive script fails with EOF because trial info fields (firstName, lastName, phoneNumber, jobTitle, companyName, country, developers) are only collectible via interactive prompts. There are no CLI flags or env vars to supply them.

Error:

Your Coder deployment hasn't been set up!
> Please enter firstName: error: EOF

--first-user-trial=false works fine since it skips trial info prompts.

Expected Behavior

Add CLI flags and env vars for trial info fields so --first-user-trial=true works in automation. For example: --first-user-trial-first-name / CODER_FIRST_USER_TRIAL_FIRST_NAME, and similar for lastName, phoneNumber, jobTitle, companyName, country, developers.

Steps to Reproduce

  1. Fresh Coder deployment with no users
  2. Run coder login with --first-user-trial=true and all other first-user flags in a non-interactive script
  3. Command fails with EOF at the firstName prompt

Relevant Code

Trial info prompts in cli/login.go L285-L330 are gated behind if trial { with no flag/env var fallbacks. The options set at L446-L482 only has --first-user-trial (bool).

Created on behalf of @greg-the-coder

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