Chapter 8: CLI リファレンス
コマンドラインからの操作・自動化
基本構文
Dependa.exe <command> [options]
コマンド一覧
| コマンド | 説明 |
help | ヘルプを表示します。 |
version | バージョン情報を表示します。 |
scan | 指定したパスのプロジェクトをスキャンします。 |
scan コマンドのオプション
| オプション | 説明 |
--path <path> | スキャン対象のプロジェクトフォルダまたはファイルのパス(必須)。 |
--output <path> | 結果の出力先パス。JSON ファイルとして保存されます。 |
--lang <ja|en> | レポートの言語を指定します(デフォルト: 設定に従う)。 |
--accept-terms | 利用規約に同意します(初回実行時に必要)。 |
--verbose | 詳細なログを出力します。 |
--use-online-vuln | OSV API によるオンライン脆弱性照合を有効にします。Pro |
--use-online-license-metadata | PyPI API によるオンラインライセンス補完を有効にします。Pro |
--ai-prompt <type> | AI プロンプトを生成します。type: VulnerabilityRemediation, LicenseReview, DeltaScanReview |
終了コード
| コード | 意味 |
0 | 成功(ポリシー違反なし) |
1 | 一般エラー |
2 | ポリシー違反が検出された(Critical/High 脆弱性または Prohibited ライセンス) |
3 | Pro ライセンスが必要な機能が使用された |
4 | データパック検証失敗 |
5 | 不正な引数 |
6 | 利用規約に未同意 |
7 | Integrity 検証失敗 |
使用例
基本スキャン
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
| Command | Description |
help | Display help information. |
version | Display version information. |
scan | Scan a project at the specified path. |
Scan Command Options
| Option | Description |
--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-terms | Accept the terms of use (required on first run). |
--verbose | Output detailed logs. |
--use-online-vuln | Enable online vulnerability lookup via OSV API. Pro |
--use-online-license-metadata | Enable online license metadata via PyPI API. Pro |
--ai-prompt <type> | Generate an AI prompt. Types: VulnerabilityRemediation, LicenseReview, DeltaScanReview |
Exit Codes
| Code | Meaning |
0 | Success (no policy violations) |
1 | General error |
2 | Policy violation detected (Critical/High vulnerability or Prohibited license) |
3 | Pro license required for the requested feature |
4 | Data pack verification failed |
5 | Invalid arguments |
6 | Terms of use not accepted |
7 | Integrity 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.