# Cloud Defense CLI

{% embed url="<https://youtu.be/R6TkGQ9iPrc>" %}

### Installation&#x20;

Please follow instructions specific to your operating system.&#x20;

### How to update CLI?&#x20;

By just rerunning the command updates the client to latest version.&#x20;

#### Mac&#x20;

Run the following command which will install `cdefense` tool.

Prefix with `sudo` if you see any permission error when running this command&#x20;

`curl\https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-mac-x64.tar.gz > /tmp/cd-latest-mac-x64.tar.gz && tar -C /usr/local/bin -xzf /tmp/cd-latest-mac-x64.tar.gz && chmod +x /usr/local/bin/cdefense`&#x20;

**Linux**&#x20;

Run the following command which will install `cdefense` tool.

`sudo curl\https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-linux-x64.tar.gz > /tmp/cd-latest-linux-x64.tar.gz && tar -C /usr/local/bin -xzf /tmp/cd-latest-linux-x64.tar.gz && chmod +x /usr/local/bin/cdefense`&#x20;

**Windows**&#x20;

Download the following tar file and unzip it​ `https://github.com/CloudDefenseAI/cd/raw/master/latest/cd-latest-windows.exe.tar.gz`&#x20;

### Usage&#x20;

Run the following command to get started.&#x20;

**cdefense help**&#x20;

NAME:&#x20;

Cloud Defense CLI Scanner - CLI for scanning and detecting vulnerabilities in any language&#x20;

USAGE:&#x20;

cdefense \[global options] command \[command options] \[arguments...]&#x20;

VERSION:&#x20;

1.0.1&#x20;

COMMANDS:&#x20;

scan, s SCA scan of a given project and post to Cloud Defense server sast, a SAST scan of a given project and post to Cloud Defense server help, h Shows a list of commands or help for one command&#x20;

GLOBAL OPTIONS:&#x20;

\--help, -h show help (default: false) --version, -v print the version (default: false)&#x20;

### Examples&#x20;

#### SCA

#### Example of python SCA scan

`cdefense scan --lang=python --api-key=<YOUR_API_KEY> --path=/d/temp/vulpy/requirements.txt --project-name="my-python-project" ​`

#### Example of java SCA scan

`cdefense scan --lang=java --api-key=<YOUR_API_KEY> --path=/d/temp/java-goof --verbose --project-name="My Java Project" ​`

#### Example of php SCA scan

`cdefense scan --lang=php --api-key=<YOUR_API_KEY> --path=/d/temp/php-helloworld-app --project-name="my-php-project" ​`

#### Example of NodeJS SCA scan

`cdefense scan --lang=node --api-key=<YOUR_API_KEY> --path=/d/temp/nodejs-system --project-name="my-nodejs-project"`&#x20;

### SAST

#### Example of python SAST scan

`cdefense sast --lang=python --api-key=<YOUR_API_KEY> --path=/d/temp/vulpy/requirements.txt --project-name="my-python-project" ​`

#### Example of java SAST scan

`cdefense sast --lang=java --api-key=<YOUR_API_KEY> --path=/d/temp/java-goof --verbose --project-name="my-java-project" ​`

#### Example of php SAST scan

`cdefense sast --lang=php --api-key=<YOUR_API_KEY> --path=/d/temp/php-helloworld-app --project-name="my-php-project" ​`

#### Example of NodeJS SAST scan

`cdefense sast --lang=node --api-key=<YOUR_API_KEY> --path=/d/`

### FULL SCAN

#### Example of full scan

`cdefense online —api-key=<YOU_API_KEY> —repository-url=`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clouddefenseai.com/clouddefense-cli/cloud-defense-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
