CLI Reference¶
The Aegis CLI provides command-line access to PII detection and masking.
Installation¶
The CLI is included with the SDK:
Or install standalone with pipx:
Verify installation:
The CLI automatically checks for updates and notifies you when a new version is available.
Commands¶
aegis scan¶
Scan text for PII without processing decisions.
Options¶
| Option | Short | Description |
|---|---|---|
--file PATH |
-f |
Scan a file instead of text |
--no-samples |
Don't include samples in output | |
--json |
Output as JSON |
Examples¶
Scan text:
aegis scan "Customer email: [email protected], SSN: 123-45-6789"
Output:
Detected 2 type(s) of sensitive data:
- EMAIL: 1 occurrence(s) (sample: j***@example.com)
- SSN: 1 occurrence(s) (sample: ***-**-6789)
Scan file:
JSON output:
aegis scan "[email protected]" --json
aegis mask¶
Mask PII in text.
Options¶
| Option | Short | Description |
|---|---|---|
--file PATH |
-f |
Mask a file |
--output PATH |
-o |
Output file path |
Examples¶
Mask text:
aegis mask "My email is [email protected]"
Mask file:
aegis process¶
Process text with full policy decision logic.
Options¶
| Option | Short | Description |
|---|---|---|
--file PATH |
-f |
Process a file |
--output PATH |
-o |
Output file path |
--destination DEST |
-d |
Destination: AI_TOOL, VENDOR, CUSTOMER |
--no-samples |
Don't include samples | |
--json |
Output as JSON |
Examples¶
Process text:
Output:
Decision: Decision.BLOCKED
Summary: Content blocked - SSN not allowed for AI_TOOL
Detected:
- SSN: 1
Suggested fix: Remove or redact SSN data before sending
Process with masking:
aegis process "Email: [email protected]" -d AI_TOOL
Decision: Decision.ALLOWED_WITH_MASKING
Summary: Content allowed after masking EMAIL
Detected:
- EMAIL: 1
Masked content:
Email: j***@example.com
JSON output:
aegis process "[email protected]" -d AI_TOOL --json
{
"decision": "ALLOWED_WITH_MASKING",
"summary": "Content allowed after masking EMAIL",
"detected": [
{"type": "EMAIL", "count": 1}
],
"masked_content": "t***@email.com",
"is_blocked": false,
"bytes_processed": 14
}
aegis process-file¶
Process large files with streaming (for files over 10MB).
Options¶
| Option | Short | Description |
|---|---|---|
--output PATH |
-o |
Output file path |
--destination DEST |
-d |
Destination: AI_TOOL, VENDOR, CUSTOMER |
--chunk-mb SIZE |
Chunk size in MB (default: 10) | |
--no-header |
CSV has no header row | |
--stop-on-block |
Stop processing if blocked | |
--quiet |
-q |
Suppress progress output |
--json |
Output as JSON |
Examples¶
Process large text file:
Processed: 150.2 MB
Decision: Decision.ALLOWED_WITH_MASKING
Summary: Processed 150.20 MB in 16 chunks
Processed: 150.20 MB in 16 chunks
Detected:
- EMAIL: 1523
- PHONE: 847
Output: logs_masked.txt
Process CSV file:
Stop on block:
aegis check-license¶
Check license status.
Options¶
| Option | Description |
|---|---|
--license-key KEY |
License key (or use AEGIS_LICENSE_KEY env var) |
--offline |
Offline mode |
--json |
Output as JSON |
Examples¶
Check license:
With environment variable:
JSON output:
Exit Codes¶
| Code | Meaning |
|---|---|
0 |
Success (no PII found or allowed) |
1 |
PII detected or content blocked |
Use in scripts:
aegis scan -f document.txt
if [ $? -eq 0 ]; then
echo "No PII detected - safe to proceed"
else
echo "PII detected - review required"
fi
Piping and Scripting¶
Pipe input:
Process multiple files:
With jq for JSON processing:
Environment Variables¶
| Variable | Description |
|---|---|
AEGIS_LICENSE_KEY |
License key for enterprise features |
See Also¶
- SDK Quick Start - Python API usage
- API Reference - Full SDK documentation