Skip to content

feat: added inquirer as an alternative to --template cli #3933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sethcg
Copy link

@sethcg sethcg commented May 7, 2025

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

These are my proposed changes to the cli tool.

I added @inquirer/prompts to allow users to run the command, instead of specifying --template the user would be asked a series of questions so they could see the available options.

npx create-electron-app@latest my-app

Here's what it looks like in the console:

cli-improve-1 5

Example of results after completion:

cli-improve-2


Notes:

  • This does not break existing "--template" option of running the command.
  • I included a commented out section regarding frontend frameworks this is so in the future there could be vite-react-typescript, vite-vue-typescript, etc. templates. (referencing feat: added vite-react-typescript template #3932)

@sethcg sethcg requested a review from a team as a code owner May 7, 2025 21:58
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

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

Hey @sethcg, thanks for this contribution! Have you tried using the Listr2 adapter for inquirer for this purpose?

https://www.npmjs.com/package/@listr2/prompt-adapter-inquirer

@sethcg
Copy link
Author

sethcg commented May 13, 2025

@erickzhao
Implemented the mentioned @listr2/prompt-adapter-inquirer in the latest commit. Thank you for the suggestion!

@sethcg sethcg requested a review from erickzhao May 17, 2025 18:32
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