Chapter 8: CLI リファレンス

コマンドラインからの操作・自動化

基本構文

Dependa.exe <command> [options]

コマンド一覧

コマンド説明
helpヘルプを表示します。
versionバージョン情報を表示します。
scan指定したパスのプロジェクトをスキャンします。

scan コマンドのオプション

オプション説明
--path <path>スキャン対象のプロジェクトフォルダまたはファイルのパス(必須)。
--output <path>結果の出力先パス。JSON ファイルとして保存されます。
--lang <ja|en>レポートの言語を指定します(デフォルト: 設定に従う)。
--accept-terms利用規約に同意します(初回実行時に必要)。
--verbose詳細なログを出力します。
--use-online-vulnOSV API によるオンライン脆弱性照合を有効にします。Pro
--use-online-license-metadataPyPI API によるオンラインライセンス補完を有効にします。Pro
--ai-prompt <type>AI プロンプトを生成します。type: VulnerabilityRemediation, LicenseReview, DeltaScanReview

終了コード

コード意味
0成功(ポリシー違反なし)
1一般エラー
2ポリシー違反が検出された(Critical/High 脆弱性または Prohibited ライセンス)
3Pro ライセンスが必要な機能が使用された
4データパック検証失敗
5不正な引数
6利用規約に未同意
7Integrity 検証失敗

使用例

基本スキャン

Dependa.exe scan --path C:\my-project --accept-terms

結果を JSON に出力

Dependa.exe scan --path C:\my-project --output C:\reports\result.json --lang ja

Pro 機能付きスキャン

Dependa.exe scan --path C:\my-project --use-online-vuln --use-online-license-metadata --verbose

AI プロンプト生成付きスキャン

Dependa.exe scan --path C:\my-project --ai-prompt VulnerabilityRemediation

CI/CD 統合例(GitHub Actions)

- name: Run Dependa Scan
  run: |
    Dependa.exe scan --path . --output result.json --accept-terms
  continue-on-error: false
  # 終了コード 2 でポリシー違反時にパイプラインを停止

CI/CD 統合例(PowerShell)

$result = Start-Process -FilePath "Dependa.exe" `
  -ArgumentList "scan", "--path", ".", "--accept-terms", "--output", "result.json" `
  -Wait -PassThru -NoNewWindow

if ($result.ExitCode -eq 2) {
    Write-Error "Policy violation detected."
    exit 1
}

CI/CD で使用する場合、--accept-terms フラグを付けて利用規約への同意を自動化できます。

Chapter 8: CLI Reference

Command-line usage and automation

Basic Syntax

Dependa.exe <command> [options]

Commands

CommandDescription
helpDisplay help information.
versionDisplay version information.
scanScan a project at the specified path.

Scan Command Options

OptionDescription
--path <path>Path to the project folder or file to scan (required).
--output <path>Output path for results. Saved as a JSON file.
--lang <ja|en>Specify the report language (default: follows settings).
--accept-termsAccept the terms of use (required on first run).
--verboseOutput detailed logs.
--use-online-vulnEnable online vulnerability lookup via OSV API. Pro
--use-online-license-metadataEnable online license metadata via PyPI API. Pro
--ai-prompt <type>Generate an AI prompt. Types: VulnerabilityRemediation, LicenseReview, DeltaScanReview

Exit Codes

CodeMeaning
0Success (no policy violations)
1General error
2Policy violation detected (Critical/High vulnerability or Prohibited license)
3Pro license required for the requested feature
4Data pack verification failed
5Invalid arguments
6Terms of use not accepted
7Integrity verification failed

Usage Examples

Basic Scan

Dependa.exe scan --path C:\my-project --accept-terms

Output Results to JSON

Dependa.exe scan --path C:\my-project --output C:\reports\result.json --lang en

Scan with Pro Features

Dependa.exe scan --path C:\my-project --use-online-vuln --use-online-license-metadata --verbose

Scan with AI Prompt Generation

Dependa.exe scan --path C:\my-project --ai-prompt VulnerabilityRemediation

CI/CD Integration (GitHub Actions)

- name: Run Dependa Scan
  run: |
    Dependa.exe scan --path . --output result.json --accept-terms
  continue-on-error: false
  # Exit code 2 stops the pipeline on policy violations

CI/CD Integration (PowerShell)

$result = Start-Process -FilePath "Dependa.exe" `
  -ArgumentList "scan", "--path", ".", "--accept-terms", "--output", "result.json" `
  -Wait -PassThru -NoNewWindow

if ($result.ExitCode -eq 2) {
    Write-Error "Policy violation detected."
    exit 1
}

When used in CI/CD, the --accept-terms flag automates the terms of use acceptance.