> 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>                        スキャン結果を Aikdo に送信するための 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 はブランチに新しく導入された脆弱性のみを探します（差分をスキャンします）。比較を機能させるには、ベースコミットとヘッドコミットを指定する必要があります。--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                     自動再スキャンを有効にするために、依存関係ファイルおよび lockfile のキャッシュを許可しません
  --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.
