Skip to content

Add --non-interactive flag to all commands and improve CI/headless UX#331

Open
ejacquier wants to merge 3 commits intomainfrom
non-interactive-improvements
Open

Add --non-interactive flag to all commands and improve CI/headless UX#331
ejacquier wants to merge 3 commits intomainfrom
non-interactive-improvements

Conversation

@ejacquier
Copy link
Copy Markdown
Contributor

@ejacquier ejacquier commented Mar 31, 2026

Problem

AI agents and CI/CD pipelines encounter "could not open a new TTY" errors (22+ occurrences in error tracking) when commands try to prompt interactively. Only cre init and cre workflow simulate had --non-interactive support. Additionally, cre login --help didn't mention CRE_API_KEY as the headless auth method.

Changes:

cre login improvements

  • Updated help text to document CRE_API_KEY as the CI/headless auth method (referencing app.chain.link).
  • Added --non-interactive flag that returns an actionable error directing users to set CRE_API_KEY.

Global TTY guard in root.go

  • Before the "Would you like to login now?" prompt, detect non-TTY stdin via term.IsTerminal().
  • Non-interactive environments now get a clear error with CRE_API_KEY guidance instead of hanging.

--non-interactive flag is now global

  • Commands with interactive prompts (workflow deploy/delete/custom-build, account link-key/unlink-key) validate that required skip flags (--yes, --force, --owner-label) are provided, erroring with specific missing-flag suggestions.
  • Commands without prompts (workflow activate/pause, secrets create/update/delete/list) accept the flag for forward-compatibility.

@ejacquier ejacquier requested a review from a team as a code owner March 31, 2026 12:46
@github-actions
Copy link
Copy Markdown

👋 ejacquier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant