v3.2.0
Summary
Adds an --interactive (-i) flag to the five create commands (zones,
users, groups, permission-templates, records). When set, any
required value not already supplied via flag or argument is prompted for
interactively, followed by a summary and confirmation before the resource
is actually created.
This is marked as a feature preview — the prompt flow may still change
based on feedback, and a notice is printed to stderr whenever --interactive
is used.
What's new
- New
internal/cmd/base/interactive.gohelper package (PromptString,
PromptSelect,PromptInt,PromptBool,PromptStringSlice,
PrintPreviewNotice), built on
charmbracelet/huh, reused across
all five commands. --interactive/-iflag added to:zones createusers create(existing masked password prompt is unaffected)groups createpermission-templates createrecords create
- Values already supplied via flag or positional argument are never
re-prompted. - Conditional prompts where relevant (e.g. TTL for
zones createonly
asked when nameservers are set; priority forrecords createonly asked
for MX/SRV). - Final summary + confirmation (
base.Confirm) before the API call runs. - README updated with an "Interactive Mode" section and per-command
examples; reference docs regenerated (go run ./scripts/docs.go).
Bug fix along the way
records create --interactive initially failed with a 404 zone not found when the zone name was supplied via the interactive prompt, because
base.ResolveZoneID reads --zone-name/--zone-id directly from Cobra's
flag set rather than from the local variable. Fixed by writing the
prompted value back with cmd.Flags().Set("zone-name", ...).
Testing
Manually verified for all five commands:
- Prompts only appear for missing values, not for ones already set via
flags/args. - Type flags (
--typefor zones/permission-templates, record type) are
skipped when explicitly set. - Declining the final confirmation aborts without creating anything.
- Non-interactive usage (no
-i) is unchanged.
Not included
- No automated tests yet for the new interactive code paths.
updatecommands don't support--interactiveyet (could follow the
same pattern later).