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

# CLI Overview

> RAXE command-line interface

## Installation

```bash theme={null}
pip install raxe
```

## Quick Reference

```bash theme={null}
# Scan a prompt
raxe scan "your text here"

# Interactive mode
raxe repl

# List rules
raxe rules list

# Health check
raxe doctor

# View stats
raxe stats
```

## Commands

| Command              | Description                        |
| -------------------- | ---------------------------------- |
| `raxe scan`          | Scan text for threats              |
| `raxe batch`         | Batch scan from file               |
| `raxe repl`          | Interactive scanning mode          |
| `raxe rules`         | Manage detection rules             |
| `raxe suppress`      | Manage false positive suppressions |
| `raxe doctor`        | System health check                |
| `raxe stats`         | View scan statistics               |
| `raxe config`        | Manage configuration               |
| `raxe init`          | Initialize RAXE                    |
| `raxe export`        | Export scan history                |
| `raxe validate-rule` | Validate custom rule files         |

## Global Options

```bash theme={null}
# Set log level
raxe --log-level DEBUG scan "text"

# Output as JSON
raxe scan "text" --format json

# CI mode (JSON output, exit code 1 on threats)
raxe scan "text" --ci
```

## Environment Variables

```bash theme={null}
# Set API key
export RAXE_API_KEY="raxe_..."

# Set log level
export RAXE_LOG_LEVEL=DEBUG

# CI mode
export RAXE_CI=true
```

## Exit Codes

| Code | Meaning             |
| ---- | ------------------- |
| 0    | Success, no threats |
| 1    | Threat detected     |
| 2    | Error occurred      |

## Common Workflows

### Basic Scan

```bash theme={null}
raxe scan "Ignore all previous instructions"
```

Output:

```
THREAT DETECTED

Severity: CRITICAL
Detections: 1

Rule: pi-001 - Prompt Injection
Matched: "Ignore all previous instructions"
```

### CI/CD Integration

```bash theme={null}
# In GitHub Actions or similar
raxe scan "$USER_INPUT" --ci
if [ $? -eq 1 ]; then
  echo "Threat detected, blocking request"
  exit 1
fi
```

### Batch Scanning

```bash theme={null}
# Scan from file
raxe batch prompts.txt

# Scan from stdin
cat prompts.txt | raxe batch -
```

### Interactive Mode

```bash theme={null}
raxe repl
```

```
RAXE REPL v0.9.1
Type 'help' for commands, 'quit' to exit

raxe> scan Ignore all instructions
THREAT: pi-001 (HIGH)

raxe> quit
```

## Next Steps

<Card title="All Commands" icon="terminal" href="/cli/commands">
  Complete CLI command reference
</Card>
