git-cli-scanner 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +23 -16
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -588,6 +588,7 @@ var init_explorer = __esm({
|
|
|
588
588
|
} else if (selected.type === "file") {
|
|
589
589
|
const fullPath = path2.join(currentPath, selected.nameRaw);
|
|
590
590
|
setScanningFile(fullPath);
|
|
591
|
+
setScanResult(null);
|
|
591
592
|
const issues = await scanDirectory(currentPath);
|
|
592
593
|
const fileIssues = issues.filter((i) => i.file === path2.relative(process.cwd(), fullPath).replace(/\\/g, "/"));
|
|
593
594
|
setScanResult(fileIssues);
|
|
@@ -599,29 +600,32 @@ var init_explorer = __esm({
|
|
|
599
600
|
setScanResult(null);
|
|
600
601
|
} else if ((0, import_core.isUpKey)(key)) {
|
|
601
602
|
setSelectedIndex((prev) => prev > 0 ? prev - 1 : choices.length - 1);
|
|
603
|
+
setScanResult(null);
|
|
602
604
|
} else if ((0, import_core.isDownKey)(key)) {
|
|
603
605
|
setSelectedIndex((prev) => prev < choices.length - 1 ? prev + 1 : 0);
|
|
606
|
+
setScanResult(null);
|
|
604
607
|
} else if (key.name === "c" && key.ctrl) {
|
|
605
608
|
done("");
|
|
606
609
|
}
|
|
607
610
|
});
|
|
611
|
+
const page = (0, import_core.usePagination)({
|
|
612
|
+
items: choices,
|
|
613
|
+
active: selectedIndex,
|
|
614
|
+
renderItem: ({ item, isActive }) => {
|
|
615
|
+
if (isActive) {
|
|
616
|
+
return import_picocolors3.default.cyan(`\u276F ${item.name}`);
|
|
617
|
+
}
|
|
618
|
+
return ` ${item.name}`;
|
|
619
|
+
},
|
|
620
|
+
pageSize: 15,
|
|
621
|
+
loop: false
|
|
622
|
+
});
|
|
608
623
|
let message = `${prefix} ${import_picocolors3.default.bold("Exploring:")} ${import_picocolors3.default.cyan(currentPath)}
|
|
609
624
|
|
|
610
|
-
`;
|
|
611
|
-
const startIndex = Math.max(0, selectedIndex - 10);
|
|
612
|
-
const endIndex = Math.min(choices.length, startIndex + 20);
|
|
613
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
614
|
-
const choice = choices[i];
|
|
615
|
-
if (i === selectedIndex) {
|
|
616
|
-
message += import_picocolors3.default.cyan(`\u276F ${choice.name}
|
|
617
|
-
`);
|
|
618
|
-
} else {
|
|
619
|
-
message += ` ${choice.name}
|
|
620
|
-
`;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
625
|
+
${page}`;
|
|
623
626
|
if (scanResult) {
|
|
624
627
|
message += `
|
|
628
|
+
|
|
625
629
|
${import_picocolors3.default.bold("Scan Results for " + choices[selectedIndex].nameRaw + ":")}
|
|
626
630
|
`;
|
|
627
631
|
if (scanResult.length === 0) {
|
|
@@ -630,13 +634,16 @@ ${import_picocolors3.default.bold("Scan Results for " + choices[selectedIndex].n
|
|
|
630
634
|
scanResult.forEach((issue) => {
|
|
631
635
|
message += ` ${issue.severity === "high" ? import_picocolors3.default.red("\u25CF HIGH") : issue.severity === "medium" ? import_picocolors3.default.yellow("\u25CF MEDIUM") : import_picocolors3.default.dim("\u25CB DUMMY")} \xB7 ${issue.type}
|
|
632
636
|
`;
|
|
633
|
-
|
|
637
|
+
if (issue.solution) {
|
|
638
|
+
message += ` Fix: ${import_picocolors3.default.green(issue.solution)}
|
|
634
639
|
`;
|
|
640
|
+
}
|
|
635
641
|
});
|
|
636
642
|
}
|
|
637
643
|
} else if (scanningFile) {
|
|
638
644
|
message += `
|
|
639
|
-
|
|
645
|
+
|
|
646
|
+
${import_picocolors3.default.yellow("Scanning...")} (Please wait)
|
|
640
647
|
`;
|
|
641
648
|
}
|
|
642
649
|
return message;
|
|
@@ -706,7 +713,7 @@ var Spinner = class {
|
|
|
706
713
|
var fs3 = __toESM(require("fs"));
|
|
707
714
|
var path3 = __toESM(require("path"));
|
|
708
715
|
var program = new import_commander.Command();
|
|
709
|
-
program.name("git-cli-scanner").description("Interactive Git hooks vulnerability scanner").version("1.1.
|
|
716
|
+
program.name("git-cli-scanner").description("Interactive Git hooks vulnerability scanner").version("1.1.2");
|
|
710
717
|
program.command("init").description("Install pre-commit hook for automatic scanning").action(() => {
|
|
711
718
|
info("Setting up pre-commit hook...");
|
|
712
719
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-cli-scanner",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "A powerful interactive CLI tool that scans your codebase for hardcoded secrets, API keys, passwords, and private keys before they reach your Git history.",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"scripts": {
|