Skip to content

Commit

Permalink
Merge pull request #5506 from snyk/docs/automatic-gitbook-update
Browse files Browse the repository at this point in the history
docs: Synchronizing CLI help from user-docs
  • Loading branch information
thisislawatts authored Oct 2, 2024
2 parents d829b4d + 5f333fc commit ada3165
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
12 changes: 6 additions & 6 deletions help/cli-commands/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ OAuth provides improved security by issuing shorter-lived expiring authorization

Earlier versions of the Snyk CLI (< 1.1293) obtained a non-expiring API token through a legacy browser interaction.

This authentication method is deprecated but you may use it in the event of problems with OAuth by running `snyk auth --auth-type=token`. A future release of the CLI will remove this option.
The Snyk API token can still be used as a fallback option. You must explicitly add an option to enable it as follows: `snyk auth --auth-type=token`.

## Options

### `--auth-type=<TYPE>`

Specify the \<TYPE> of authentication to use. Supported types are `oauth` (the default beginning with version 1.1293.0) AND `token`.

### `--client-secret=<SECRET>`

### `--client-id=<ID>`
### `--client-secret=<SECRET>` and `--client-id=<ID>`

You can set the client secret and the id can be set in order to use the [OAuth2 Client Credentials Grant](https://docs.snyk.io/enterprise-configuration/service-accounts/service-accounts-using-oauth-2.0#oauth-2.0-with-client-secret)

Both values must be provided together. They are only valid together with `--auth-type=oauth;`otherwise they will be ignored.&#x20;

## Value
For information about how to get the `<SECRET>` and the `<ID>`, see [Service accounts using OAuth 2.0](https://docs.snyk.io/enterprise-setup/service-accounts/service-accounts-using-oauth-2.0#oauth-2.0-with-client-secret)

## Token value

In some environments and configurations, you must use the `<API_TOKEN>`; see [Authenticate the CLI with your account](https://docs.snyk.io/snyk-cli/authenticate-the-cli-with-your-account)

The value may be a user token or a service account; see [Service accounts](https://docs.snyk.io/enterprise-setup/service-accounts)
The value may be a user token or a service account token; see [Service accounts](https://docs.snyk.io/enterprise-setup/service-accounts)

In a CI/CD environment, use the `SNYK_TOKEN` environment variable; see [Configure the Snyk CLI](https://docs.snyk.io/snyk-cli/configure-the-snyk-cli)

Expand Down
4 changes: 2 additions & 2 deletions help/cli-commands/code-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Description

The `snyk code test` command tests for any known security issues using Static Code Analysis.
The `snyk code test` command tests source code for any known security issues (Static Application Security Testing).

## Exit codes

Expand Down Expand Up @@ -67,7 +67,7 @@ Save test output as a JSON data structure directly to the specified file, regard

Use to display the human-readable test output using stdout and, at the same time, save the JSON data structure output to a file.

For SAST, if no issues are found, Snyk does not create a `json` file. In contrast, for open-source, Snyk creates a file whether or not issues are found.&#x20;
For SAST, if no issues are found, Snyk does not create a `json` file. In contrast, for open-source, Snyk creates a file whether or not issues are found.

Example: `$ snyk code test --json-file-output=vuln.json`

Expand Down
2 changes: 1 addition & 1 deletion help/cli-commands/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ For more information, see [CLI for Snyk Code](https://docs.snyk.io/snyk-cli/scan

The single`snyk code` command is identified here with the help options:

[`code test`](code-test.md); `code test --help`: tests for any known security issues using Static Code Analysis
[`code test`](code-test.md); `code test --help`: Test source code for any known security issues (Static Application Security Testing).
10 changes: 8 additions & 2 deletions help/cli-commands/monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,15 @@ For a Python project, specify a particular file to monitor.

Default: Snyk scans the requirements.txt file at the top level of the project.

Snyk can recognize any manifest files specified with this option based on `--file=req*.txt`. The `*` is a wildcard and `req` can appear anywhere in the file name.
**Important:** When specifying a value for the `--file` parameter that is not the default file, you must also include the `--package-manager=pip` option. The test will fail without this parameter.

For example, Snyk recognizes your manifest file when you have renamed it to `requirements-dev.txt`.
Always specify this parameter with the value `pip` when using a custom `--file` value. For example:

```bash
snyk test --file=requirements-dev.txt --package-manager=pip
```

This allows Snyk to correctly recognize and scan your specified manifest file, such as when you have renamed it to `requirements-dev.txt`.

### `--package-manager=pip`

Expand Down
12 changes: 9 additions & 3 deletions help/cli-commands/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ For more information see the article [How to select the Organization to use in t

Specify a package file.

When testing locally or monitoring a project, you can specify the file that Snyk should inspect for package information. When the file is not specified, Snyk tries to detect the appropriate file for your project.
When you are testing locally or monitoring a project, you can specify the file that Snyk should inspect for package information. When the file is not specified, Snyk tries to detect the appropriate file for your project.

See also the section on [Options for Python projects](https://docs.snyk.io/snyk-cli/commands/test#options-for-python-projects)

Expand Down Expand Up @@ -448,9 +448,15 @@ For a Python project, specify a particular file to test.

Default: Snyk scans the requirements.txt file at the top level of the project.

Snyk can recognize any manifest files specified with this option based on `--file=req*.txt`. The `*` is a wildcard and `req` can appear anywhere in the file name.
**Important:** When specifying a value for the `--file` parameter that is not the default file, you must also include the `--package-manager=pip` option. The test will fail without this parameter.

For example, Snyk recognizes your manifest file when you have renamed it to `requirements-dev.txt`.
Always specify this parameter with the value `pip` when using a custom `--file` value. For example:

```bash
snyk test --file=requirements-dev.txt --package-manager=pip
```

This allows Snyk to correctly recognize and scan your specified manifest file, such as when you have renamed it to `requirements-dev.txt`.

### `--package-manager=pip`

Expand Down

0 comments on commit ada3165

Please sign in to comment.