Follow the CLI Scanner page to set up either the standalone binary or the Docker image of the HoundDog.ai code scanner.
Standalone Binary
Section titled “Standalone Binary”To scan a file or directory (defaults to the current directory):
hounddog scan [path] [options]To see the available command-line options:
hounddog scan --helpDocker Image
Section titled “Docker Image”To scan a directory:
docker run --pull=always -it --rm -v /path/to/repo:/data hounddogai/hounddog hounddog scan [options]Let’s break down the command above:
| Argument / Option | Required | Description |
|---|---|---|
docker run |
Yes | Start a new Docker container. |
--pull=always |
No | Always pull the latest version of the Docker image. |
-it |
No | Create an interactive session and attach a pseudo-TTY to enable colored output and proper rendering for your terminal size. Important: in a non-interactive environment (for example, build pipelines), use only the -t flag. |
--rm |
No | Clean up the container after it exits. |
-v /path/to/repo:/data |
Yes | Mount the host directory into the container’s /data directory, the default scan path inside the HoundDog.ai Docker image. |
hounddogai/hounddog |
Yes | Name of the HoundDog.ai scanner image, hosted on Docker Hub. |
hounddog scan |
Yes | The scan command, which scans the code mounted at /data. |
Demonstration
Section titled “Demonstration”To see the privacy scanner in action, scan HoundDog.ai’s TypeScript test repository, a healthcare application that contains deliberate privacy flaws:
# Clone the test repositorygit clone https://github.com/hounddogai/hounddog-test-typescript
# Scan the test repositoryhounddog scan hounddog-test-typescriptUseful variations:
# Show detailed dataflow traceshounddog scan hounddog-test-typescript --trace
# Only show critical and medium severity dataflowshounddog scan hounddog-test-typescript --severity=critical,medium
# Generate a Markdown reporthounddog scan hounddog-test-typescript --output-format=markdown --output-path=report.mdNext Steps
Section titled “Next Steps”- Generate a Markdown report for a shareable point-in-time view.
- Set up an API key to upload results to the HoundDog.ai Cloud Platform.
- Explore all command-line options.
