> For the complete documentation index, see [llms.txt](https://manual.dxable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.dxable.com/1password/create-items.md).

# アイテムを作成する

1Passwordアカウントに新しいアイテムをCreateし、それに情報を割り当てるには、op item create コマンドを使用します。

フラグを使ってアイテムに関する基本情報を指定し、代入ステートメントを使って組み込みフィールドとカスタム フィールドを割り当てることができます。機密値を割り当てるには、JSON テンプレートを使用します。

### 必要条件 <a href="#h3pqm5lo2k3" id="h3pqm5lo2k3"></a>

1Password CLI を使ってアイテムをCreateするには、次の手順を実行する必要があります。

* 1Passwordにサインアップ
* 1Password CLIをインストールする

フォローしてください

このガイドの例に従う場合は、アカウントにサインインして、サンプル アイテムをSaveする Tutorial という名前の新しい Vault をCreateします。

op vault create チュートリアル

### アイテムをCreateする​ <a href="#j8p4itgxf8pp" id="j8p4itgxf8pp"></a>

新しいアイテムをCreateするには、op item createコマンドを使い、フラグを使ってアイテムの基本情報を指定します。

例えばTutorial vaultにNetflixという名前のLoginアイテムをCreateするには、次の手順を実行します。\
Bash, Zsh, sh, fishの場合

$ op item create \\

\--category login \\

\--title "Netflix" \\

\--vault Tutorial \\

\--url '<https://www.netflix.com/login>' \\

\--generate-password='letters,digits,symbols,32' \\

\--tags tutorial,entertainment

\
PowerShellの場合

PS C:¥> $ op item create \`

\--category login \`

\--title "Netflix" \`

\--vault Tutorial \`

\--url '<https://www.netflix.com/login>' \`

\--generate-password='letters,digits,symbols,32' \`

\--tags tutorial,entertainment

上記の各フラグの機能は次のとおりです。

\--category アイテムのカテゴリー（この場合はLoginアイテム）を設定します。使用可能なカテゴリーのリストを取得するには、op item template list を使います。カテゴリーの値は大文字と小文字を区別せず、空白文字を無視します。例えばSocial Security Numberカテゴリーは socialsecuritynumber として指定することもできます。

\--title 簡単に識別できるようにアイテムに名前を付けます。指定しない場合は、 1Password CLIデフォルトの名前が選択されます。例えば、Untitled Login item などです。

\--vault アイテムをCreateするvaultを指定します。指定しない場合、アイテムは組み込みの個人用、プライベート用、または従業員用のvaultにCreateされます。このvaultの名前は、アカウントの種類によって異なります。

-url アイテムにウェブサイトフィールドを追加します。

\--generate-password LoginおよびPasswordカテゴリーのアイテムの、強力なパスワードを生Createします。例に示すように、パスワードレシピを指定できます。指定しない場合は、デフォルトのレシピを使って、文字、数字、記号で構成される32文字のパスワードが生Createされます。

\--tags カンマ区切りのリストを使ってアイテムにタグを追加します。<br>

### カスタマイズしたアイテムをCreateする <a href="#f4vsjay088lx" id="f4vsjay088lx"></a>

各アイテム カテゴリーには、アイテムの詳細情報をSaveするために使用できる独自の組み込みフィールド セットがあります。また、カスタム フィールドをCreateして、アイテムに関する追加の詳細をSaveすることもできます。

組み込みフィールドとカスタム フィールドの詳細については[こちらで](https://developer.1password.com/docs/cli/item-fields/)説明します。

組み込みフィールドとカスタム フィールドをアイテムに割り当てるには、次の 2 つの方法があります。

* 代入文を使う場合
* アイテムJSONテンプレートを使う場合

#### 代入文を使う場合 <a href="#id-1jnsbyrr388c" id="id-1jnsbyrr388c"></a>

危険性

コマンド引数は、あなたのマシン上の他のプロセスに表示される可能性があります。機密な値を割り当てる場合は、代わりにアイテムJSONテンプレートを使ってください。

op item createコマンドは、代入文のリストを引数として受け取り、アイテムにフィールドをCreateできます。

代入文は次のようにフォーマットされます。

$ \[①\<section>.]②\<field>\[\[③\<fieldType>]]=④\<value>

①section （オプション）フィールドをCreateするセクションの名前。

②field Createするフィールドの名前。

③fieldType Createするフィールドのタイプ。指定しない場合、fieldType はデフォルトでpasswordになります。

④value フィールドにSaveする情報。

組み込みフィールドの場合、②fieldはアイテムカテゴリーテンプレートの組み込みフィールドIDと一致する必要があります。fieldTypeを指定する必要はありません。

カスタムフィールドの場合、③fieldTypeはCreateするカスタムフィールドタイプと一致する必要があります。この場合は②fieldは任意の名前にすることができます。

sectionまたはfieldにピリオド、等号、またはバックスラッシュを使う必要がある場合は、バックスラッシュ文字を使ってエスケープします。しかし④valueをエスケープするためにバックスラッシュを使わないでください。

以下は、Login項目の組み込みフィールドである②usernameを<john.doe@acme.org>に設定する代入文の例です。

$ 'username=<john.doe@acme.org>'

次に、①Subscription Infoというセクション内にある②Renewwal Dateというフィールドで、④2022-12-31に設定されている③dateというカスタムフィールドタイプがある場合の代入文の例を示します。

$ 'Subscription Info.Renewal Date\[date]=2022-12-31'

上記の両方の代入文をTutorial Vault内の新しいアイテムHBO Maxに追加するには、次の手順を実行します。

Bash、 Zsh、sh、 fishの場合

$ op item create \\

\--category login \\

\--title "HBO Max" \\

\--vault Tutorial \\

\--url '<https://www.hbomax.com>' \\

\--generate-password='letters,digits,symbols,32' \\

\--tags tutorial,entertainment \\

'username=<john.doe@acme.org>' \\

'Subscription Info.Renewal Date\[date]=2022-12-31'

PowerShellの場合

PS C:¥> op item create \`

\--category login \`

\--title "HBO Max" \`

\--vault Tutorial \`

\--url '<https://www.hbomax.com>' \`

\--generate-password='letters,digits,symbols,32' \`

\--tags tutorial,entertainment \`

'username=<john.doe@acme.org>' \`

'Subscription Info.Renewal Date\[date]=2022-12-31'

#### アイテムJSONテンプレートを使う場合 <a href="#po18oo9ytnkp" id="po18oo9ytnkp"></a>

機密値を割り当てるには、CreateするアイテムのカテゴリーのアイテムJSONテンプレートを入力します。フィールド代入文をテンプレートと組み合わせると、代入文によってテンプレートの値が上書きされます。

利用可能なテンプレートのリストを表示するには、op item template listを実行します。カテゴリーのテンプレートを取得するには、op item template get \<category> を実行します。

例えば、テンプレートを使って新しいLogin項目をCreateするには、次のようにします。

①Loginアイテムのテンプレートを取得し、現在のディレクトリーにSaveします。\
$ op item template get --out-file=login.json "Login"

②テンプレートファイルを編集して情報を追加します。

③--template フラグを使ってテンプレートファイルへのパスを指定し、アイテムをCreateします。

$ op item create --template=login.json

このサンプルテンプレートファイルは、IDで指定されたVaultにHuluという名前のLoginアイテムをCreateします。組み込みのユーザー名、パスワード、notesPlainフィールドの値を指定します。また、カスタム日付フィールドも追加します。

Loginテンプレートの例\
login.json

{

"title": "Hulu",

"vault": {

"id": "sor33rgjjcg2xykftymcmqm5am"

},

"category": "LOGIN",

"fields": \[

{

"id": "username",

"type": "STRING",

"purpose": "USERNAME",

"label": "username",

"value": "<wendy.appleseed@gmail.com>"

},

{

"id": "password",

"type": "CONCEALED",

"purpose": "PASSWORD",

"label": "password",

"password\_details": {

"strength": ""

},

"value": "Dp2WxXfwN7VFJojENfEHLEBJmAGAxup@"

},

{

"id": "notesPlain",

"type": "STRING",

"purpose": "NOTES",

"label": "notesPlain",

"value": "This is Wendy's Hulu account."

},

{

"id": "date",

"type": "date",

"label": "Subscription renewal date",

"value": "2023-04-05"

}

]

}

④編集したテンプレート ファイルをコンピューターから削除します。

テンプレートを使って標準入力からアイテムをCreateすることもできます。

$ op item template get Login | op item create --vault Tutorial -

### 保存済みのアイテムからアイテムをCreateする <a href="#id-90reya40daww" id="id-90reya40daww"></a>

標準入力からアイテムJSONをパイプすることで、保存済みのアイテムから新しいアイテムをCreateできます。

例えば、代入文セクションでCreateしたHBO Maxアイテムを基に、新しいタイトル、ユーザー名、パスワードを使って新しいアイテムをCreateするには、次のようにします。

$ op item get "HBO Max" --format json | op item create --vault Tutorial --title "Wendy's HBO Max" - 'username=<wendy.appleseed@acme.org>' 'password=Dp2WxXfwN7VFJojENfEHLEBJmAGAxup@'

### アイテムにワンタイムパスワードを追加する <a href="#id-67cql7ee69o" id="id-67cql7ee69o"></a>

カスタム フィールド代入文を使って、アイテムにワンタイム パスワードを添付できます。fieldTypeはotpで、値はワンタイムパスワードのotpauth:// URIである必要があります。

Bash, Zsh, sh, fishの場合

$ op item create \\

\--category login \\

\--title='My OTP Example' \\

\--vault Tutorial \\

\--url '<https://www.acme.com/login>' \\

\--generate-password='letters,digits,symbols,32' \\

\--tags tutorial,entertainment \\

'Test Section 1.Test Field3\[otp]=otpauth://totp/\<website>:\<user>?secret=\<secret>\&issuer=\<issuer>'

\
PowerShellの場合

PS C:¥> op item create \`

\--category login \`

\--title='My OTP Example' \`

\--vault Tutorial \`

\--url '<https://www.acme.com/login>' \`

\--generate-password='letters,digits,symbols,32' \`

\--tags tutorial,entertainment \`

'Test Section 1.Test Field3\[otp]=otpauth://totp/\<website>:\<user>?secret=\<secret>\&issuer=\<issuer>'

### アイテムにファイルを添付する <a href="#xean7xi8lqsd" id="xean7xi8lqsd"></a>

カスタムフィールド代入文を使って、アイテムにファイルを添付できます。フィールドは1Passwordでファイルに付けられる名前、フィールド タイプはファイル、値はファイルへのパスである必要があります。

$ myFileName\[file]=/path/to/your/file

上記の例のファイルの名前は myFileName になります。元のファイル名を保持するには、フィールドを省略できます。

$ \[file]=/path/to/your/file

以下は、JanuaryReceiptという名前のファイル /wendyappleseed/documents/receipt.png が添付されたPlayStation Storeログインの例を示したものです。\
Bash, Zsh, sh, fishの場合

$ op item create \\

\--category login \\

\--title "PlayStation Store" \\

\--vault Tutorial \\

\--url '<https://store.playstation.com/>' \\

\--generate-password='letters,digits,symbols,32' \\

\--tags tutorial,entertainment \\

'JanuaryReceipt\[file]=/wendyappleseed/documents/receipt.png'

PowerShellの場合

PS C:¥> op item create \`

\--category login \`

\--title "PlayStation Store" \`

\--vault Tutorial \`

\--url '<https://store.playstation.com/>' \`

\--generate-password='letters,digits,symbols,32' \`

\--tags tutorial,entertainment \`

'JanuaryReceipt\[file]=/wendyappleseed/documents/receipt.png'

### 次のステップ​ <a href="#c043o2tri545" id="c043o2tri545"></a>

アイテム管理について引き続き学習する場合は、Createしたサンプルアイテムを保持し、[アイテム編集](http://item-edit/)のチュートリアルに進んでください。

Tutorial vaultをCreateしたが、それを残したくない場合は、次のコマンドを実行して、vaultとCreateしたサンプル アイテムを削除できます。

op vault delete "Tutorial"<br>

さらに詳しく

* [op item create reference documentation](https://developer.1password.com/docs/cli/reference/management-commands/item#item-create)
* [Built-in and custom item fields](https://developer.1password.com/docs/cli/item-fields)
* [Item JSON template](https://developer.1password.com/docs/cli/item-template-json)


---

# 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://manual.dxable.com/1password/create-items.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.
