# configコマンド

## `config`コマンド

**説明:** CLIのデバッグ出力を設定します

**パラメータ:**

実行するサブコマンド

形式: **`ksm config <sub-command>`**

**サブコマンド:**

| サブコマンド            | 説明                                 |
| ----------------- | ---------------------------------- |
| `color`           | カラー表示を有効または無効にします                  |
| `cache`           | レコードのキャッシュを有効または無効にします             |
| `record-type-dir` | カスタムのレコードタイプのスキーマを格納するディレクトリを設定します |
| `editor`          | 新しいレコードをGUI操作で追加するためのエディタを設定します    |
| `show`            | 現在のCLI設定を表示します                     |

### **color**

`ksm config color <--enable | --disable>`

**オプション:**

`--enable` カラー表示を有効化

`--disable` カラー表示を無効化

**例:**

```
$ ksm config color --disable
$ ksm config show
 Config Item            Value
 ---------------------- --------------
 Color Enabled          False
```

### **cache**

レコードのキャッシュはレコードのコピーを作成し、CLIがシークレットマネージャーサーバーにアクセスできない場合に使用されます。レコードのコピーは、ローカルストレージに暗号化されて保存されます。

`ksm config cache <--enable | --disable>`

**オプション:**

`--enable` レコードのキャッシュを有効化

`--disable` レコードのキャッシュを無効化

**例:**

```
$ ksm config cache --enable
$ ksm config show
 Config Item            Value
 ---------------------- -----------
 Cache Enabled          True
```

### record-type-dir

カスタムのレコードタイプのスキーマファイルを格納するレコードタイプのスキーマディレクトリを設定します。

`ksm config record-type-dir [-d DIRECTORY PATH] [--clear]`

**オプション:**

`--directory, -d` ディレクトリのパス

`--clear` ディレクトリのパスを削除

**例:**

```
$ ksm config record-type-dir -d /path/to/directory
$ ksm config show
 Config Item            Value
 ---------------------- -----------
 Record Type Directory  /path/to/directory
```

### editor

レコードをGUI操作で追加するときに使用するエディタを設定します。

`ksm config editor [--app APPLICATION] [--blocking] [--process-name PROCESS NAME]`

**オプション:**

`--application、--app` 起動するエディタアプリケーション。

`--clear` ディレクトリのパスを削除

**アプリケーションのオプション:**

これらのオプションは、`--application`を設定するときに使用できます。

`--blocking` CLIがレコードデータを途中で処理しないように有効化します。

`--process-name` blockingで使用し、タスクリストで実際のプロセス名を検索します。

**例:**

```
 ksm config editor --app Code --blocking --proces-name code.exe
$ ksm config show
 Config Item            Value
 ---------------------- -----------
 Editor                 Code (code.exe)
 Editor Blocking        True

```

{% hint style="info" %}
UIを搭載するエディタなど一部のアプリケーションは起動時にCLIをブロックしません。アプリケーションがブロックしない場合、CLIは変更が行われる前にレコードテンプレートの解析を試みます。

Mac OSでは、アプリケーションが完全に終了するまでブロックして待機します。完全に終了するというのは、エディタウィンドウが閉じている状態ではなく、エディタがまったく実行されていない状態を意味します。

Windowsのブロックは、プロセスが終了するまでタスクリストを監視します。ただし、アプリケーションが.batファイルまたは.cmdファイルを使用する場合は、別の名前でエディタが起動されます。このような場合は、`--process-name`を設定する必要があります。CLIは、エディタの起動に使用される名前ではなく、プロセス名を監視します。
{% endhint %}

### **show**

`ksm config show`

**例:**

```
$ ksm config show
 Config Item            Value
 ---------------------- -----------
 Active Profile         all_records
 Cache Enabled          False
 Color Enabled          False
 Record Type Directory  -NOT SET-
 Editor                 vim (NA)
 Editor Blocking        False
```


---

# Agent Instructions: 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:

```
GET https://docs.keeper.io/keeperpam/jp/secrets-manager/secrets-manager-command-line-interface/config-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
