Added interactive menu for gogen new#24
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces an interactive wizard for project creation in the gogen new command, allowing users to configure projects through guided prompts instead of requiring CLI flags. The wizard supports all existing project options including templates, routers, frontend frameworks, TypeScript, Tailwind, Docker, and custom module paths.
Key changes:
- Added interactive wizard accessible via
--interactiveflag with comprehensive project configuration prompts - Implemented testable prompt abstraction using
AlecAivazis/survey/v2library for user interaction - Added robust interrupt handling that gracefully exits on Ctrl+C with user-friendly error messages
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/wizard/run.go |
Core interactive wizard logic with project configuration flow and interrupt handling |
internal/wizard/survey_prompter.go |
Survey-based prompter implementation for actual user interaction |
internal/wizard/prompter.go |
Prompter interface and configuration types for abstraction |
internal/wizard/config.go |
ProjectConfig struct defining wizard output structure |
internal/wizard/run_test.go |
Unit tests covering wizard flows and abort scenarios with fake prompters |
cmd/new.go |
Integration of interactive flag and wizard into existing CLI command |
go.mod |
Addition of survey dependency and related packages |
CHANGES.md |
Documentation of all changes and usage instructions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Can you resolve the issues above? |
|
yes i will |
|
I applied the fix for mentioned format, linting and other issues |
|
lmk if you want some upgrades or anything else, happy to collaborate!!! |
|
Rejecting this PR because of AI slop. |


This pull request introduces a new interactive wizard for project creation in the
gogen newcommand, making the setup process more user-friendly and robust. The wizard guides users through project configuration options interactively, supports testable flows, and handles user interrupts gracefully. Key changes include adding the interactive wizard implementation, integrating it into the CLI, abstracting prompt logic for testing, and adding unit tests to ensure reliability.Interactive wizard implementation and integration
--interactiveflag in thegogen newcommand, which guides users through configuration options such as templates, router, frontend, runtime, TypeScript, Tailwind, editor, Docker, and module path (cmd/new.go,internal/wizard/run.go,internal/wizard/config.go) [1] [2] [3].cmd/new.go) [1] [2].Prompt abstraction and survey integration
Prompterinterface and helper types to abstract prompt logic, enabling both real and fake implementations for interactive and test flows (internal/wizard/prompter.go).AlecAivazis/survey/v2for actual user interaction (internal/wizard/survey_prompter.go).github.com/AlecAivazis/survey/v2and related packages togo.mod/go.sum.Testing and robustness
internal/wizard/run_test.go).internal/wizard/run.go,internal/wizard/run_test.go) [1] [2].Documentation and changelog
CHANGES.mdfor easy reference and future follow-ups.Encoded references: [1] [2] [3] [4] [5] [6] [7] [8] [9]