FastPII Docs
FastPII Connect

CLI Reference

Command-line interface reference for the fastpii-connect CLI tool.

CLI Reference

The fastpii-connect CLI provides command-line access to the FastPII AI Data Security Platform for quick sensitive data detection, protection, validation, and listing detectors.

Installation

pip install fastpii-connect

Authentication

Before using the CLI, save your API key:

fastpii-connect auth login --api-key fpk_your_api_key

You can optionally specify a custom base URL:

fastpii-connect auth login --api-key fpk_your_api_key --base-url https://api.fastpii.com

The key is stored at ~/.fastpii/config.json. Check your authentication status:

fastpii-connect auth status

Output:

API Key:   fpk_abc1...xyz4
Base URL:   https://api.fastpii.com
Config:     /home/user/.fastpii/config.json

Commands

scan

Detect PII in text.

fastpii-connect scan "My rodné číslo is 900101/1234"

Options:

OptionShortDescription
--country-cISO country code (e.g., CZ, PL, DE, FR)
--language-lLanguage hint for detection
--preset-pPrivacy preset: conservative, balanced, aggressive
--jsonOutput as JSON

Examples:

# Basic detection
fastpii-connect scan "Email: jan.novak@example.cz, RČ: 8001011238"

# With country filter
fastpii-connect scan "RČ: 8001011238" --country CZ

# With privacy preset
fastpii-connect scan "Contact john@example.com" --preset aggressive

# JSON output
fastpii-connect scan "RČ: 8001011238" --country CZ --json

Rich table output:

           Detected PII
┌──────────────┬──────────────────────┬─────────┬────────────┬───────────┐
│ Type         │ Original             │ Country │ Confidence │ Validated │
├──────────────┼──────────────────────┼─────────┼────────────┼───────────┤
│ email        │ jan.novak@example.cz │ cz      │ 0.95       │ ✗         │
│ rodne_cislo  │ 8001011238           │ cz      │ 1.00       │ ✓         │
└──────────────┴──────────────────────┴─────────┴────────────┴───────────┘

Countries detected: CZ
Processing time: 3.2ms

protect

Protect PII in text using the specified mode.

fastpii-connect protect "My rodné číslo is 900101/1234" --mode replace

Options:

OptionShortDescription
--mode-mProtection mode: replace, mask, hash, tokenize (default: replace)
--country-cISO country code
--jsonOutput as JSON

Examples:

# Replace mode (default)
fastpii-connect protect "RČ: 8001011238" --mode replace

# Mask mode
fastpii-connect protect "RČ: 8001011238" --mode mask

# Hash mode
fastpii-connect protect "RČ: 8001011238" --mode hash

# Tokenize mode
fastpii-connect protect "RČ: 8001011238" --mode tokenize

# With country filter
fastpii-connect protect "RČ: 8001011238" --mode mask --country CZ

# JSON output
fastpii-connect protect "RČ: 8001011238" --mode replace --json

Rich output:

Original:   My rodné číslo is 900101/1234
Protected:  My rodné číslo is [REDACTED]
Mode:       replace

         Protected Entities
┌──────────────┬──────────────┬──────────────┐
│ Type         │ Original     │ Protected    │
├──────────────┼──────────────┼──────────────┤
│ rodne_cislo  │ 900101/1234  │ [REDACTED]   │
└──────────────┴──────────────┴──────────────┘

Processing time: 4.1ms

validate

Validate a specific PII identifier.

fastpii-connect validate 9001011234 --type rodne_cislo

Options:

OptionShortDescription
--type-tEntity type to validate against (required)
--country-cISO country code
--jsonOutput as JSON

Examples:

# Validate a rodné číslo
fastpii-connect validate 9001011234 --type rodne_cislo --country CZ

# Validate a PESEL
fastpii-connect validate 44051401458 --type pesel --country PL

# Validate a Steuer-ID
fastpii-connect validate 86095742719 --type steuer_id --country DE

# JSON output
fastpii-connect validate 9001011234 --type rodne_cislo --json

Output:

rodne_cislo: 9001011234
Result: ✓ Valid
Confidence: 1.00
Country: CZ

detectors

List available PII detectors.

fastpii-connect detectors

Options:

OptionShortDescription
--country-cFilter by ISO country code
--jsonOutput as JSON

Examples:

# List all detectors
fastpii-connect detectors

# Filter by country
fastpii-connect detectors --country CZ

# JSON output
fastpii-connect detectors --country CZ --json

Output:

              Available Detectors (15)
┌──────────────────┬──────────────────────────┬─────────┬────────────┐
│ Name             │ Description              │ Region  │ Category   │
├──────────────────┼──────────────────────────┼─────────┼────────────┤
│ rodne_cislo      │ Czech birth number       │ cz      │ personal   │
│ ico              │ Czech company ID         │ cz      │ business   │
│ email            │ Email address            │ cz      │ personal   │
│ ...              │ ...                      │ ...     │ ...        │
└──────────────────┴──────────────────────────┴─────────┴────────────┘

auth login

Save your API key for CLI use.

fastpii-connect auth login --api-key fpk_your_api_key

Options:

OptionShortDescription
--api-key-kYour FastPII API key (required, will prompt if not provided)
--base-url-uAPI base URL (default: https://api.fastpii.com)

auth status

Show saved authentication status.

fastpii-connect auth status

Output:

API Key:   fpk_abc1...xyz4
Base URL:   https://api.fastpii.com
Config:     /home/user/.fastpii/config.json

Config file

Authentication details are stored at ~/.fastpii/config.json:

{
  "api_key": "fpk_your_api_key",
  "base_url": "https://api.fastpii.com"
}

Exit codes

CodeMeaning
0Success
1Error (authentication, rate limit, quota, or general)

Error messages

The CLI provides clear error messages:

Error: Invalid API key. Run fastpii-connect auth login first.
Error: Rate limit exceeded. Retry after 60s.
Error: Monthly quota exceeded.
Error: Request error: Text exceeds 50000 character limit

On this page