Skip to content

Commit bf3a7cf

Browse files
committed
Document new CLI output flag and clarify intended usage
Signed-off-by: lelia <lelia@socket.dev>
1 parent e329f32 commit bf3a7cf

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,27 @@ This will:
9494
- Save to `gl-dependency-scanning-report.json`
9595
- Include all actionable security alerts (error/warn level)
9696

97+
**Save SARIF report to file (e.g. for GitHub Code Scanning, SonarQube, or VS Code):**
98+
```bash
99+
socketcli --sarif-file results.sarif \
100+
--repo owner/repo \
101+
--target-path .
102+
```
103+
97104
**Multiple output formats:**
98105
```bash
99106
socketcli --enable-json \
100-
--enable-sarif \
107+
--sarif-file results.sarif \
101108
--enable-gitlab-security \
102109
--repo owner/repo
103110
```
104111

105112
This will simultaneously generate:
106113
- JSON output to console
107-
- SARIF format to console
108-
- GitLab Security Dashboard report to file
114+
- SARIF report to `results.sarif` (and stdout)
115+
- GitLab Security Dashboard report to `gl-dependency-scanning-report.json`
116+
117+
> **Note:** `--enable-sarif` prints SARIF to stdout only. Use `--sarif-file <path>` to save to a file (this also implies `--enable-sarif`). These are independent from `--enable-gitlab-security`, which produces a separate GitLab-specific Dependency Scanning report.
109118
110119
### Requirements
111120

@@ -121,7 +130,7 @@ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--workspace WORKSPACE] [--
121130
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--license-file-name LICENSE_FILE_NAME] [--save-submitted-files-list SAVE_SUBMITTED_FILES_LIST]
122131
[--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
123132
[--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
124-
[--enable-json] [--enable-sarif] [--enable-gitlab-security] [--gitlab-security-file <path>]
133+
[--enable-json] [--enable-sarif] [--sarif-file <path>] [--enable-gitlab-security] [--gitlab-security-file <path>]
125134
[--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
126135
[--ignore-commit-files] [--disable-blocking] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
127136
[--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT]
@@ -189,7 +198,8 @@ If you don't want to provide the Socket API Token every time then you can use th
189198
| --generate-license | False | False | Generate license information |
190199
| --enable-debug | False | False | Enable debug logging |
191200
| --enable-json | False | False | Output in JSON format |
192-
| --enable-sarif | False | False | Enable SARIF output of results instead of table or JSON format |
201+
| --enable-sarif | False | False | Enable SARIF output of results instead of table or JSON format (prints to stdout) |
202+
| --sarif-file | False | | Output file path for SARIF report (implies --enable-sarif). Use this to save SARIF output to a file for upload to GitHub Code Scanning, SonarQube, VS Code, or other SARIF-compatible tools |
193203
| --enable-gitlab-security | False | False | Enable GitLab Security Dashboard output format (Dependency Scanning report) |
194204
| --gitlab-security-file | False | gl-dependency-scanning-report.json | Output file path for GitLab Security report |
195205
| --disable-overview | False | False | Disable overview output |
@@ -725,13 +735,13 @@ socketcli --enable-gitlab-security --gitlab-security-file custom-path.json
725735
GitLab security reports can be generated alongside other output formats:
726736
727737
```bash
728-
socketcli --enable-json --enable-gitlab-security --enable-sarif
738+
socketcli --enable-json --enable-gitlab-security --sarif-file results.sarif
729739
```
730740
731741
This command will:
732742
- Output JSON format to console
733743
- Save GitLab Security Dashboard report to `gl-dependency-scanning-report.json`
734-
- Save SARIF report (if configured)
744+
- Save SARIF report to `results.sarif`
735745
736746
### Security Dashboard Features
737747

0 commit comments

Comments
 (0)