Add --non-interactive flag and improve TTY detection by tashian · Pull Request #1553 · smallstep/cli
Add support for non-interactive environments by: - Adding --non-interactive global flag (also STEP_NON_INTERACTIVE env var) - Checking for terminal availability before prompting for passwords - Returning helpful error messages when prompts fail in CI/systemd/Docker This change requires smallstep/cli-utils#210 which adds: - ui.CanPrompt() for TTY detection - errs.RequiredInputError for descriptive error messages Fixes #674 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address review feedback: different commands use different password flags (--password-file, --provisioner-password-file, --admin-password-file, etc.), so don't suggest a specific flag. Instead, guide users to check --help for the correct flag for their command. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a Before hook that sets STEP_NON_INTERACTIVE=1 when the --non-interactive flag is used, allowing ui.CanPrompt() to detect the flag without needing access to the cli context. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters