Skip to Content
🎉 Vypher v1.0 is released. Read more →
CLICLI Reference

CLI Reference

Complete command-line interface reference for the Vypher CLI tool.

Global Options

Options available for all Vypher commands:

vypher [global-options] <command> [command-options] [arguments]

Global Flags

  • --config, -c: Path to configuration file (default: vypher.yaml)
  • --verbose, -v: Enable verbose output
  • --quiet, -q: Suppress non-error output
  • --help, -h: Show help information
  • --version: Show version information

Commands Overview

Core Commands

  • scan - Scan files and directories for sensitive data
  • init - Initialize a new Vypher configuration
  • validate - Validate configuration files
  • version - Show version information

Utility Commands

Command Reference

scan

Scan files and directories for sensitive data.

vypher scan [options] <path>...

Options

OptionDescriptionDefault
--detectorsComma-separated list of detectorspii,secrets
--output, -oOutput file pathstdout
--format, -fOutput format (json, csv, xml, txt)json
--includeInclude file patterns*
--excludeExclude file patterns-
--sensitivityDetection sensitivity (low, medium, high)medium
--threadsNumber of processing threadsCPU count
--max-file-sizeMaximum file size to process10MB
--progressShow progress barfalse

Examples

# Basic scan vypher scan . # Scan with specific detectors vypher scan . --detectors pii,secrets # Output to file vypher scan . --output results.json --format json # Exclude patterns vypher scan . --exclude "node_modules/**,*.log" # High sensitivity scan vypher scan . --sensitivity high --progress

init

Initialize a new Vypher configuration file.

vypher init [options] [path]

Options

OptionDescriptionDefault
--template, -tConfiguration templatedefault
--force, -fOverwrite existing configurationfalse

Examples

# Create default configuration vypher init # Use specific template vypher init --template python # Initialize in specific directory vypher init /path/to/project --force

validate

Validate configuration files and patterns.

vypher validate [options] [config-file]

Options

OptionDescriptionDefault
--patternsValidate custom patterns onlyfalse
--syntaxCheck syntax onlyfalse

Examples

# Validate default configuration vypher validate # Validate specific config file vypher validate vypher.prod.yaml # Validate patterns only vypher validate --patterns

list-detectors

List all available detectors and their descriptions.

vypher list-detectors [options]

Options

OptionDescriptionDefault
--formatOutput format (table, json, yaml)table
--categoryFilter by category-

Examples

# List all detectors vypher list-detectors # List PII detectors only vypher list-detectors --category pii # JSON output vypher list-detectors --format json

test-pattern

Test custom regular expression patterns.

vypher test-pattern [options] --pattern <pattern> <text>

Options

OptionDescriptionDefault
--pattern, -pRegular expression patternRequired
--case-sensitiveCase-sensitive matchingfalse
--multilineMultiline matchingfalse
--fileTest against file content-

Examples

# Test pattern against text vypher test-pattern --pattern "\\bEMP-\\d{6}\\b" "Employee EMP-123456" # Test against file vypher test-pattern --pattern "api[_-]key" --file config.json # Case-sensitive test vypher test-pattern --pattern "API_KEY_\\w+" --case-sensitive --file .env

generate

Generate configuration templates and examples.

vypher generate [options] <type>

Types

  • config - Generate configuration file
  • patterns - Generate custom pattern examples
  • ci - Generate CI/CD pipeline configuration
  • docker - Generate Docker configuration

Options

OptionDescriptionDefault
--output, -oOutput file pathstdout
--templateTemplate variantdefault

Examples

# Generate basic configuration vypher generate config > vypher.yaml # Generate CI configuration vypher generate ci --template github-actions # Generate custom patterns vypher generate patterns --output patterns.yaml

version

Display version information.

vypher version [options]

Options

OptionDescriptionDefault
--jsonOutput in JSON formatfalse

Configuration File

Default Locations

Vypher looks for configuration files in the following order:

  1. --config flag value
  2. vypher.yaml in current directory
  3. vypher.yml in current directory
  4. .vypher.yaml in current directory
  5. .vypher.yml in current directory
  6. $HOME/.vypher/config.yaml

Environment Variables

Override configuration using environment variables:

VariableDescriptionExample
VYPHER_CONFIGConfiguration file path/path/to/config.yaml
VYPHER_OUTPUT_FORMATDefault output formatjson
VYPHER_DETECTORSDefault detectorspii,secrets
VYPHER_LOG_LEVELLogging levelinfo
VYPHER_THREADSThread count4

Exit Codes

CodeDescription
0Success (no sensitive data found)
1Sensitive data detected
2Warning (scan completed with warnings)
3Error (scan failed)
4Configuration error
5Invalid arguments

Examples

Common Usage Patterns

Quick repository scan:

vypher scan . --progress --output scan-results.json

CI/CD pipeline scan:

vypher scan . --detectors all --format json --quiet > results.json

Configuration validation:

vypher validate && echo "Configuration is valid"

High-sensitivity scan with exclusions:

vypher scan . \ --sensitivity high \ --exclude "node_modules/**,build/**,*.min.*" \ --progress

Test custom patterns:

vypher test-pattern \ --pattern "\\bCUST-\\d{8}\\b" \ --file customer_data.txt

Shell Completions

Generate shell completion scripts:

# Bash vypher completion bash > /etc/bash_completion.d/vypher # Zsh vypher completion zsh > /usr/local/share/zsh/site-functions/_vypher # Fish vypher completion fish > ~/.config/fish/completions/vypher.fish # PowerShell vypher completion powershell > vypher.ps1
Last updated on