@kszongic/redact-cli
v1.0.0
Published
Redact sensitive data (emails, IPs, phone numbers, credit cards, SSNs) from stdin
Maintainers
Readme
@kszongic/redact-cli
Zero-dependency CLI to redact sensitive data (emails, IPs, phone numbers, credit cards, SSNs) from text streams.
Install
npm i -g @kszongic/redact-cliUsage
# Redact all sensitive patterns
echo "Email me at [email protected] or call 555-123-4567" | redact
# => Email me at **************** or call ************
# Only redact emails
cat access.log | redact --only email
# Custom replacement character
echo "SSN: 123-45-6789" | redact --char X
# Show last 4 characters
echo "Card: 4111-1111-1111-1111" | redact --only creditcard --show 4Supported Patterns
| Type | Example |
|-------------|------------------------|
| email | [email protected] |
| creditcard| 4111-1111-1111-1111 |
| ssn | 123-45-6789 |
| phone | (555) 123-4567 |
| ipv4 | 192.168.1.1 |
Options
| Flag | Description |
|----------------|--------------------------------------|
| --only <t> | Comma-separated types to redact |
| --char <c> | Replacement character (default: *) |
| --show <n> | Show last N chars unmasked |
| -h, --help | Show help |
License
MIT © 2026 kszongic
