Repository navigation
feat(cli): [NSoC_2026] allow choosing between Blank and Husky in secureflow --init (#1758) - #1801
Merged
GauravKarakoti merged 1 commit intoNov 16, 2026
Conversation
|
@Myparadox-creator is attempting to deploy a commit to the Gaurav's projects Team on Vercel. A member of the Team first needs to authorize it. |
| message = `Appended npx secureflow to existing prepare script ("${pkg.scripts.prepare}")`; | ||
| } | ||
|
|
||
| fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8"); |
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.
Description
Summary of Changes
by updating the
secureflow --initcommand to allow users to choose between Blank and Husky initialization modes.Interactive Prompt & Flag Detection (
cli/src/lib/tui.ts):InitMode = "husky" | "blank".detectInitMode(argv)to support CLI flags/arguments:--blank,-b,--husky,--init=blank,--init blank,--init=husky, and--init husky.promptInitChoice(rl, stdin, stdout)using native Node.jsreadlineto provide a clean interactive selection menu when running in an interactive terminal."husky"when in non-interactive / CI environments if no flag is specified.Blank Mode Initialization (
initBlankPrepareScript):package.jsonexists; if not, runsnpm init --yto initialize the project directory.package.jsonand configures the"prepare"lifecycle script:scriptsobject exists, initializes it.preparescript exists, sets"prepare": "npx secureflow".preparescript is already present, appends&& npx secureflow(e.g."prepare": "xyz && npx secureflow").secureflowis already part of thepreparescript to avoid redundant duplications.package.jsoncleanly with 2-space indentation and trailing newline.Greeting & CLI Help Updates:
formatInitGreeting: tailored next steps based on initialization mode (for Blank mode, highlightsnpm run preparelifecycle execution; for Husky mode, highlights git pre-commit hook scanning).cli/src/index.ts: updated CLI options and help menu to document--init,--husky, and--blank.Test Coverage:
cli/src/lib/tui.test.tscoveringinitBlankPrepareScript,detectInitMode,promptInitChoice,initSecureFlow, and greeting output.cli/src/index.test.tsverifying CLI execution for--initwith both success and failure exit codes.31/31intui.test.ts,31/31inindex.test.ts).Changeset:
.changeset/init-blank-husky-choice-1758.mdforsecureflow-climinor release.PR Checklist
[NSoC_2026]tag requirementRelated Issue
Closes #1758