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

# Command-Line Usage

The Trusys Command-Line Interface (CLI) provides a powerful way to interact with the Trusys platform directly from your terminal. Use the CLI to manage projects, run security and evaluation tests, and automate workflows.

***

# Installation

To install Trusys, use the following command:

```bash theme={null}
npx trusys@latest
```

***

# Verify Installation

To ensure trusys is installed correctly, run:

```bash theme={null}
npx trusys@latest --version
```

***

# Login

**Authenticate with your API Key**

```bash theme={null}
npx trusys auth login --api-key <your_api_key>
# OR
npx trusys auth login -k <your_api_key>
```

Replace `<your_api_key>` with the API key from your workspace. Learn how to [create an API Key](/workspace/api-keys)

***

# Functional Evaluation

* **Run Evaluation with Custom Application and Prompt Library**

  ```bash theme={null}
  npx trusys eval --run \
  --application <applicationName> \
  --library <library> \
  --output <filename.extension> \
  --cache
  ```

* **If using [custom application](/product/applications)**

  ```bash theme={null}
  npx trusys eval --run \
  --application <applicationName> \
  --applicationPath <path_to_custom_provider> \
  --library <library> \
  --output <filename.extension> \
  --cache
  ```

<Card>
  ### CLI Options Explained

  * **`--applicationPath`**\
    Path to the local custom provider file (JavaScript or Python) that you have implemented.

  * **`--output`**\
    Specify an output file for evaluation results.\
    Supported formats (based on file extension):\
    `.txt`, `.json`, `.html`, `.yaml`, `.csv`

  * **`--cache`**\
    Enables response caching to improve performance by reusing successful API responses.\
    Failed or error responses are **not cached**, allowing retries and debugging.

  * **`--noCache`**\
    Explicitly disables caching for the evaluation run.

  * **`--local`**\
    Runs the evaluation **entirely locally** without uploading results to the Trusys platform.
</Card>

***

# Security Evaluation

* **Run Red Team Security Evaluation**

  ```bash theme={null}
  npx trusys redteam run \
  --securityConfig <configName> \
  --output <filename.extension> \
  --cache
  ```

* **If using [custom application](/product/applications)**

  ```bash theme={null}
  npx trusys redteam run \
  --securityConfig <configName> \
  --applicationPath <path_to_custom_provider> \
  --output <filename.extension> \
  --cache
  ```

<Card>
  ### CLI Options Explained

  * **`--applicationPath`**\
    Path to the local custom provider file used to invoke the AI application.

  * **`--output`**\
    Specify the output file for security evaluation results.

  * **`--cache`**\
    Enables caching of successful responses to speed up security test execution.

  * **`--noCache`**\
    Disables caching to ensure every security probe is executed fresh.

  * **`--local`**\
    Runs the security evaluation fully locally.
</Card>

***

# Exit Code

The Trusys CLI returns specific exit codes to help you integrate testing into your CI/CD pipelines and automation workflows. You can access the exit code using the `$LASTEXITCODE` variable (PowerShell/Windows) or `$?` (Unix/Linux/Mac).

*Exit Code Values*

The CLI returns the following exit codes:

* **`0`** – All test cases passed successfully with no failures.
* **`100`** – At least one test case failed. This indicates that your application did not meet the expected evaluation criteria for one or more test cases.
* **`1`** – An error occurred during execution. This could be due to configuration issues, authentication failures, network errors, or other operational problems unrelated to test case failures.
