> 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 はブランチで新たに導入された脆弱性のみを検出します（差分をスキャンします）。比較を機能させるには 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>                 各スキャンのタイムアウト（ミリ秒）。(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
```

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

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

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

```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
```

**secrets と code のスキャンのみを実行し、/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.
