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 datainit- Initialize a new Vypher configurationvalidate- Validate configuration filesversion- Show version information
Utility Commands
list-detectors- List available detectorstest-pattern- Test custom patternsgenerate- Generate configuration templates
Command Reference
scan
Scan files and directories for sensitive data.
vypher scan [options] <path>...Options
| Option | Description | Default |
|---|---|---|
--detectors | Comma-separated list of detectors | pii,secrets |
--output, -o | Output file path | stdout |
--format, -f | Output format (json, csv, xml, txt) | json |
--include | Include file patterns | * |
--exclude | Exclude file patterns | - |
--sensitivity | Detection sensitivity (low, medium, high) | medium |
--threads | Number of processing threads | CPU count |
--max-file-size | Maximum file size to process | 10MB |
--progress | Show progress bar | false |
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 --progressinit
Initialize a new Vypher configuration file.
vypher init [options] [path]Options
| Option | Description | Default |
|---|---|---|
--template, -t | Configuration template | default |
--force, -f | Overwrite existing configuration | false |
Examples
# Create default configuration
vypher init
# Use specific template
vypher init --template python
# Initialize in specific directory
vypher init /path/to/project --forcevalidate
Validate configuration files and patterns.
vypher validate [options] [config-file]Options
| Option | Description | Default |
|---|---|---|
--patterns | Validate custom patterns only | false |
--syntax | Check syntax only | false |
Examples
# Validate default configuration
vypher validate
# Validate specific config file
vypher validate vypher.prod.yaml
# Validate patterns only
vypher validate --patternslist-detectors
List all available detectors and their descriptions.
vypher list-detectors [options]Options
| Option | Description | Default |
|---|---|---|
--format | Output format (table, json, yaml) | table |
--category | Filter by category | - |
Examples
# List all detectors
vypher list-detectors
# List PII detectors only
vypher list-detectors --category pii
# JSON output
vypher list-detectors --format jsontest-pattern
Test custom regular expression patterns.
vypher test-pattern [options] --pattern <pattern> <text>Options
| Option | Description | Default |
|---|---|---|
--pattern, -p | Regular expression pattern | Required |
--case-sensitive | Case-sensitive matching | false |
--multiline | Multiline matching | false |
--file | Test 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 .envgenerate
Generate configuration templates and examples.
vypher generate [options] <type>Types
config- Generate configuration filepatterns- Generate custom pattern examplesci- Generate CI/CD pipeline configurationdocker- Generate Docker configuration
Options
| Option | Description | Default |
|---|---|---|
--output, -o | Output file path | stdout |
--template | Template variant | default |
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.yamlversion
Display version information.
vypher version [options]Options
| Option | Description | Default |
|---|---|---|
--json | Output in JSON format | false |
Configuration File
Default Locations
Vypher looks for configuration files in the following order:
--configflag valuevypher.yamlin current directoryvypher.ymlin current directory.vypher.yamlin current directory.vypher.ymlin current directory$HOME/.vypher/config.yaml
Environment Variables
Override configuration using environment variables:
| Variable | Description | Example |
|---|---|---|
VYPHER_CONFIG | Configuration file path | /path/to/config.yaml |
VYPHER_OUTPUT_FORMAT | Default output format | json |
VYPHER_DETECTORS | Default detectors | pii,secrets |
VYPHER_LOG_LEVEL | Logging level | info |
VYPHER_THREADS | Thread count | 4 |
Exit Codes
| Code | Description |
|---|---|
| 0 | Success (no sensitive data found) |
| 1 | Sensitive data detected |
| 2 | Warning (scan completed with warnings) |
| 3 | Error (scan failed) |
| 4 | Configuration error |
| 5 | Invalid arguments |
Examples
Common Usage Patterns
Quick repository scan:
vypher scan . --progress --output scan-results.jsonCI/CD pipeline scan:
vypher scan . --detectors all --format json --quiet > results.jsonConfiguration validation:
vypher validate && echo "Configuration is valid"High-sensitivity scan with exclusions:
vypher scan . \
--sensitivity high \
--exclude "node_modules/**,build/**,*.min.*" \
--progressTest custom patterns:
vypher test-pattern \
--pattern "\\bCUST-\\d{8}\\b" \
--file customer_data.txtShell 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.ps1Related Topics
- Basic Usage - Learn scanning fundamentals
- Configuration - Configure Vypher
- Custom Detectors - Create custom patterns
Last updated on