> 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>                     スキャナーを release または PR のゲーティングモードで実行するかを指定します。release ゲーティングモードでは main ブランチをスキャンし、リリースを妨げるべき問題があるかを確認するために待機します。プルリクエストモードでは、Aikido はブランチに追加された新しい脆弱性のみを検出します（差分をスキャンします）。比較を機能させるには、base と head の commit を指定する必要があります。--fail-on フラグと組み合わせて使用してください。(choices: "release", "pr", default: "release")
  --sla-mode                               release ゲーティングモードでは、SLA を超過した問題のみでゲートを失敗させます。
  --base-commit-id <commit-id>             Base commit ID。これは、検出結果が新しいものかどうかを Aikido が比較して判断するためのコミットです。PR ゲーティングモードでのみ使用されます。
  --head-commit-id <commit-id>             Head commit 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>                 各スキャンのタイムアウト（ミリ秒）。(default: 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.
