Skip to content

Added interactive menu for gogen new#24

Closed
iceXshadow wants to merge 3 commits intoluigimorel:mainfrom
iceXshadow:feat/interactive-menu
Closed

Added interactive menu for gogen new#24
iceXshadow wants to merge 3 commits intoluigimorel:mainfrom
iceXshadow:feat/interactive-menu

Conversation

@iceXshadow
Copy link

This pull request introduces a new interactive wizard for project creation in the gogen new command, 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

  • Added a new interactive project creation wizard, accessible via the --interactive flag in the gogen new command, 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].
  • Integrated the wizard into the CLI, refactored the action logic to support both interactive and non-interactive flows, and adjusted flag validation to defer required checks for interactive mode (cmd/new.go) [1] [2].

Prompt abstraction and survey integration

  • Introduced a Prompter interface and helper types to abstract prompt logic, enabling both real and fake implementations for interactive and test flows (internal/wizard/prompter.go).
  • Implemented a Survey-backed prompter using AlecAivazis/survey/v2 for actual user interaction (internal/wizard/survey_prompter.go).
  • Added dependency on github.com/AlecAivazis/survey/v2 and related packages to go.mod/go.sum.

Testing and robustness

  • Added unit tests for the wizard covering web/react/TS/tailwind/docker, CLI minimal, and abort (Ctrl+C) flows using fake and abort prompters (internal/wizard/run_test.go).
  • Ensured the wizard exits cleanly with a friendly "aborted by user" error on Ctrl+C or terminal interrupt (internal/wizard/run.go, internal/wizard/run_test.go) [1] [2].

Documentation and changelog

  • Documented all changes and usage instructions in CHANGES.md for easy reference and future follow-ups.

Encoded references: [1] [2] [3] [4] [5] [6] [7] [8] [9]

@iceXshadow
Copy link
Author

image image
  • TEST SCREENSHOTS ABOVE

@luigimorel luigimorel requested a review from Copilot October 6, 2025 17:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 --interactive flag with comprehensive project configuration prompts
  • Implemented testable prompt abstraction using AlecAivazis/survey/v2 library 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>
@luigimorel
Copy link
Owner

Can you resolve the issues above?

@iceXshadow
Copy link
Author

yes i will

@iceXshadow
Copy link
Author

I applied the fix for mentioned format, linting and other issues
kindly check, thanks

@iceXshadow
Copy link
Author

lmk if you want some upgrades or anything else, happy to collaborate!!!

@luigimorel
Copy link
Owner

Rejecting this PR because of AI slop.

@luigimorel luigimorel closed this Oct 9, 2025
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.

2 participants