vigilsutra 0.2.2 → 0.2.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.3 - 2026-11-06
4
+
5
+ - `vigilsutra audit` and `vigilsutra report` always write `vigilsutra-report/report.md` and `report.html` (plus `results.json` and `results.sarif`), including when the command is piped or run in CI. The short summary stays on stdout. `--no-report` skips the files. The folder notice goes to stderr so JSON and SARIF on stdout stay valid.
6
+
3
7
  ## 0.2.2 - 2026-11-06
4
8
 
5
9
  - Local `.env` files are no longer reviewed when git does not track them. `VS-SECRET-006` and the other rules see an environment file only if it is listed in the git index, or if the folder has no usable git index. `.env.example`, `.env.sample`, and `.env.template` are unchanged. The check reads the index file directly and does not run `git`. Path compare follows `core.ignorecase` (on by default for Windows and macOS).
package/README.md CHANGED
@@ -69,7 +69,7 @@ node dist/cli.js audit examples/intentionally-insecure
69
69
 
70
70
  > Published on npm: <https://www.npmjs.com/package/vigilsutra>. You can also install from GitHub: `npm install -g github:shahvatsalofficial/vigilsutra`. Try the demo project after cloning: `vigilsutra audit examples/intentionally-insecure`.
71
71
 
72
- **Reports as files (easy to read and share).** Run `vigilsutra report .` (or `vigilsutra audit .` in a terminal) and open `vigilsutra-report/report.html` in a browser. The folder also has `report.md`, `results.json` and `results.sarif`, and a `.gitignore` so reports are not committed by accident.
72
+ **Reports as files (easy to read and share).** `vigilsutra audit .` and `vigilsutra report .` write `vigilsutra-report/report.html` and `vigilsutra-report/report.md` every time, including in CI and when output is piped. Open the HTML file in a browser. The folder also has `results.json` and `results.sarif`, and a `.gitignore` so reports are not committed by accident. `--no-report` skips the files.
73
73
 
74
74
  Everyday use:
75
75
 
@@ -112,7 +112,7 @@ Full sample reports (labelled as samples, generated from the demo project): [HTM
112
112
  | Command | What it does |
113
113
  |---|---|
114
114
  | `vigilsutra report [path]` | Scan and write `report.md`, `report.html`, `results.json`, `results.sarif` to `./vigilsutra-report/` (or `--report-dir`). |
115
- | `vigilsutra audit [path]` | Read-only scan. Formats: `text`, `json`, `markdown`, `sarif`, `html`. Flags: `--out`, `--fail-on`, `--baseline`, `--policy`, `--no-policy`, `--report`, `--report-dir`, `--no-report`, `--no-color`. In a terminal, with no `--format` or `--out`, it also writes the report folder. |
115
+ | `vigilsutra audit [path]` | Read-only scan. Always writes `vigilsutra-report/report.md` and `report.html` (plus JSON and SARIF) unless `--no-report`. Formats for stdout or `--out`: `text`, `json`, `markdown`, `sarif`, `html`. Other flags: `--fail-on`, `--baseline`, `--policy`, `--no-policy`, `--report-dir`, `--no-color`. |
116
116
  | `vigilsutra baseline --out f.json` | Record current findings as accepted, so CI fails only on new ones. |
117
117
  | `vigilsutra verify --previous results.json` | Re-scan and show what is no longer detected, remaining, or new. |
118
118
  | `vigilsutra rules list` / `explain <ID>` | Browse rules, fixes and false-positive notes. |
package/dist/cli.js CHANGED
@@ -19,11 +19,11 @@ Commands:
19
19
  --baseline <file> Suppress findings whose fingerprints are in this baseline
20
20
  --policy <file> Use this policy file instead of the project's .vigilsutra.yml
21
21
  --no-policy Ignore the project's .vigilsutra.yml (use when auditing code you do not own)
22
- --report Also write report.md, report.html, results.json, results.sarif to ./vigilsutra-report/
22
+ --report Write report.md and report.html (also results.json and results.sarif) to ./vigilsutra-report/. This is the default.
23
23
  --report-dir <dir> Same, into <dir>
24
- --no-report Do not write report files (they are written by default when you run audit in a terminal without --format/--out)
24
+ --no-report Do not write those files
25
25
  --no-color Plain output (also honours NO_COLOR)
26
- report [path] Scan and write the report files (Markdown + HTML + JSON + SARIF), then print the summary
26
+ report [path] Same scan as audit. Always writes report.md and report.html (plus JSON and SARIF)
27
27
  baseline [path] --out <file> Record current findings as an accepted baseline
28
28
  verify [path] --previous <results.json> Re-scan and compare with an earlier JSON result
29
29
  rules list List implemented rules
@@ -125,19 +125,12 @@ function main() {
125
125
  }
126
126
  else
127
127
  process.stdout.write(render(result, format, color));
128
- // Reports as files: always for `report`, on request, and by default for an interactive `audit` with no explicit format or file.
129
- const explicitOutput = flags.has("format") || typeof out === "string";
128
+ // Readable reports are files, not only a terminal scrollback. Stdout stays the chosen format.
130
129
  const dirFlag = flags.get("report-dir");
131
- const wantReport = cmd === "report" || flags.has("report") || typeof dirFlag === "string" || (!flags.has("no-report") && !explicitOutput && !!process.stdout.isTTY);
132
- if (wantReport) {
130
+ if (!flags.has("no-report")) {
133
131
  const dir = resolve(typeof dirFlag === "string" ? dirFlag : "vigilsutra-report");
134
132
  writeReportFolder(dir, result);
135
- process.stdout.write(`
136
- Reports written to ${dir}
137
- report.html open this in a browser
138
- report.md Markdown version
139
- results.json, results.sarif for tools and CI
140
- `);
133
+ process.stderr.write(`Reports written to ${dir}\n report.html open this in a browser\n report.md Markdown version\n results.json, results.sarif for tools and CI\n`);
141
134
  }
142
135
  if (failOn && exceeds(result, failOn))
143
136
  process.exit(1);
package/dist/engine.js CHANGED
@@ -7,7 +7,7 @@ import { inventory } from "./scope.js";
7
7
  import { DEFAULT_POLICY, loadPolicy } from "./policy.js";
8
8
  import { redactSpan, scrubTokens, tidy } from "./redact.js";
9
9
  import { SEVERITY_ORDER } from "./types.js";
10
- export const VERSION = "0.2.2";
10
+ export const VERSION = "0.2.3";
11
11
  /** Per rule, per file. Keeps one noisy file from producing an unbounded report. */
12
12
  export const MAX_PER_RULE_PER_FILE = 200;
13
13
  function sha(s) {
@@ -39,7 +39,8 @@ docker run --rm --network none -v "$PWD":/work:ro -v /path/to/vigilsutra:/vs:ro
39
39
 
40
40
  ## Get a readable report
41
41
  ```bash
42
- vigilsutra report . # writes ./vigilsutra-report/report.html, report.md, results.json, results.sarif
42
+ vigilsutra audit . # writes ./vigilsutra-report/report.html and report.md (also JSON and SARIF)
43
+ vigilsutra report . # same files
43
44
  ```
44
45
  Open `report.html` in a browser, or `report.md` in any Markdown viewer. The folder has its own `.gitignore`; reports contain file paths and redacted excerpts, so do not publish them for private projects.
45
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigilsutra",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "VigilSutra AI: open-source, offline-first security and privacy auditor CLI plus AI agent skills. Finds secrets, CI/CD, Docker, Kubernetes, IaC, code and AI-agent risks with redacted, evidence-based SARIF/JSON/Markdown reports. No API key, no telemetry.",
5
5
  "keywords": [
6
6
  "security",