CLI Usage

The fastest way to scan your projects is using the command-line interface. It's built for speed and easily integrates into your terminal workflows.

Basic Commands

Scan your current project, specific files, or whole directories.

# Scan the current project
apikeyscanner scan .
# Scan a specific file
apikeyscanner scan ./config.py
# Scan a directory
apikeyscanner scan ./src

Filtering & Options

# Only show HIGH severity findings
apikeyscanner scan . --severity HIGH
# Ignore specific directories (e.g. node_modules, venv)
apikeyscanner scan . --ignore "node_modules venv"
# Save a JSON report
apikeyscanner scan . --output reports/report.json
# Print raw JSON output (great for CI/CD pipelines)
apikeyscanner scan . --json

CI/CD Example

You can chain the command to fail your build if any high-risk secrets are found.

apikeyscanner scan . --severity HIGH --json && echo "Safe" || echo "SECRETS FOUND"