Skip to content

Comments

Make --target explicit and prompted if flag is missing#278

Open
ejacquier wants to merge 4 commits intofeature/dynamic-templatesfrom
feature/DEVSVCS-3827
Open

Make --target explicit and prompted if flag is missing#278
ejacquier wants to merge 4 commits intofeature/dynamic-templatesfrom
feature/DEVSVCS-3827

Conversation

@ejacquier
Copy link
Contributor

Summary

  • Removed CRE_TARGET from the generated .env file — target selection is now always explicit
  • When --target flag and CRE_TARGET env var are both missing, the CLI now discovers available targets from project.yaml and either:
    • Auto-selects if only one target exists
    • Prompts the user to choose from a styled interactive select menu if multiple targets exist
  • GetTarget() no longer returns an error when target is unset — it returns empty string and defers to the new promptForTarget() flow
  • Added GetAvailableTargets() to parse project.yaml keys (preserving YAML order) and identify target configurations
  • Updated tests to reflect the new behavior (empty target triggers prompt instead of hard error)

Why

Users were confused about which target they were operating against. The old default (CRE_TARGET=staging-settings in .env) silently picked a target without the user's awareness. Making target selection explicit: via flag, env var, or interactive
prompt, ensures users always know which target they're using.

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