> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/jp/secrets-manager/secrets-manager-command-line-interface/custom-record-types.md).

# カスタムのレコードタイプ

## 概要

KeeperシークレットマネージャーCLIには、利用できるデフォルトのレコードタイプが用意されています。カスタムレコードタイプを使ったレコードの作成も可能です。

{% hint style="info" icon="comment-question" %}
**カスタムレコードタイプについて**、詳しくは[エンタープライズガイド](/enterprise-guide/jp/record-types.md)をご参照ください。
{% endhint %}

カスタムレコードタイプを使ったレコードを作成するには、CLI内でスキーマを定義する必要があります。[Keeperコマンダー](/keeperpam/jp/commander-cli/overview.md)でカスタムレコードタイプをエクスポートします。

以下の例では、「My Custom」レコードタイプをJSON形式で `my_record_type.json` にエクスポートします。

```
My Vault> rti --format json -lr "My Custom" --output my_record_type.json
```

JSONファイルは `record_type` ディレクトリにコピーします。`record_type` は `keeper.ini` と同じディレクトリでなくても構いません。CLIが `keeper.ini` を検索する場所のいずれかに置いてください。

* 環境変数 **`KSM_INI_DIR`** で定義されたパス
* 現在のディレクトリ
* ユーザーのホームディレクトリ
  * `${HOME}`
  * `${HOME}/.config/ksm`
  * `${HOME}/.keeper`
  * `$env:USERPROFILE`
* 各種システムディレクトリ
  * `/etc`
  * `/etc/ksm`
  * `/etc/keeper`
  * `$env:APPDATA/Keeper`
  * `$env:ProgramData/Keeper`
  * `$env:ProgramFiles/Keeper`

別のディレクトリを使う場合は、[configコマンド](/keeperpam/jp/secrets-manager/secrets-manager-command-line-interface/config-command.md)で指定できます。

```
$ ksm config record-type-dir -d /path/to/my/record/type/schemas
```

ファイルを `record_type` ディレクトリにコピーすると、利用可能なレコードタイプの一覧に表示されます。

```
 $ ksm secret template record -l
 Record Type
 ------------------------
 login
 bankAccount
 address
 ...
 My Custom
```

この時点で、カスタムレコードタイプを使って新しいレコードを作成できます。

```
$ ksm secret add field --sf XXXX --rt "My Custom" -t "My Record" \
    "login=jsmith" "password=XXXX" "url=https://localhost"
```

カスタムレコードタイプ名にスペースが含まれる場合は、名前を引用符で囲んでください。

{% hint style="info" %}
カスタムレコードタイプ名はすべて一意である必要があります。同じ名前のレコードタイプがすでにインポートされている場合はエラーになります。デフォルトのレコードタイプは上書きできません。
{% endhint %}


---

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

```
GET https://docs.keeper.io/keeperpam/jp/secrets-manager/secrets-manager-command-line-interface/custom-record-types.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.
