Expunct CLI
The Expunct CLI lets you redact, detect, and manage PII from the command line. It wraps the Expunct API and is designed for both developers and AI agents.
Requirements
- Python 3.10 or later
Installation
pip install expunct-cliQuick Example
expunct redact --text "John Smith email john@gmail.com"Output:
PERSON_1 email EMAIL_1How It Works
CLI (expunct-cli)
↓
Expunct Python SDK
↓
Expunct APIThe CLI uses the Expunct Python SDK under the hood to communicate with the Expunct API. All processing happens server-side — the CLI handles input/output and formatting.
Features
- Text redaction — redact inline text with
--textor via stdin piping - File redaction — redact text files, PDFs, DOCX, images, video, and audio
- URI redaction — redact files stored in cloud storage (S3, GCS)
- Detect mode — detect PII entities without modifying the text
- Job management — list, get, download, and wait for async redaction jobs
- Policy management — create and manage redaction policies
- Audit logs — view audit trail of redaction activity
- JSON output — machine-readable output with
--jsonfor scripting and AI agents - Stdin piping — chain with other CLI tools (
cat logs.txt | expunct redact)
Next Steps
- Installation — install, authenticate, and verify
- Commands — full command reference
- Configuration — config file and environment variables