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

# CLI

> Learn how to install and use the MindFort CLI to run assessments, start tasks, list findings, and automate security workflows in CI pipelines.

The MindFort CLI provides terminal access to the MindFort platform for local workflows, CI jobs, and agent-driven automation.

The CLI always connects to the production MindFort API at `https://api.mindfort.app`.

## Install

Install with Go:

```bash theme={null}
go install github.com/mindfortai/mindfort-cli/cmd/mindfort@latest
```

Or download a release binary from the [MindFort CLI GitHub repository](https://github.com/mindfortai/mindfort-cli).

## Authenticate

Create an API key in the MindFort dashboard, then store it in your OS keychain:

```bash theme={null}
mindfort auth set-key --api-key <api-key>
```

For CI and scripts, use an environment variable:

```bash theme={null}
export MINDFORT_API_KEY=<api-key>
```

You can also read the key from standard input:

```bash theme={null}
printf '%s' "$MINDFORT_API_KEY" | mindfort auth set-key --stdin
```

Check authentication status:

```bash theme={null}
mindfort auth status
```

## Assessments

Run an assessment:

```bash theme={null}
mindfort assessment run --target-id <target-id> --method turbo
```

Preview the request without creating an assessment:

```bash theme={null}
mindfort assessment run --target-id <target-id> --method turbo --dry-run --json
```

List assessments:

```bash theme={null}
mindfort assessment list --status active --limit 25
```

Cancel an assessment:

```bash theme={null}
mindfort assessment cancel <assessment-id>
```

## Tasks

Start an autonomous task:

```bash theme={null}
mindfort task run --target-id <target-id> --message "Check the login flow for auth bypasses"
```

Preview the task request without starting it:

```bash theme={null}
mindfort task run --target-id <target-id> --message "Check auth" --dry-run --json
```

Run a saved task template:

```bash theme={null}
mindfort task run-template <template-id>
```

Cancel a task:

```bash theme={null}
mindfort task cancel <task-id>
```

## Findings

List findings for a target:

```bash theme={null}
mindfort findings list --target-id <target-id> --severity high --limit 25
```

Use `--json` for machine-readable output:

```bash theme={null}
mindfort findings list --target-id <target-id> --json
```

## Automation

The CLI is designed for non-interactive use:

* Pass all inputs as flags.
* Use `--json` for structured output.
* Use `--no-banner` to suppress decorative output in scripts.
* Use `--dry-run` before create operations when you want to preview requests.
* Use `MINDFORT_API_KEY` instead of storing secrets on CI runners.

Example:

```bash theme={null}
mindfort findings list --target-id <target-id> --json --no-banner
```
