> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/kdosukyan/local-code-scanning/cli-options-for-local-scanner.md).

# ローカルコードスキャンのCLIオプション

Aikido Security Local Scanner は、Aikido Security のスキャンをあなたの環境内で実行できるツールであり、コードが決して社外に出ないことを保証します。以下に、ローカルスキャナー実行時に指定できるオプションを示します。

### リポジトリのスキャン <a href="#repository-scanning" id="repository-scanning"></a>

```markdown
使用法: aikido-local-scanner scan [options] <path>

スキャンを実行します。

引数:
  path                                     スキャンしたいパス。

オプション:
  --apikey <apikey>                        スキャン結果を Aikido に送信するための API キー。(env: AIKIDO_API_KEY)
  --repositoryname <repositoryname>        結果の作成または送信先となるリポジトリ名。
  --branchname <branchname>                スキャン対象のブランチ名。
  --tmpdirectory <tmpdirectory>            スキャン中に使用する一時ディレクトリ。(default: "./.aikidotmp")
  --debug                                  コマンド出力に追加のデバッグ情報を加えます。
  --disable-artifact-scanning              アーティファクトのスキャンを無効にします。.jar ファイルなどのアーティファクトをスキャンしない代わりに、スキャンを高速化できます。
  --secrets-scanning-full-git-history      秘密情報の検出のために、Git 履歴全体のスキャンを有効にします。
  --scan-types [types...]                  実行するスキャンの種類を指定します。これにより --scanners フラグは上書きされます（下記参照）。(choices: "code", "dependencies", "iac", "secrets", default: [])
  --exclude <exclude_path>                 スキャンから除外するファイルまたはフォルダのパスを指定します。このオプションは複数回指定できます。(default: [])
  --fail-on <severity>                     ゲートモードでスキャナーを実行し、指定した重大度以上で失敗させます。(choices: "low", "medium", "high", "critical")
  --gating-mode <mode>                     スキャナーをリリースゲートモードで実行するか、PR ゲートモードで実行するかを指定します。リリースゲートモードでは main ブランチをスキャンし、リリースを妨げる可能性のある問題がないか確認します。プルリクエストモードでは、Aikido はブランチに新しく追加された脆弱性のみを探します（diff をスキャン）。比較を機能させるには base と head のコミットを指定する必要があります。--fail-on フラグと組み合わせて使用してください。(choices: "release", "pr", default: "release")
  --sla-mode                               リリースゲートモードでは、SLA を超過している問題のみでゲートを失敗させます。
  --base-commit-id <commit-id>             ベースのコミット ID。Aikido が新しい検出結果かどうかを判断するために比較するコミットです。PR ゲートモードでのみ使用されます。
  --head-commit-id <commit-id>             ヘッドのコミット ID。スキャン対象のコミットです。PR ゲートモードでは必須です。
  --gating-result-output <output>          ゲートモード実行時に問題を書き出す JSON ファイル
  --no-fail-on-timeout                     スキャン結果のポーリングがタイムアウトした場合でもプロセスを失敗させません（ゲートモードのみ）
  --max-polling-attempts <amount>          スキャン結果をポーリングする回数です。デフォルト値の 20 で足りない場合は増やしてください（ゲートモードのみ）
  --linked-team-name <name>                リポジトリを関連付けるチーム名。このオプションは複数回指定でき、複数のチームに関連付けられます。(default: [])
  --no-snippets                            このモードを使用すると、コードスニペットを Aikido と共有しません。
  --checkov-skip-extension <extension>     Checkov スキャンで特にスキップする拡張子を指定します。このオプションは複数回指定できます。例: JSON ファイルを無視したい場合、このオプションの値として .json を指定してください。(default: [])
  --no-lockfiles-cache                     自動再スキャンを有効にするため、依存関係ファイルとロックファイルのキャッシュを許可しません
  --scan-timeout <timeout>                 各スキャンのタイムアウト（ミリ秒）。(defaults to 900000ms)。
  --force-create-repository-for-branch     ブランチごとに Aikido に新しいリポジトリを作成します。
  --enable-proxy                           HTTPS_PROXY 環境変数を使用してリクエストをプロキシします。
  --ca-bundle <path>                       --enable-proxy 使用時に信頼するカスタムルート CA を含む PEM ファイルへのパス。(env: AIKIDO_CA_BUNDLE)
  --include-dev-deps                       開発用依存関係のスキャンを有効にします（例: package.json の devDependencies など）
  -h, --help                               コマンドのヘルプを表示します
```

画像スキャンの CLI オプションについては、こちらを参照してください [こちら](/docs/docs-ja/kontenaimjisukyan/local-image-scanning/cli-options-for-local-image-scanning.md).

## 一般的な使用例 <a href="#common-use-cases" id="common-use-cases"></a>

以下に、一般的な使用例の設定例をいくつか示します。

**リポジトリでスキャンを実行したい**

> API キーは環境変数として渡すこともできます *AIKIDO\_API\_KEY*

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main
```

**自分のリポジトリでは SCA スキャンのみを実行したい**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types dependencies
```

**自分のリポジトリでは秘密情報のスキャンのみを実行したい**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types secrets
```

**自分のリポジトリではコードスキャンのみを実行したい**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types code
```

**自分のリポジトリでは IaC スキャンのみを実行したい**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types iac
```

**自分の /staging フォルダと /development フォルダをスキャン対象から除外したい**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--exclude staging 
--exclude development
```

**秘密情報とコードのスキャンのみを実行し、/staging フォルダを除外したい。**

```shellscript
aikido-local-scanner scan ./ 
--apikey AIK_CI_xxx 
--repositoryname DemoApp 
--branchname main 
--scan-types secrets code
--exclude staging
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/kdosukyan/local-code-scanning/cli-options-for-local-scanner.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
