Add commander dependency and CLI flag support#53
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor to the CLI in
index.js, migrating from a purely interactive prompt-based approach to a robust command-line interface using thecommanderlibrary. It adds support for command-line flags, improves input validation, and allows both interactive and non-interactive (flag-driven) project scaffolding. Additionally, it introduces several quality-of-life improvements such as skipping dependency installation with a flag and dynamically displaying the current version frompackage.json.The most important changes are:
CLI Architecture & Command Handling:
commanderlibrary, supporting subcommands and options for non-interactive usage, and providing a more standard CLI experience. The default behavior now routes to thecreatecommand, and help/version info is available. (index.js) [1] [2] [3]Flag and Argument Support:
--yesshortcut for all defaults. Includes input validation and graceful error messaging for invalid options. (index.js) [1] [2] [3]Interactive Prompt Improvements:
index.js) [1] [2]Version Handling and UX:
package.jsoninstead of a hardcoded value, improving maintainability and user awareness. (index.js)Project Generation Enhancements:
--no-installflag to skip dependency installation, with corresponding logic in the project generation flow and user feedback. (src/generate.js) [1] [2]Closes #39