Skip to content
Install

Command guide

Choose the Pentect command that matches the data flow you need.

Pentect commands differ mainly in where plaintext is allowed to appear. Use this guide before reaching for the advanced resolve command.

Mask text or read a file

TaskCommandPlaintext destination
Mask UTF-8 stdinpentect maskNowhere; protected text is printed
Read and mask a filepentect read PATHNowhere; the file is not changed
Inspect a handlepentect view HANDLENowhere; only safe metadata is printed

read uses the filename to recognize formats and can retain safe recovery metadata in the active local store. Without an active store, read still masks the file but any emitted handles are intentionally one-run values and cannot be resolved later; Pentect prints a warning to stderr in that case. mask is always a one-run stdin filter.

sh
cat .env | pentect mask
pentect read ./config.json
pentect view '<<API_TOKEN_0123456789abcdef>>'
powershell
Get-Content .env -Raw | pentect mask
pentect read .\config.json
pentect view '<<API_TOKEN_0123456789abcdef>>'

See Handles and Files and images for the protection details.

Run a local command

pentect exec requires a real command. It does not treat arbitrary text as a secret, filename, or handle lookup. Pentect restores known handles only at the local execution boundary, then masks stdout and stderr before displaying them.

Prefer the direct form after --; it avoids another quoting layer:

sh
pentect exec -- git status --short
pentect exec 'printf "%s\n" "hello"'
powershell
pentect exec -- git status --short
pentect exec 'Write-Output "hello"'

The shell form is one command string. The direct form is a program name followed by separate arguments. A missing executable produces a fixed Pentect diagnostic; Pentect does not repeat the potentially sensitive command text.

For a program that reads one credential from stdin:

sh
pentect exec --secret-stdin '<<SUDO_PASSWORD_0123456789abcdef>>' -- sudo -S -p '' command
powershell
pentect exec --secret-stdin '<<API_TOKEN_0123456789abcdef>>' -- .\consumer.exe

The restored value reaches the child process through stdin, but not the terminal, process arguments, injected environment bindings, or Pentect log. An ordinary or daemonized descendant therefore does not receive a Pentect binding from this mode. The receiving program can still deliberately copy, export, persist, or forward the bytes after reading them; the operating system cannot revoke such a copy. Pentect does not append a newline. Use --allow-secret-argv only when a target program cannot accept a safer channel; same-user processes may be able to inspect process arguments.

Resolve plaintext only when required

pentect resolve is advanced because its output is plaintext. With no path it reads stdin and prints plaintext. With paths it replaces known handles in each file in place.

sh
pentect resolve config.masked.toml
cat masked.txt | pentect resolve > plaintext.txt

Both destination files now contain plaintext secret material. Prefer exec when a command can consume a handle without creating a plaintext file.

Diagnose and maintain the installation

TaskCommandNotes
View recent persistent diagnosticspentect log --once --tail 100Bounded output; values, bodies, headers, and URLs are not logged
Follow diagnosticspentect log --followReads retained history, then waits for live events
Locate the log filepentect log --pathPrints the local path
Machine-readable diagnosticspentect log --json --once --tail 100Bounded JSONL suitable for support tooling
View local protection statisticspentect metricsShows stable metric keys with readable names, occurrence counts, blocked restorations, bounded warning reasons, and plugin failures/timeouts; never shows values, handles, paths, URLs, plugin names, error text, or account identifiers
Machine-readable statisticspentect metrics --jsonLocal JSON; no telemetry is sent
Check readinesspentect doctorDoes not change configuration
Offer safe repairspentect doctor --fixConfirms changes interactively
Check for an updatepentect update --checkDoes not install
Update Pentectpentect updateUses the recorded package-manager scope when available
Remove Pentectpentect uninstallKeeps project data

For failures, include the value-free reason shown by pentect log --json --once --tail 100 and follow Troubleshooting. Installation-specific commands are documented in Install, and the complete option list is in the CLI reference.

Pentect is open source.