CLI Guide

Draai beveiligingsscans, monitor sites en integreer met Claude Code vanuit je terminal.

Snelle scans

Scan elke URL in seconden

Live monitoring

Continu monitoring vanuit terminal

MCP Server

Claude Code integratie

Installatie

Installeer de CLI globaal via npm, of gebruik npx om direct te draaien.

Globaal installeren
npm install -g @shadowguard/cli
Of direct via npx
npx @shadowguard/cli scan https://jouw-site.nl

Setup

Configureer de CLI met je API key voor authenticatie.

Interactieve setup
shadowguard setup

De setup wizard vraagt om je API key en slaat deze op in ~/.shadowguard/config.json.

~/.shadowguard/config.jsonJSON
{
  "api_key": "sg_jouw_api_key",
  "base_url": "https://shadowguard.nl",
  "default_format": "table"
}

Je kunt ook de API key als environment variable instellen:

export SHADOWGUARD_API_KEY=sg_jouw_api_key

Commando's

shadowguard scan <url>

Voer een beveiligingsscan uit op een URL. Scant SSL/TLS certificaten, security headers en blootgestelde endpoints.

Argumenten

<url>verplichtDe URL om te scannen

Opties

--format <type>Output formaat(default: table)
--jsonOutput als JSON
--verboseToon gedetailleerde scan informatie
--site-id <uuid>Koppel scan aan bestaande site
Voorbeeld
shadowguard scan https://mijn-site.nl

# Met JSON output
shadowguard scan https://mijn-site.nl --json

# Gekoppeld aan een site
shadowguard scan https://mijn-site.nl --site-id 550e8400-e29b-41d4-a716-446655440000
Output
ShadowGuard Security Scan
========================

URL:      https://mijn-site.nl
Score:    82/100
Grade:    goed
Platform: nextjs

Findings:
+-----------+------+---------------------------------------+
| Severity  | Type | Beschrijving                          |
+-----------+------+---------------------------------------+
| HIGH      | HDR  | Strict-Transport-Security ontbreekt   |
| MEDIUM    | HDR  | Content-Security-Policy te permissief |
| MEDIUM    | HDR  | X-Frame-Options ontbreekt             |
| LOW       | SSL  | OCSP stapling niet ingeschakeld       |
+-----------+------+---------------------------------------+

4 findings gevonden (0 critical, 1 high, 2 medium, 1 low)
shadowguard results <scan-id>

Bekijk gedetailleerde resultaten van een eerdere scan, inclusief alle findings met impact en remediation.

Argumenten

<scan-id>verplichtUUID van de scan

Opties

--severity <level>Filter op severity: critical, high, medium, low
--jsonOutput als JSON
Voorbeeld
shadowguard results d290f1ee-6c54-4b01-90e6-d701748f0851

# Alleen kritieke findings
shadowguard results d290f1ee-... --severity critical
Output
Scan Details
============

Scan ID:  d290f1ee-6c54-4b01-90e6-d701748f0851
Site:     Mijn Website (https://mijn-site.nl)
Datum:    7 feb 2026 12:00
Score:    82/100 (goed)

--- Finding 1/4 ---
[HIGH] Strict-Transport-Security header ontbreekt
Impact:    Bezoekers kunnen via HTTP verbinden, kwetsbaar voor downgrade aanvallen
Remediation: Voeg HSTS header toe: Strict-Transport-Security: max-age=31536000; includeSubDomains
Referentie: https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security
shadowguard monitor <url>

Start continue monitoring van een URL. Draait periodieke scans en toont veranderingen in real-time.

Argumenten

<url>verplichtDe URL om te monitoren

Opties

--interval <minuten>Scan interval in minuten(default: 60)
--alert-on <level>Alert bij severity level of hoger(default: high)
--webhook <url>Stuur alerts naar webhook URL
Voorbeeld
# Monitor elke 30 minuten
shadowguard monitor https://mijn-site.nl --interval 30

# Alert bij medium of hoger naar Slack
shadowguard monitor https://mijn-site.nl \
  --alert-on medium \
  --webhook https://hooks.slack.com/services/...
Output
[12:00] Monitoring gestart voor https://mijn-site.nl (interval: 30min)
[12:00] Scan #1: Score 82/100 (goed) - 4 findings
[12:30] Scan #2: Score 82/100 (goed) - 4 findings (geen wijzigingen)
[13:00] Scan #3: Score 75/100 (matig) - 6 findings (+2 NIEUW)
        [!] NIEUW: [HIGH] X-Content-Type-Options header ontbreekt
        [!] NIEUW: [MEDIUM] Referrer-Policy te permissief
shadowguard config

Bekijk of wijzig de CLI configuratie.

Opties

--set <key>=<value>Stel een configuratie waarde in
--get <key>Toon een specifieke configuratie waarde
--listToon alle configuratie waardes
Voorbeeld
# Toon huidige configuratie
shadowguard config --list

# Wijzig default formaat
shadowguard config --set default_format=json

# Toon API key (gemaskeerd)
shadowguard config --get api_key
Output
ShadowGuard CLI Configuratie
============================

api_key:        sg_****...h8
base_url:       https://shadowguard.nl
default_format: table
config_path:    ~/.shadowguard/config.json

MCP Server

De ShadowGuard CLI bevat een ingebouwde MCP (Model Context Protocol) server voor directe integratie met Claude Code en andere AI-assistenten.

Wat is MCP?

Het Model Context Protocol (MCP) stelt AI-assistenten in staat om direct met tools te communiceren. Met de ShadowGuard MCP server kan Claude Code beveiligingsscans uitvoeren, resultaten analyseren en fixes voorstellen -- allemaal vanuit je editor.

MCP Server starten

Terminal
shadowguard mcp

De MCP server start op stdio en wacht op verbindingen van een MCP client.

Claude Code configuratie

Voeg ShadowGuard toe aan je Claude Code MCP settings:

~/.claude/claude_desktop_config.jsonJSON
{
  "mcpServers": {
    "shadowguard": {
      "command": "shadowguard",
      "args": ["mcp"],
      "env": {
        "SHADOWGUARD_API_KEY": "sg_jouw_api_key"
      }
    }
  }
}

Beschikbare MCP tools

shadowguard_scan

Voer een beveiligingsscan uit op een URL

Params: url: string, site_id?: string

shadowguard_results

Haal resultaten op van een eerdere scan

Params: scan_id: string

shadowguard_findings

Zoek findings met filters

Params: severity?: string, status?: string, site_id?: string

shadowguard_suggest

Dien een security improvement suggestie in

Params: title: string, description: string, type: string, diff?: string

shadowguard_config

Lees de platformconfiguratie

Params: (geen parameters)

Voorbeeld in Claude Code

Na configuratie kan Claude Code de ShadowGuard tools direct gebruiken:

Jij:

“Scan mijn site https://mijn-app.nl en fix alle security issues die je vindt.”

Claude Code:

Ik ga een beveiligingsscan uitvoeren op je site...

Tool: shadowguard_scan({url: "https://mijn-app.nl"})

De scan toont 3 issues. Ik ga de HSTS header toevoegen aan je middleware.ts en een Content-Security-Policy instellen...

CI/CD Integratie

Gebruik de CLI in je CI/CD pipeline om automatisch scans te draaien bij elke deployment.

GitHub Actions

.github/workflows/security.ymlYAML
name: Security Scan
on:
  push:
    branches: [main]
  pull_request:

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install ShadowGuard CLI
        run: npm install -g @shadowguard/cli

      - name: Run security scan
        env:
          SHADOWGUARD_API_KEY: ${{ secrets.SHADOWGUARD_API_KEY }}
        run: |
          shadowguard scan ${{ vars.SITE_URL }} --json > scan-results.json

          # Fail als er critical findings zijn
          CRITICAL=$(cat scan-results.json | jq '.counts.critical')
          if [ "$CRITICAL" -gt 0 ]; then
            echo "::error::$CRITICAL kritieke beveiligingsproblemen gevonden!"
            exit 1
          fi

      - name: Upload scan results
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: security-scan
          path: scan-results.json

GitLab CI

.gitlab-ci.ymlYAML
security_scan:
  stage: test
  image: node:20
  script:
    - npm install -g @shadowguard/cli
    - shadowguard scan $SITE_URL --json > scan-results.json
    - |
      CRITICAL=$(cat scan-results.json | jq '.counts.critical')
      if [ "$CRITICAL" -gt 0 ]; then
        echo "Kritieke beveiligingsproblemen gevonden!"
        exit 1
      fi
  artifacts:
    reports:
      security: scan-results.json
  variables:
    SHADOWGUARD_API_KEY: $SHADOWGUARD_API_KEY

API Reference bekijken

Volledige REST API documentatie met alle endpoints.

API Reference