git-cli-scanner 1.1.6 → 1.2.0

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.
Files changed (2) hide show
  1. package/dist/cli.js +10 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -811,7 +811,7 @@ var Spinner = class {
811
811
  var fs3 = __toESM(require("fs"));
812
812
  var path3 = __toESM(require("path"));
813
813
  var program = new import_commander.Command();
814
- program.name("git-cli-scanner").description("Interactive Git hooks vulnerability scanner").version("1.1.6");
814
+ program.name("git-cli-scanner").description("Interactive Git hooks vulnerability scanner").version("1.2.0");
815
815
  program.command("init").description("Install pre-commit hook for automatic scanning").action(() => {
816
816
  info("Setting up pre-commit hook...");
817
817
  try {
@@ -863,16 +863,22 @@ program.command("disable").description("Remove the pre-commit hook and disable a
863
863
  program.command("scan").description("Scan staged files for vulnerabilities").option("--show-sol", "Show solutions for vulnerabilities").option("--hook", "Internal flag used when running as a git hook").action(async (options) => {
864
864
  info("Git CLI Scanner running...");
865
865
  try {
866
- const spinner = new Spinner([
866
+ const spinnerMsgs = options.hook ? [
867
867
  "Scanning staged files for vulnerabilities...",
868
868
  "Analyzing code patterns...",
869
869
  "Checking for exposed API keys...",
870
+ "Thinking..."
871
+ ] : [
872
+ "Scanning entire repository for vulnerabilities...",
873
+ "Analyzing code patterns...",
874
+ "Checking for exposed API keys...",
870
875
  "Inspecting hidden files and directories...",
871
876
  "Thinking..."
872
- ]);
877
+ ];
878
+ const spinner = new Spinner(spinnerMsgs);
873
879
  spinner.start();
874
880
  await new Promise((resolve2) => setTimeout(resolve2, 3e3));
875
- const issues = await scanDiff();
881
+ const issues = options.hook ? await scanDiff() : await scanDirectory(process.cwd());
876
882
  if (issues.length > 0) {
877
883
  const blockerIssues = issues.filter((i) => i.severity !== "dummy");
878
884
  spinner.fail(`Found ${issues.length} potential vulnerabilities! (${blockerIssues.length} blockers)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-cli-scanner",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
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": {