Skip to content

Commit 7533751

Browse files
Merge pull request #4064 from snyk/docs/automatic-gitbook-update
Synchronizing CLI help from user-docs
2 parents 61c983d + 29bb68b commit 7533751

10 files changed

+139
-104
lines changed

help/cli-commands/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For details see the [CLI documentation](https://docs.snyk.io/features/snyk-cli)
1414

1515
## Available commands
1616

17-
To learn more about each Snyk CLI command, use the `--help` option, for example, `snyk auth --help` or `snyk container --help`
17+
To learn more about each Snyk CLI command, use the `--help` option, for example, `snyk auth --help`.
1818

1919
**Note:** The help on the docs site is the same as the `--help` in the CLI.
2020

help/cli-commands/code-test.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Code test
2+
3+
## Usage
4+
5+
`snyk code test [<OPTIONS>] [<PATH>]`
6+
7+
## Description
8+
9+
The `snyk code test` command tests for any known security issues using Static Code Analysis.
10+
11+
For more information see [Using Snyk Code via the CLI](../../products/snyk-code/cli-for-snyk-code/).
12+
13+
For instructions on ignoring issues with `snyk code test` see [Excluding directories and files from the Snyk Code CLI test](../../products/snyk-code/cli-for-snyk-code/excluding-directories-and-files-from-the-snyk-code-cli-test.md).
14+
15+
## Exit codes
16+
17+
Possible exit codes and their meaning:
18+
19+
**0**: success, no vulnerabilities found\
20+
**1**: action_needed, vulnerabilities found\
21+
**2**: failure, try to re-run command\
22+
**3**: failure, no supported projects detected
23+
24+
## Configure the Snyk CLI
25+
26+
You can use environment variables to configure the Snyk CLI and set variables for connecting with the Snyk API; see [Configure the Snyk CLI](https://docs.snyk.io/features/snyk-cli/configure-the-snyk-cli)
27+
28+
## Debug
29+
30+
Use the `-d` option to output the debug logs.
31+
32+
## Options for the code test subcommand
33+
34+
### `--org=<ORG_ID>`
35+
36+
Specify the `<ORG_ID>`to run Snyk commands tied to a specific organization. The `<ORG_ID>` influences private test limits.
37+
38+
If you have multiple organizations, you can set a default from the CLI using:
39+
40+
`$ snyk config set org=<ORG_ID>`
41+
42+
Set a default to ensure all newly tested projects are tested under your default organization. If you need to override the default, use the `--org=<ORG_ID>` option.
43+
44+
Default: `<ORG_ID>` that is the current preferred organization in your [Account settings](https://app.snyk.io/account)
45+
46+
Note that you can also use `--org=<orgslugname>`. The `ORG_ID` works in both the CLI and the API. The organization slug name works in the CLI, but not in the API.
47+
48+
For more information see the article [How to select the organization to use in the CLI](https://support.snyk.io/hc/en-us/articles/360000920738-How-to-select-the-organization-to-use-in-the-CLI)
49+
50+
### `--json`
51+
52+
Print results on the console as a JSON data structure.
53+
54+
Example: `$ snyk code test --json`
55+
56+
### `--json-file-output=<OUTPUT_FILE_PATH>`
57+
58+
Save test output as a JSON data structure directly to the specified file, regardless of whether or not you use the `--json` option.
59+
60+
Use to display the human-readable test output using stdout and at the same time save the JSON data structure output to a file. If no issues are found, an output file is not created.
61+
62+
Example: `$ snyk code test --json-file-output=vuln.json`
63+
64+
### `--sarif`
65+
66+
Return results in SARIF format.
67+
68+
Example: `$ snyk code --sarif`
69+
70+
### `--sarif-file-output=<OUTPUT_FILE_PATH>`
71+
72+
Save test output in SARIF format directly to the \<OUTPUT_FILE_PATH> file, regardless of whether or not you use the `--sarif` option.
73+
74+
Use to display the human-readable test output using stdout and at the same time save the SARIF format output to a file.
75+
76+
### `--severity-threshold=<low|medium|high|critical>`
77+
78+
Report only vulnerabilities at the specified level or higher. Note that the Snyk Code configuration issues do not currently use the `critical` severity level.

help/cli-commands/code.md

+4-67
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,16 @@
22

33
## Usage
44

5-
`snyk code [<SUBCOMMAND>] [<OPTIONS>] [<PATH>]`
5+
`snyk code [<COMMAND>] [<OPTIONS>] [<PATH>]`
66

77
## Description
88

99
The `snyk code` command finds security issues using Static Code Analysis.
1010

1111
For more information see [CLI for Snyk Code](https://docs.snyk.io/snyk-code/cli-for-snyk-code)
1212

13-
## Subcommand: `test`
13+
## `snyk code` command and the help docs
1414

15-
Test for any known issue.
15+
The `snyk code` command is identified here with the help options:
1616

17-
## Exit codes
18-
19-
Possible exit codes and their meaning:
20-
21-
**0**: success, no vulnerabilities found\
22-
**1**: action_needed, vulnerabilities found\
23-
**2**: failure, try to re-run command\
24-
**3**: failure, no supported projects detected
25-
26-
## Configure the Snyk CLI
27-
28-
You can use environment variables to configure the Snyk CLI and set variables for connecting with the Snyk API; see [Configure the Snyk CLI](https://docs.snyk.io/features/snyk-cli/configure-the-snyk-cli)
29-
30-
## Debug
31-
32-
Use the `-d` option to output the debug logs.
33-
34-
## Options for the code test subcommand
35-
36-
### `--org=<ORG_ID>`
37-
38-
Specify the `<ORG_ID>`to run Snyk commands tied to a specific organization. The `<ORG_ID>` influences private test limits.
39-
40-
If you have multiple organizations, you can set a default from the CLI using:
41-
42-
`$ snyk config set org=<ORG_ID>`
43-
44-
Set a default to ensure all newly tested projects are tested under your default organization. If you need to override the default, use the `--org=<ORG_ID>` option.
45-
46-
Default: `<ORG_ID>` that is the current preferred organization in your [Account settings](https://app.snyk.io/account)
47-
48-
Note that you can also use `--org=<orgslugname>`. The `ORG_ID` works in both the CLI and the API. The organization slug name works in the CLI, but not in the API.
49-
50-
For more information see the article [How to select the organization to use in the CLI](https://support.snyk.io/hc/en-us/articles/360000920738-How-to-select-the-organization-to-use-in-the-CLI)
51-
52-
### `--json`
53-
54-
Print results in JSON format.
55-
56-
Example: `$ snyk code test --json`
57-
58-
### `--json-file-output=<OUTPUT_FILE_PATH>`
59-
60-
Save test output in JSON format directly to the specified file, regardless of whether or not you use the `--json` option.
61-
62-
This is useful if you want to display the human-readable test output using stdout and at the same time save the JSON format output to a file.
63-
64-
Example: `$ snyk code test --json-file-output=vuln.json`
65-
66-
### `--sarif`
67-
68-
Return results in SARIF format.
69-
70-
Example: `$ snyk code --sarif`
71-
72-
### `--sarif-file-output=<OUTPUT_FILE_PATH>`
73-
74-
Save test output in SARIF format directly to the \<OUTPUT_FILE_PATH> file, regardless of whether or not you use the `--sarif` option.
75-
76-
This is especially useful if you want to display the human-readable test output using stdout and at the same time save the SARIF format output to a file.
77-
78-
### `--severity-threshold=<low|medium|high|critical>`
79-
80-
Report only vulnerabilities at the specified level or higher. Note that the Snyk Code configuration issues do not currently use the `critical` severity level.
17+
``[`code test`](code-test.md); `code test --help`: tests for any known security issues using Static Code Analysis

help/cli-commands/container-monitor.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ Manually pass a path to a `.snyk` policy file.
6060

6161
### `--json`
6262

63-
Print results in JSON format, useful for integrating with other tools
63+
Print results on the console as a JSON data structure.
6464

6565
Example: `$ snyk container test --json`
6666

67+
Note: If you use an option that sets project attributes and your role lacks permission to edit project attributes the `monitor` command fails. For instructions on how to proceed see [Editing project attributes from the Snyk CLI](https://docs.snyk.io/features/user-and-group-management/managing-users-and-permissions/managing-permissions#editing-project-attributes-from-the-snyk-cli)
68+
6769
### `--project-environment=<ENVIRONMENT>[,<ENVIRONMENT>]...>`
6870

6971
Set the project environment to one or more values (comma-separated). To clear the project environment set `--project-environment=`
@@ -98,7 +100,7 @@ To clear the project tags set `--project-tags=`
98100

99101
### `--tags=<TAG>[,<TAG>]...>`
100102

101-
This is an alias for `--project tags`
103+
This is an alias for `--project-tags`
102104

103105
### `--app-vulns`
104106

@@ -108,6 +110,14 @@ In CLI version 1.962.0 and higher, use the `--app-vulns` option with the the `--
108110

109111
For more information see [Detecting application vulnerabilities in container images](https://docs.snyk.io/products/snyk-container/getting-around-the-snyk-container-ui/detecting-application-vulnerabilities-in-container-images)
110112

113+
### `--exclude-app-vulns`
114+
115+
Allow disabling scans for app vulnerabilities in advance of `app-vulns` being enabled by default.
116+
117+
Cannot be used with `--app-vulns`.
118+
119+
For more information see [Detecting application vulnerabilities in container images](https://docs.snyk.io/products/snyk-container/getting-around-the-snyk-container-ui/detecting-application-vulnerabilities-in-container-images)
120+
111121
### `--nested-jars-depth`
112122

113123
When using `--app-vulns` use the `--nested-jars-depth` option to set how many levels of nested jars Snyk is to unpack. Depth must be a number.

help/cli-commands/container-test.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ Manually pass a path to a `.snyk` policy file.
6565

6666
### `--json`
6767

68-
Print results in JSON format, useful for integrating with other tools
68+
Print results ion the console as a JSON data structure.
6969

7070
Example: `$ snyk container test --json`
7171

7272
### `--json-file-output=<OUTPUT_FILE_PATH>`
7373

74-
Save test output in JSON format directly to the specified file, regardless of whether or not you use the `--json` option.
74+
Save test output in JSON format as a JSON data structure directly to the specified file, regardless of whether or not you use the `--json` option.
7575

76-
This is especially useful if you want to display the human-readable test output using stdout and at the same time save the JSON format output to a file.
76+
Use to display the human-readable test output using stdout and at the same time save the JSON data structure output to a file. If no issues are found, an output file is not created.
7777

7878
Example: `$ snyk container test --json-file-output=vuln.json`
7979

@@ -108,6 +108,14 @@ In CLI version 1.962.0 and higher, use the `--app-vulns` option with the the `--
108108

109109
For more information see [Detecting application vulnerabilities in container images](https://docs.snyk.io/products/snyk-container/getting-around-the-snyk-container-ui/detecting-application-vulnerabilities-in-container-images)
110110

111+
### `--exclude-app-vulns`
112+
113+
Allow disabling scans for app vulnerabilities in advance of `app-vulns` being enabled by default.
114+
115+
Cannot be used with`--app-vulns`.
116+
117+
For more information see [Detecting application vulnerabilities in container images](https://docs.snyk.io/products/snyk-container/getting-around-the-snyk-container-ui/detecting-application-vulnerabilities-in-container-images)
118+
111119
### `--nested-jars-depth`
112120

113121
When using `--app-vulns` use the `--nested-jars-depth` option to set how many levels of nested jars Snyk is to unpack. Depth must be a number.

help/cli-commands/iac-describe.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Output only the scan result to stdout.
166166

167167
### `--json`
168168

169-
Output the report as JSON to stdout.
169+
Output the report as a JSON data structure to stdout.
170170

171171
### `--html`
172172

help/cli-commands/iac-test.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ Manually pass a path to a `.snyk` policy file.
6565

6666
### `--json`
6767

68-
Print results in JSON format.
68+
Print results on the console as a JSON data structure.
6969

7070
Example: `$ snyk iac test --json`
7171

7272
### `--json-file-output=<OUTPUT_FILE_PATH>`
7373

74-
Save test output in JSON format directly to the specified file, regardless of whether or not you use the `--json` option.
74+
Save test output as a JSON data structure directly to the specified file, regardless of whether or not you use the `--json` option.
7575

76-
This is especially useful if you want to display the human-readable test output using stdout and at the same time save the JSON format output to a file.
76+
Use to display the human-readable test output using stdout and at the same time save the JSON data structure output to a file. If no issues are found, an output file is not created.
7777

7878
Example: `$ snyk iac test --json-file-output=vuln.json`
7979

@@ -87,6 +87,8 @@ Save test output in SARIF format directly to the \<OUTPUT_FILE_PATH> file, regar
8787

8888
This is especially useful if you want to display the human-readable test output using stdout and at the same time save the SARIF format output to a file.
8989

90+
Note: If you use an option that sets project attributes and your role lacks permission to edit project attributes the `iac test` command fails. For instructions on how to proceed see [Editing project attributes from the Snyk CLI](https://docs.snyk.io/features/user-and-group-management/managing-users-and-permissions/managing-permissions#editing-project-attributes-from-the-snyk-cli)
91+
9092
### `--project-business-criticality=<BUSINESS_CRITICALITY>[,<BUSINESS_CRITICALITY>]...>`
9193

9294
This can be used in combination with the `--report` option.
@@ -97,6 +99,8 @@ Allowed values: `critical, high, medium, low`
9799

98100
For more information see [Project attributes](https://docs.snyk.io/getting-started/introduction-to-snyk-projects/view-project-information/project-attributes)
99101

102+
This option is not supported for Integrated IaC (Limited Availability).
103+
100104
### `--project-environment=<ENVIRONMENT>[,<ENVIRONMENT>]...>`
101105

102106
This can be used in combination with the `--report` option.
@@ -107,6 +111,8 @@ Allowed values: `frontend`, `backend`, `internal`, `external`, `mobile`, `saas`,
107111

108112
For more information see [Project attributes](https://docs.snyk.io/getting-started/introduction-to-snyk-projects/view-project-information/project-attributes)
109113

114+
This option is not supported for Integrated IaC (Limited Availability).
115+
110116
### `--project-lifecycle=<LIFECYCLE>[,<LIFECYCLE>]...>`
111117

112118
This can be used in combination with the `--report` option.
@@ -117,6 +123,8 @@ Allowed values: `production`, `development`, `sandbox`
117123

118124
For more information see [Project attributes](https://docs.snyk.io/getting-started/introduction-to-snyk-projects/view-project-information/project-attributes)
119125

126+
This option is not supported for Integrated IaC (Limited Availability).
127+
120128
### `--project-tags=<TAG>[,<TAG>]...>`
121129

122130
This can be used in combination with the `--report` option.
@@ -127,6 +135,8 @@ Example: `--project-tags=department=finance,team=alpha`
127135

128136
To clear the project tags set `--project-tags=`
129137

138+
This option is not supported for Integrated IaC (Limited Availability).
139+
130140
### `--remote-repo-url=<URL>`
131141

132142
This can be used in combination with the `--report` option.
@@ -147,14 +157,16 @@ Note: This option cannot be used in combination with the `--rules` option.
147157

148158
Use this dedicated option for Custom Rules scanning to enable the IaC scans to use a custom rules bundle generated with the `snyk-iac-rules` SDK. See [`snyk-iac-rules` SDK](https://github.com/snyk/snyk-iac-rules#readme)
149159

150-
This option cannot be used if the custom rules settings were configured with the Snyk UI. Default: If the `--rules` flag is not specified, scan the configuration files using the internal Snyk rules only.
160+
This option cannot be used if the custom rules settings were configured with the Snyk UI. Default: If the `--rules` option is not specified, scan the configuration files using the internal Snyk rules only.
151161

152162
Example: Scan the configuration files using custom rules and internal Snyk rules.
153163

154164
`--rules=bundle.tar.gz`
155165

156166
Note: This option can not be used in combination with the `--report` option.
157167

168+
This option is not supported for Integrated IaC (Limited Availability).
169+
158170
### `--severity-threshold=<low|medium|high|critical>`
159171

160172
Report only vulnerabilities at the specified level or higher.
@@ -172,7 +184,7 @@ This can be used in combination with the `--report` option.
172184

173185
Set or override the project name for the repository.&#x20;
174186

175-
Note: This flag will supersede the `--remote-repo-url`, if used together.
187+
Note: This option supersedes`--remote-repo-url`, if both options are used together.
176188

177189
### `--target-reference=<TARGET_REFERENCE>`
178190

help/cli-commands/ignore.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
OR
88

9-
`snyk ignore [--expiry=] [--reason=] [--policy-path=<PATH_TO_POLICY_FILE>] --file-path=<PATH_TO_RESOURCE>] [OPTIONS]`
9+
`snyk ignore [--expiry=] [--reason=] [--policy-path=<PATH_TO_POLICY_FILE>] [--file-path=<PATH_TO_RESOURCE>] [OPTIONS]`
1010

1111
## Description
1212

help/cli-commands/monitor.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Can be used with `--all-projects` and `--yarn-workspaces` to indicate directory
6464

6565
Example: `$ snyk test --all-projects --exclude=dir1,file2`
6666

67-
This will exclude any directories and files named "dir1" and "file2" when scanning for project manifest files. Such as: "./dir1", "./src/dir1", "./file2", "./src/file2", and so on.
67+
This will exclude any directories and files named `dir1` and `file2` when scanning for project manifest files such as: `./dir1`, `./src/dir1`, `./file2`, `./src/file2` and so on.
6868

6969
### `--prune-repeated-subdependencies`, `-p`
7070

@@ -148,7 +148,9 @@ Manually pass a path to a `.snyk` policy file.
148148

149149
### `--json`
150150

151-
Print results in JSON format.
151+
Print results on the console as a JSON data structure.
152+
153+
Note: If you use an option that sets project attributes and your role lacks permission to edit project attributes the `monitor` command fails. For instructions on how to proceed see [Editing project attributes from the Snyk CLI](https://docs.snyk.io/features/user-and-group-management/managing-users-and-permissions/managing-permissions#editing-project-attributes-from-the-snyk-cli)
152154

153155
### `--project-environment=<ENVIRONMENT>[,<ENVIRONMENT>]...>`
154156

@@ -302,19 +304,13 @@ The following `snyk monitor` options can be used with `--unmanaged` as documente
302304

303305
There are also special options.
304306

305-
### `--target-dir`
306-
307-
Scan the path specified in the argument instead of the current directory.
308-
309-
Alternatively, run `snyk test --unmanaged`
310-
311307
### `--max-depth`
312308

313309
Specify the maximum level of archive extraction.
314310

315311
Usage: `--max-depth=1`&#x20;
316312

317-
Use 0 to disable archive extraction completely.
313+
Use 0 (zero, the default) to disable archive extraction completely.
318314

319315
### `--print-dep-paths`
320316

0 commit comments

Comments
 (0)