> 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/commander-cli/command-reference/record-commands/record-type-commands.md).

# レコードタイプに関するコマンド

レコードタイプとカスタムテンプレートを作成および管理するためのコマンド

Keeperレコードタイプは、ログイン情報、支払いカード、SSHキー、サーバーなど、あらゆる種類の情報を含めることができる構造化テンプレートです。

## コマンド <a href="#commands" id="commands"></a>

#### Keeperコマンドリファレンス <a href="#keeper-command-reference" id="keeper-command-reference"></a>

対話型シェル、CLI、JSON設定ファイルのいずれを使用する場合でも、以下のコマンドがサポートされており、各コマンドでは追加のパラメータとオプションがご利用になれます。

特定のコマンドのヘルプを表示するには、次のコマンドを実行します。

`help <command>`

#### レコードタイプに関連する全コマンド <a href="#all-commands-associated-with-record-types" id="all-commands-associated-with-record-types"></a>

| コマンド                                                      | 説明                                     |
| --------------------------------------------------------- | -------------------------------------- |
| [`record-type-info` または `rti`](#record-type-info-command) | レコードタイプを一覧表示するか、特定のレコードタイプに関する情報を表示します |
| [`record-type` または `rt`](#record-type-command)            | カスタムのレコードタイプを追加、編集、削除します               |
| [`convert`](#convert-command)                             | 従来のレコードをレコードタイプ型のレコードに変換します            |
| [`convert-all`](#convert-all-command)                     | ボルト内のすべての従来のレコードをレコードタイプ型のレコードに変換します   |

### **record-type-infoコマンド** <a href="#record-type-info-command" id="record-type-info-command"></a>

**コマンド:** `record-type-info` または `rti`

**詳細:** 利用可能なレコードタイプを一覧表示するか、特定のレコードタイプのフィールドレベルの詳細を表示します。

**スイッチ:**

`-lr`、`--list-record <レコードタイプかID (オプション)>`

* レコードタイプ名またはIDが指定されていない場合は、すべてのレコードタイプ名とIDが一覧表示されます
* レコードタイプ名またはIDが指定されている場合は、レコードタイプの詳細情報とフィールドが表示されます

`-lf`, `--list-field <FIELD NAME>` 指定したフィールドタイプに関する情報を表示します。「\*」を使用してすべてのフィールドを表示できます。

`-e`、`--example` レコードタイプまたはフィールドのjsonサンプルを生成します。`-lr` または `-lf` と一緒に使用する必要があります

`-ef`、`--effective` `-lr` の結果を、エンタープライズロールのポリシー (`RESTRICT_RECORD_TYPES`) で作成が許可されているレコードタイプのみに絞り込みます。レコードタイプ制限ポリシーが無いユーザーでは効果がありません。

`--syntax-help` レコードタイプのパラメータに関する拡張ヘルプを表示します

`--format <{csv, json, table}>` 出力形式を選択します

`--output <出力ファイル>` 指定したファイルに結果を出力します。\*表形式が使用されている場合は無視されます

#### **例:** <a href="#examples" id="examples"></a>

構文ヘルプの表示

```
My Vault> rti --syntax-help

Get Record Types Command Syntax Description:

Column Name       Description
  recordTypeId      Record Type Id
  content           Record type description in JSON format

--format:
            csv     CSV format
            json    JSON format
            table   Table format (default)

--example|-e:       Print example JSON for the field or record type

--list-record|-lr:  List specific record type - search by name or ID
--list-field|-lf:   List specific field type - search by name
```

レコードタイプ一覧の表示

```
My Vault> rti

  Record Type ID  Record Type Name
----------------  ------------------------------
               1  address
               2  bankAccount
               3  bankCard
               4  birthCertificate
               5  contact
               6  databaseCredentials
               7  driverLicense
               8  encryptedNotes
               9  file
              10  general
              11  healthInsurance
              12  login
              13  membership
              14  passport
              15  photo
              16  serverCredentials
              17  softwareLicense
              18  sshKeys
              19  ssnCard
              96  wifiCredentials
         3000082  pamDatabase
         3000083  pamDirectory
         3000084  pamMachine
         3000085  pamUser
         3000093  pamRemoteBrowser
         4000086  pamAwsConfiguration
         4000087  pamAzureConfiguration
         4000088  pamLocalConfiguration
         4000089  pamNetworkConfiguration
         4000094  pamDomainConfiguration
```

エンタープライズロールで作成が許可されているレコードタイプのみを表示します。

```
My Vault> rti -lr -ef
  Record Type ID  Record Type Name
----------------  -----------------------
               1  address
               2  bankAccount
               3  bankCard
               4  birthCertificate
               5  contact
               6  databaseCredentials
               7  driverLicense
               8  encryptedNotes
               9  file
         3000084  pamMachine
         3000085  pamUser
```

ログイン情報のレコードタイプのフィールドとJSON構造を表示

```
My Vault> rti -lr login

  Record Type ID  Content
----------------  ----------------------------------
              12  {
                    "$id": "login",
                    "categories": [
                      "login"
                    ],
                    "description": "Login template",
                    "fields": [
                      {
                        "$ref": "passkey"
                      },
                      {
                        "$ref": "login"
                      },
                      {
                        "$ref": "password"
                      },
                      {
                        "$ref": "url"
                      },
                      {
                        "$ref": "fileRef"
                      },
                      {
                        "$ref": "oneTimeCode"
                      }
                    ]
                  }
```

すべてのフィールドタイプの一覧を表示

```
/My Vault> rti -lf *

Field Type ID     Type              Lookup         Multiple    Description
----------------  ----------------  -------------  ----------  ------------------------------------------------------------------------------
text              text                                         plain text
secret            text                                         plain text
title             text                                         plain text
login             login             login                      Login field, detected as the website login for browser extension or KFFA.
password          password                                     Field value is masked and allows for generation. Also complexity enforcements.
name              name              name                       multiple fields to capture name
company           text              company                    plain text
phone             phone             phone          optional    numbers and symbols only plus tag
email             email             email          optional    valid email address plus tag
address           address                                      multiple fields to capture address
addressRef        addressRef        addressRef                 reference to the address field on another record
date              date                                         calendar date with validation, stored as unix milliseconds
expirationDate    date                                         calendar date with validation, stored as unix milliseconds
birthDate         date                                         calendar date with validation, stored as unix milliseconds
paymentCard       paymentCard                                  Field consisting of validated card number, expiration date and security code.
accountNumber     text              accountNumber              plain text
groupNumber       text                                         plain text
bankAccount       bankAccount       accountNumber              bank account information
cardRef           cardRef           bankCard       default     reference to the bankCard field on another record
note              multiline                                    multiline text
url               url                              optional    url string, can be clicked
fileRef           fileRef                          default     reference to the file field on another record
host              host              host           optional    multiple fields to capture host information
securityQuestion  securityQuestion                 default     Security Question and Answer
pinCode           secret                                       the field value is masked
oneTimeCode       otp                                          captures the seed, displays QR code
keyPair           privateKey                                   private key in ASN.1 format
licenseNumber     multiline                                    multiline text
multiline         multiline                                    multiline text
passkey           passkey                                      Password-less login
```

フィールドタイプ「Host」の詳細を取得

```
My Vault> rti -lf host

Field Type ID    Type    Value Type    Value Format
---------------  ------  ------------  ----------------------------
host             host    object        {'hostName': '', 'port': ''}
```

「passport」タイプのJSONレコードの例を表示

```
My Vault> rti -lr passport -e
{
  "type": "passport",
  "title": "text",
  "notes": "text",
  "fields": [
    {
      "type": "accountNumber",
      "value": [
        "text"
      ],
      "label": "passportNumber"
    },
    {
      "type": "name",
      "value": [
        {
          "first": "text",
          "middle": "text",
          "last": "text"
        }
      ]
    },
    {
      "type": "birthDate",
      "value": [
        0
      ]
    },
    {
      "type": "addressRef",
      "value": []
    },
    {
      "type": "expirationDate",
      "value": [
        0
      ]
    },
    {
      "type": "date",
      "value": [
        0
      ],
      "label": "dateIssued"
    },
    {
      "type": "password",
      "value": [
        "text"
      ]
    },
    {
      "type": "fileRef",
      "value": []
    }
  ],
  "custom": []
}
```

レコードタイプ情報をCSVとしてファイルに書き出し

```
rti --output logs/record-types.csv --format csv
```

***

### **record-typeコマンド** <a href="#record-type-command" id="record-type-command"></a>

**コマンド:** `record-type` または `rt`

#### **詳細:** <a href="#detail" id="detail"></a>

カスタムのレコードタイプを追加、変更、削除します

#### **パラメータ:** <a href="#parameters" id="parameters"></a>

レコードタイプID (更新または削除の場合)

#### **スイッチ:** <a href="#switches" id="switches"></a>

`-a`、`--action <{add, update, remove}>` 実行する操作

* add - 新しいカスタムのレコードタイプを作成します
* update - 既存のカスタムのレコードタイプを変更します
* remove - 既存のカスタムのレコードタイプを削除します

`--data <DATA>` レコードタイプのJSON形式の定義

#### **形式:** <a href="#format" id="format"></a>

レコードタイプは以下の書式設定を利用します。

{% code overflow="wrap" %}

```
{ 
  "$id": <record type name>,
  "fields": [ 
    { "$ref": <field type>}, 
    { "$ref": <field type>, "label": <field label(optional)>, required: <true/false>}
  ] 
}
```

{% endcode %}

例:

```javascript
{
   "$id":"My Record Type",
   "fields": [
      {
        "$ref":"login",
        "label":"AppLogin",
        "required":true
      },
      {
        "$ref":"name",
        "label":"Your name"
      },
      {
        "$ref":"address",
        "required":true
      }
    ]
}
```

使用可能なフィールドタイプの一覧を表示するには、`rti -lf *` コマンドを使用します。

**例:**

{% code overflow="wrap" lineNumbers="true" %}

```
rt --action add --data '{"$id":"My Record Type", "fields": [{"$ref":"login","label":"AppLogin","required":true},{"$ref":"name","label":"Your name"},{"$ref":"address","required":true}]}'
rt 102 -a update --data '{"$id":"My Record Type", "fields": [{"$ref":"login","label":"AppLogin","required":true},{"$ref":"name","label":"Your name"}]}'
rt 102 -a remove
```

{% endcode %}

1. 「My Record Type」という名前の新しいレコードタイプを追加します。
2. 「My Record Type」レコードタイプ (この例ではIDが102) を更新します。 ここでは、「Address」フィールドが削除されました。
3. IDが102のレコードタイプを削除します。

***

### convertコマンド <a href="#convert-command" id="convert-command"></a>

**バージョン:** `v16.5.9以降`

**コマンド:** `convert`

**詳細:** 従来の (一般的なタイプ指定された、またはタイプ指定されていない) レコードをタイプ指定されたレコードに変換します。

{% hint style="info" %}
convertコマンドは、タイプ指定されていない従来のレコードのみをタイプ指定されたレコードに変換します。

タイプ指定されたレコードのタイプを変換するには、[`edit`](/keeperpam/jp/commander-cli/command-reference.md#edit-command-record-types) コマンドをご利用ください。

ボルト内の従来のレコードを**すべて**一度に変換するには、代わりに `convert-all` コマンドをご利用ください。
{% endhint %}

**パラメータ**

現在のフォルダ内のレコードに一致するパターン。 UIDとタイトルを照合します。任意の1文字に一致する「?」と任意の数の文字に一致する「\*」を使用できます

**スイッチ**

`-t`、`--record-type <RECORD TYPE OR ID >` レコードの変換先のタイプ

`-q`、`--quiet` 一致および変換されたレコードの情報を表示しません

`-u`, `--url <URL Pattern>` 指定したパターンに一致するURLを持つレコードのみを変換します。 任意の1文字に一致する「?」と任意の数の文字に一致する「\*」を使用できます

`-n`、`--dry-run` レコードは一切変換せずに変換結果を表示します

`-r`、`--recursive` 現在のフォルダと子フォルダのすべての一致するレコードに変換を適用します

`--ignore-ownership` 現在のアカウントが所有していないレコードでも変換します

**例:**

```
convert Dtvb84zwkBmZgxrUByUfpg --record-type login
convert * --record-type login --recursive --dry-run
convert * -t login -r
convert *sql* -t databaseCredentials 
convert *ssh-? -t sshKeys --recursive
```

1. 指定したUIDを持つタイプ指定されていないレコードをログインレコードタイプに変換します。
2. ボルト内のすべてのレコードの変換のドライランを実行し、変換されるレコードを表示します (ルートディレクトリで実行すると、すべてのレコードに一致します)。
3. ボルト内のタイプ指定されていないすべてのレコードをログインタイプに変換します (ルートディレクトリで実行した場合)
4. 名前に「sql」を含むタイプ指定されていないレコードをデータベースクレデンシャルに変換します。
5. ssh-<任意の文字>で終わるすべてのレコードをsshKeyタイプのレコードに変換します。
   1. 例: 「Github ssh-1」というタイトルのレコードと「Github ssh-2」というタイトルのレコードを変換します。

***

#### convert-allコマンド <a href="#convert-all-command" id="convert-all-command"></a>

**バージョン:** `v17.x以降`

**コマンド:** `convert-all` (エイリアス: `ca`)

**詳細:** ボルト内のすべての従来型 (一般タイプまたはタイプ指定なし) のレコードを、タイプ指定のあるレコードに変換します。データセンターの移行などで、移行を進める前にすべてのGeneralレコードを変換する必要がある場合に、一括変換用としてご利用いただけます。

{% hint style="info" %}
`convert-all` コマンドは、ボルト全体をスキャンしてタイプ指定のない従来のレコードをすべて変換します。

パターンを指定して特定のレコードのみを変換する場合は、`convert` コマンドをご利用ください。

すでにタイプ指定のあるレコードのタイプを変更するには、[`edit`](/keeperpam/jp/commander-cli/command-reference.md#edit-command-record-types) コマンドをご利用ください。
{% endhint %}

**スイッチ:**

`-t`、`--record-type <RECORD TYPE OR ID>` レコードの変換先のタイプ。指定しない場合は `login` がデフォルトとなります。

`-f`、`--force` 確認プロンプトをスキップします。非対話モードまたはバッチモードで実行する場合は必須です。

`-ia`、`--include-attachments` ファイル添付があるレコードも対象に含めます。デフォルトでは、添付があるレコードはスキップされます。注意: 変換後、Keeperクライアントでファイル添付を復号化できなくなる場合があります。

`-io`、`--ignore-ownership` 現在のアカウントが所有していないレコードも対象に含めます。デフォルトでは、自身が所有するレコードのみが変換されます。

`-n`、`--dry-run` 変換は行わず、変換対象となるレコードを表示します。

**例:**

```
convert-all
convert-all --dry-run
convert-all -t login -f
convert-all -f -ia -io
ca -n
```

1. 添付ファイルのない自身が所有するすべてのGeneralレコードをログインタイプに変換します。確認プロンプトが表示されます。
2. 変更を加えずに、変換対象となるすべてのレコードをプレビューします。
3. 確認プロンプトを表示せずに、自身が所有するすべてのGeneralレコードをログインタイプに変換します。
4. 確認プロンプトを表示せずに、ボルト内のすべてのGeneralレコードをデフォルトのログインタイプに変換します (添付ファイルのあるレコードや、現在のユーザーが所有していないレコードも対象に含まれます)。
5. ドライランプレビュー用の短縮エイリアス。

**事前チェックの概要:** 変換を開始する前に、以下を含む対象レコードの概要が表示されます。

* 変換対象となるGeneralタイプのレコード総数
* 添付ファイルがあるレコード数 (`-ia` を指定しない場合はスキップされます)
* 現在のユーザーが所有していないレコード数 (`-io` を指定しない場合はスキップされます)

このコマンドはレコードを自動的にバッチ処理し、変換中はプログレスバーを表示します。

```
[#####################---------] 1998/3000 (1.8s avg)
```

**完了時の概要:** 完了後、以下のような概要が表示されます。

```
Conversion complete.
Converted: 2099
Total: 2099
Time: 38.4s
Average: 0.02s per record
```


---

# 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://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/record-commands/record-type-commands.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.
