A command-line utility that wraps program execution and redacts sensitive strings from terminal output.
go install github.com/iamjsd/redactor@latestOr build from source:
go build -o redactorredactor "<redactions>" <command> [args...]Where <redactions> is a newline-separated list of strings to redact from the output.
# Redact a password from command output
redactor "my-secret-password" cat config.txt
# Redact multiple strings
redactor $'secret1\nsecret2\napi-key-123' ./my-script.shRedacted strings are replaced with asterisks (*) of equal length.
- Spawns the target command in a pseudo-terminal (PTY)
- Intercepts all output line by line
- Replaces any occurrences of redaction strings with asterisks
- Passes through stdin and handles terminal resize signals
MIT License - see LICENSE for details.