> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hiddenlayer.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Command-Line Arguments

## Volume Mounts

![Volume Mounts](https://mintcdn.com/hiddenlayer/juWnYrc47tp9n2GG/docs/products/supply-chain/cli/images/volume_mount_diagram.png?fit=max\&auto=format\&n=juWnYrc47tp9n2GG\&q=85\&s=268bf4d06ded763e72cc15bddbe3a08c)

* AI Supply Chain Security CLI requires its input - the model(s) to be scanned - to be made available to the running Docker container through a mounted volume.
* AI Supply Chain Security CLI can optionally write scan results to a file within a mounted volume.
* All file paths provided in command-line argument to the container are with respect to the container’s file system, not the local file system.
* See the [Docker documentation](https://docs.docker.com/reference/cli/docker/container/run/#volume) for more information.

**Example**

* Suppose that the models to be scanned are located on the local machine in `/home/user/models`.
* Supply Chain CLI’s scan results should be output to the local machine in `/home/user/results`.
* Examples use the Supply Chain CLI image from [Deploy Supply Chain CLI](https://docs.hiddenlayer.ai/docs/products/supply-chain/cli/install_model_scanner_cli.md).

In this case, volume mounts could be specified as follows:

```sh macOS theme={null}
docker run --rm \
  -e HL_LICENSE \
  -v /home/user/models:/files-to-scan \
  -v /home/user/results:/scan-results \
  images.hiddenlayer.ai/proxy/supply-chain-security/ghcr.io/hiddenlayer-engineering/supply-chain-scanner:26.9.0 \
  --input /files-to-scan \
  --output /scan-results/results.json
```

```sh Linux theme={null}
docker run --rm \
  -e HL_LICENSE \
  -v /home/user/models:/files-to-scan \
  -v /home/user/results:/scan-results \
  images.hiddenlayer.ai/proxy/supply-chain-security/ghcr.io/hiddenlayer-engineering/supply-chain-scanner:26.9.0 \
  --input /files-to-scan \
  --output /scan-results/results.json
```

```sh Windows theme={null}
docker run --rm ^
  -e HL_LICENSE ^
  -v c:\work\models:/files-to-scan ^
  -v c:\work\models\results:/scan-results ^
  images.hiddenlayer.ai/proxy/supply-chain-security/ghcr.io/hiddenlayer-engineering/supply-chain-scanner:26.9.0 ^
  --input /files-to-scan ^
  --output /scan-results/results.json
```

> [!NOTE]
>
> **Runtime Security Version**
>
> Examples use the Supply Chain CLI image from [Deploy Supply Chain CLI](https://docs.hiddenlayer.ai/docs/products/supply-chain/cli/install_model_scanner_cli.md).

## Supply Chain CLI

### Input

<table><thead><tr><th>Argument</th><th>Required</th><th>Example Usage</th><th>Description</th></tr></thead><tbody><tr><td>`--input {{file}}`</td><td>yes</td><td>`--input /files-to-scan/my_model.torch`</td><td>An absolute file or directory path to scan:<ul><li>Must be a path that is accessible through the Docker container filesystem. See [Volume Mounts](https://docs.hiddenlayer.ai/docs/products/supply-chain/cli/commandline_arguments.md#volume-mounts) below for more information.</li><li>Each directory provided, if any, is recursively traversed.</li><li>Takes precedence over both the `--include-pattern` and `--exclude-pattern` flags. An individually specified file in the --input flag will be scanned even if it does not match any specified `--include-pattern` and/or matches any specified `--exclude-pattern`.</li><li>A [presigned URL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html) to a single object in Amazon S3.</li><li>A URL with a [shared access signature](https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview) to an object in Azure Blob Storage.</li><li>A protocol specific URL for Blob Storage.<ul><li>Amazon S3: `s3://some-bucket/some-prefix`</li><li>Google Cloud Storage: `gs://some-bucket/some-prefix`</li></ul></li><li>A Hugging Face repository URL that includes the username and repository name. See [Scan a Hugging Face Repository](https://docs.hiddenlayer.ai/docs/products/supply-chain/cli/usage_examples.md#scan-a-hugging-face-repository) for more details and examples.<ul><li>`https://huggingface.co/{{username}}/{{repo_name}}`</li><li>Can scan private or gated repositories with Hugging Face token.</li></ul></li><li>An OCI container image reference for supported registries. NVIDIA NIM containers use the `oci://` scheme and require the `NGC_API_KEY` environment variable:<ul><li>Amazon public ECR: `oci://public.ecr.aws/docker/library/alpine:latest`</li><li>Amazon private ECR: `123456789012.dkr.ecr.us-east-1.amazonaws.com/myrepo:latest`</li><li>[NIM Containers](https://docs.hiddenlayer.ai/docs/products/supply-chain/cli/nim_container.md): `oci://nvcr.io/nim/{{org}}/{{model}}:{{tag}}`</li></ul></li></ul></td></tr><tr><td>`-e`</td><td>yes</td><td>`-e HL_LICENSE`,\
`-e HL_CLIENT_ID`,\
`-e HL_CLIENT_SECRET`</td><td>Set the environment variables.<ul><li>The Supply Chain CLI uses `HL_LICENSE` for the license.</li><li>For Hybrid mode, use `HL_CLIENT_ID` and `HL_CLIENT_SECRET` to set the client ID and client secret.</li></ul></td></tr><tr><td>`--include-pattern`</td><td>no</td><td>`--include-pattern "*.h5" --include-pattern "*.rds"`</td><td><ul><li>If not provided (default):<ul><li>Supply Chain CLI will consider every file discovered by `--input` to be eligible for inclusion in the scan.</li></ul></li><li>If provided:<ul><li>Specifies a glob to use for matching filenames.</li><li>Can be provided multiple times to specify multiple globs.</li><li>Candidate files discovered by `--input` will be included if they match any of the globs.</li></ul></li></ul></td></tr><tr><td>`--exclude-pattern`</td><td>no</td><td>`--exclude-pattern "*test*"`</td><td><ul><li>If not provided (default):<ul><li>Supply Chain CLI will consider every file discovered by `--input` to be eligible for inclusion in the scan.</li></ul></li><li>If provided:<ul><li>Specifies a glob to use for matching filenames.</li><li>Can be provided multiple times to specify multiple globs.</li><li>Candidate files discovered by `--input` will be excluded if they match any of the globs.</li><li>Takes precedence over `--include-pattern`. Files matching any `--exclude-pattern` will be excluded, even if they match an `--include-pattern`.</li></ul></li></ul></td></tr><tr><td>`--deep-hashing`</td><td>no</td><td>`--deep-hashing`</td><td>Calculates MD5, SHA1, and SHA256 hashes. These are not calculated by default.<ul><li>**Note**: Scans may take longer to complete with this flag enabled.</li></ul></td></tr></tbody></table>

### Glob Syntax

Some of the input arguments for the Supply Chain CLI allow the user to specify one or more globs to use for matching certain file path patterns. The following tokens can be used within globs to specify matching patterns:

* `*`: matches any (possibly empty) sequence of non-special characters

  * Special characters are `*`, ?, `\\`, and `[`

* `?`: matches any single non-special character

### Output

<table><thead><tr><th>Argument</th><th>Required</th><th>Example Usage</th><th>Description</th></tr></thead><tbody><tr><td>`--output {{file}}`</td><td>no</td><td>`--output /scan-results/output.json`</td><td><ul><li>If not provided (default):<ul><li>Scan results are not written to any file.</li><li>Scan results are echoed to stdout.</li></ul></li><li>If provided:<ul><li>**Note**: We recommend providing a path to a file that is on a mounted volume, so that the written file will be easily available locally.</li><li>Specifies an absolute path to a file to which scan results are written.<ul><li>Results are formatted as JSON regardless of the extension of the file.</li></ul></li><li>Must be a path that is accessible through the Docker container filesystem.<ul><li>See [Volume Mounts](https://docs.hiddenlayer.ai/docs/products/supply-chain/cli/commandline_arguments.md#volume-mounts) for more information.</li></ul></li><li>Scan results are not echoed to stdout.</li></ul></li></ul></td></tr><tr><td>`--output-file-cyclonedx={{file}}`</td><td>no</td><td>`--output-file-cyclonedx=report-cyclonedx.json`</td><td>[OWASP CycloneDX](https://cyclonedx.org/specification/overview/) is a full-stack Bill of Materials (BOM) standard and outputs the HiddenLayer AI Bill of Materials (AIBOM). Can be used with `--output-file-hl` to generate both reports with one command.</td></tr><tr><td>`--output-file-hl={{file}}`</td><td>no</td><td>`--output-file-hl=report-hl.json`</td><td>Scan results are written to a JSON file. Can be used with `--output-file-cyclonedx` to generate both reports with one command.</td></tr><tr><td>`--output-format {{v3|sarif|cyclonedx-json}}`</td><td>no</td><td>`--output-format sarif`</td><td><ul><li>If not provided (default):<ul><li>Scan results will be in the v3 schema format.</li></ul></li><li>If provided:<ul><li>[SARIF output](https://sarifweb.azurewebsites.net/), which is an open standard for static analysis results</li><li>[OWASP CycloneDX](https://cyclonedx.org/specification/overview/) is a full-stack Bill of Materials (BOM) standard and outputs the HiddenLayer AI Bill of Materials (AIBOM)</li></ul></li></ul></td></tr><tr><td>`--log-file &lt;file&gt;`</td><td>no</td><td>`--log-file /mnt/volume/log.json`</td><td><ul><li>If not provided (default):<ul><li>Scanner logs are not written to any file.</li><li>Scanner logs are echoed to stderr.</li></ul></li><li>If provided:<ul><li>**Note**: We recommend providing a path to a file that is on a mounted volume, so that the written file will be easily available locally.</li><li>Specifies an absolute path to a file to which scanner logs results are written.<ul><li>Results are formatted as new-line separated JSON blobs, regardless of the extension of the file.</li></ul></li><li>Must be a path that is accessible through the Docker container filesystem.<ul><li>See [Volume Mounts](https://docs.hiddenlayer.ai/docs/products/supply-chain/cli/commandline_arguments.md#volume-mounts) for more information.</li></ul></li><li>Scanner logs are not echoed to stderr.</li></ul></li></ul></td></tr><tr><td>`--detections-are-errors`</td><td>no</td><td>`--detections-are-errors`</td><td>Specifies whether scan results should drive exit code.<ul><li>If not provided (default), Supply Chain CLI’s exit code will be:<ul><li>0, if:<ul><li>No detections are found in the input model(s), or</li><li>Detections are found in the input model(s)</li></ul></li><li>= 1, if:<ul><li>An internal error is encountered</li></ul></li></ul></li><li>If provided, Supply Chain CLI’s exit code will be:<ul><li>0, if:<ul><li>No detections are found in the input model(s)</li></ul></li><li>= 1, if:<ul><li>Detections are found in the input model(s), or</li><li>An internal error is encountered</li></ul></li></ul></li></ul></td></tr><tr><td>`--persist`</td><td>no</td><td>`--persist`</td><td>If provided, you can add the scan results to an existing model in the AISec Platform Console.<ul><li>**Note**: Optionally, you can use `--model-name` and `--model-version` to specify the model’s name and version for the scan. If this data is not provided, these values will be automatically populated.</li></ul></td></tr><tr><td>`--model-name`</td><td>no</td><td>`--model-name=testmodel`</td><td>If you are using `--persist`, you can specify the `--model-name` to add the scan results to the existing model in the AISec Platform Console.<ul><li>If a model name is not included, a unique UUID is generated (example: cli-25.4.0-f348a46e-d0f8-4ac4-8f1a-73ae02a2fe75).</li></ul></td></tr><tr><td>`--model-version`</td><td>no</td><td>`--model-version=2`</td><td>If you are using `--persist`, you can specify the `--model-version` to increment the scan results version for an existing model in the AISec Platform Console.<ul><li>If a version is not included, the Unix time at the start of the scan is used.</li><li>If you use a version that already exsists for the model, the scan results are overwritten.</li></ul></td></tr></tbody></table>

#### Output Example

The following is an example of exporting both a CycloneDX file and JSON file as the output. Change the output file name to match your organization's standards.

```sh macOS theme={null}
docker run --rm \
  -e HL_LICENSE \
  -v /home/user/models:/files-to-scan \
  -v /home/user/results:/scan-results \
  images.hiddenlayer.ai/proxy/supply-chain-security/ghcr.io/hiddenlayer-engineering/supply-chain-scanner:26.9.0 \
  --input /files-to-scan \
  --output-file-hl=report1.json \
  --output-file-cyclonedx=report2.json
```

```sh Linux theme={null}
docker run --rm \
  -e HL_LICENSE \
  -v /home/user/models:/files-to-scan \
  -v /home/user/results:/scan-results \
  images.hiddenlayer.ai/proxy/supply-chain-security/ghcr.io/hiddenlayer-engineering/supply-chain-scanner:26.9.0 \
  --input /files-to-scan \
  --output-file-hl=report1.json \
  --output-file-cyclonedx=report2.json
```

```sh Windows theme={null}
docker run --rm ^
  -e HL_LICENSE ^
  -v c:\work\models:/files-to-scan ^
  -v c:\work\models\results:/scan-results ^
  images.hiddenlayer.ai/proxy/supply-chain-security/ghcr.io/hiddenlayer-engineering/supply-chain-scanner:26.9.0 ^
  --input /files-to-scan ^
  --output-file-hl=report1.json ^
  --output-file-cyclonedx=report2.json
```
