Skip to content

feat(init): add --template flag for non-interactive initialization#1452

Open
VitorAEltz wants to merge 3 commits into
devfrom
feat/flag-template-name-cmd-init
Open

feat(init): add --template flag for non-interactive initialization#1452
VitorAEltz wants to merge 3 commits into
devfrom
feat/flag-template-name-cmd-init

Conversation

@VitorAEltz
Copy link
Copy Markdown

Add --template flag to azion init command that allows users to specify a template name directly, skipping the interactive preset/template TUI. When provided, the flag implies --auto behavior.

  • Add ErrorTemplateNotFound error message
  • Update FLAG_TEMPLATE description
  • Add template field to initCmd struct
  • Implement template matching logic in Run() method
  • Add tests for valid and invalid template names

Add --template flag to azion init command that allows users to specify
a template name directly, skipping the interactive preset/template TUI.
When provided, the flag implies --auto behavior.

- Add ErrorTemplateNotFound error message
- Update FLAG_TEMPLATE description
- Add template field to initCmd struct
- Implement template matching logic in Run() method
- Add tests for valid and invalid template names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VitorAEltz VitorAEltz requested a review from a team as a code owner April 16, 2026 12:55
Comment thread pkg/cmd/init/init.go Outdated
Comment thread pkg/cmd/init/init.go Outdated
}
// Handle --template flag: skip TUI and match template directly
if cmd.template != "" {
cmd.auto = true // Implies auto behavior
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should imply auto... the user should send the --auto flag.
In the current behavior, if you want a fully automatic behavior, you already have to send --name flag, otherwise it is asked in the terminal.

VitorAEltz and others added 2 commits April 16, 2026 11:44
Co-authored-by: PatrickMenoti <82882574+PatrickMenoti@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants