Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(cli): add global --non-interactive flag for headless runs#40

Merged
Monoradioactivo merged 1 commit into
mainfrom
feat/cli-non-interactive-flag
May 28, 2026
Merged

feat(cli): add global --non-interactive flag for headless runs#40
Monoradioactivo merged 1 commit into
mainfrom
feat/cli-non-interactive-flag

Conversation

@Monoradioactivo

Copy link
Copy Markdown
Owner

Summary

Phase 2 of the CLI headless epic (6A-5d). Adds a global --non-interactive flag, alias --ci, that runs commands without interactive prompts.

Resolution order: an explicit flag wins; if it is absent, CI=true turns on non-interactive mode and prints [Aether] Detected CI environment — running in non-interactive mode. to stderr; otherwise the CLI stays interactive. Because the explicit flag wins, --no-non-interactive keeps prompts even inside CI.

The flag lives on the base ICommand. The parser registers it in addCommonConfiguration (no default, so an absent flag stays undefined and the CI fallback can kick in) and stamps the explicit value in createCommand. execute() resolves the effective mode once and emits the stderr notice a single time.

confirm() gained an autoConfirm parameter and returns true early when set. In non-interactive mode the three non-destructive confirmations auto-skip: collaborator rm, session rm, rollback. The six destructive commands (access-key rm, api-key rm, app rm, app transfer, deployment rm, deployment clear) are untouched here and get --force gating in Phase 3.

Tests. Parser: absent flag stays undefined, --non-interactive and --ci set true, --no-non-interactive sets false, and the flag rides along on a destructive command. Executor: process.env.CI is saved and cleared per test so the existing interactive cancellation tests stay deterministic, plus new cases for the confirm short-circuit, the three auto-skips, CI auto-detect with its stderr notice, and explicit-false beating CI.

Note on yargs. Verified locally that a boolean option with no default reports undefined when absent on yargs 17. The parser test leaves nonInteractive undefined when the flag is absent guards this: if a pinned yargs ever injects false, that test fails loudly instead of silently disabling CI auto-detect.

Type of change

  • feat
  • fix
  • refactor
  • chore
  • docs

Checklist

  • Build and typecheck pass locally (npm run build)
  • Tests added or updated (when test infrastructure is wired up)
  • Relevant docs updated

Add a global --non-interactive flag (alias --ci) so commands can run
without prompts. When the flag is absent the CLI checks the CI
environment variable: CI=true switches to non-interactive mode and
prints a notice to stderr. An explicit flag wins over the auto-detect,
so --no-non-interactive keeps prompts even when CI is set.

In non-interactive mode the non-destructive confirmations auto-resolve
to yes: collaborator remove, session remove, and rollback. The
destructive commands still prompt and will be force-gated separately.

confirm() now takes an autoConfirm argument and returns early when set,
leaving the six untouched call sites and their tests unchanged.
@Monoradioactivo Monoradioactivo self-assigned this May 28, 2026
@Monoradioactivo Monoradioactivo added the enhancement New feature or request label May 28, 2026
@Monoradioactivo Monoradioactivo merged commit eed2d7b into main May 28, 2026
7 checks passed
@Monoradioactivo Monoradioactivo deleted the feat/cli-non-interactive-flag branch May 28, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant