clavis scan
Scan files for leaked Clavis tokens and secret values
clavis scan [PATH] [flags]Look for leaked secrets in files: Clavis token formats, and (if you can read values) the actual values of this environment's secrets, matched in memory. Findings name the file, line and key, never the value.
Examples
Scan the current folder
clavis scanOnly staged changes
clavis scan --stagedEvery commit on every branch, deleted secrets included
clavis scan --historyAdd a git pre-commit hook
clavis scan --install-hookFlags
--history- scan every line any commit on any branch ever added, so deleted secrets are found too
--install-hook- install a pre-commit hook that runs the staged scan
--staged- scan git staged files
--values- also match resolved secret values in memory (requires read-values) Default:
true
Details
Exits with code 7 when it finds a leak, so it can fail CI. --values=false checks token formats only.
--history reads every line that any commit on any branch ever added, so a secret that was committed and later deleted is still found. Each finding names the commit, file and line. A secret found in history is already exposed: rotate it, then consider rewriting history.
Global flags
These work with every command.
--debug- enable debug logging
--env string- environment slug
--json- output machine-readable JSON
--org string- organization slug
--overlay string- tenant/region overlay slug
--path string- folder path (default /)
--project string- project slug
--server string- Clavis server URL (default: from .clavis.yaml or saved login)
-h, --help- help for any command