# 1Passwordアカウントに手動でサインインする

### 1Passwordアカウントに手動でサインインする <a href="#gzzgx9488uft" id="gzzgx9488uft"></a>

[1Password CLIに1Passwordアプリを使ってサインインしたく](https://developer.1password.com/docs/cli/get-started/#step-2-turn-on-the-1password-desktop-app-integration)ない場合は、ターミナルでアカウントを手動で追加してサインインすることができます。

🔥既知のセキュリティーリスク

1Password CLIに手動でサインインすると、一部のプラットフォームでは、現在のユーザーで実行されている全プロセスが1Passwordアカウントにアクセスできる可能性があります。

当社はより強力なセキュリティーの保証を提供するため、1Password CLIへのサインインには 1Passwordアプリを使うことをお勧めします。

ターミナルで手動でサインインすると、1Password CLIはディスク上に暗号化されたセッションキーと、現在のシェルの環境で使用されるランダムラッパ キーをSaveします。

30分間操Createがないとセッションは期限切れになります。その後は再度サインインして新しいトークンをSaveする必要があります。

認証されたセッションを直ちに終了したい場合は、op signoutを実行します。

### 手動でサインインする <a href="#si91e9ifh2fr" id="si91e9ifh2fr"></a>

#### ステップ1：アカウントを追加する <a href="#o7ecou5cbn2h" id="o7ecou5cbn2h"></a>

1Passwordアカウントを1Password CLIに手動で追加するには、[op account add](https://developer.1password.com/docs/cli/reference/management-commands/account/)を次のように使います：

$ op account add

1Password CLIでは、[サインインアドレス](https://support.1password.com/sign-in-troubleshooting#if-youre-asked-for-a-sign-in-address)、メールアドレス、[Secret Key](https://support.1password.com/secret-key/)、1Passwordアカウントのパスワードを入力するよう求められます。

対話型シェルを使っていない場合は、[フラグを使ってアカウントの詳細を指定](https://developer.1password.com/docs/cli/reference/management-commands/account/#account-add)できます。\
例:

$ op account add --address agilebits.1password.com --email <wendy.appleseed@agilebits.com> --secret-key A3-...

アカウントを追加した直後にサインインするには、--signinフラグを含めます。

**アカウントの短縮形をセットする**

1Password CLIは、追加した各アカウントを参照するためにアカウントの短縮形（ショートハンド）を使います。デフォルトの短縮形は、[サインインアドレスのサブドメイン](https://support.1password.com/sign-in-troubleshooting#if-youre-asked-for-a-sign-in-address)です（例えば、myの場合my.1password.comとなります）。

カスタムの短縮形を設定するには、アカウントを追加するときに--shorthandフラグを含めます。例えば短縮形personalと共にアカウントを追加するには、次のようにします

$ op account add --shorthand personal

#### ステップ2：サインイン <a href="#nr94y28xqu4p" id="nr94y28xqu4p"></a>

1Password CLIにアカウントを手動で追加した場合は、[手動でサインインコマンド](https://developer.1password.com/docs/cli/reference/commands/signin#signing-in-to-an-account/)を使ってサインインする必要があります。

このコマンドは[アプリ統合](https://developer.1password.com/docs/cli/app-integration)がオンになっている場合でも機能するため、スクリプトで使うことができ、サインイン方法に関係なく全ユーザーに互換性を提供できます。

例：

**Bash、Zsh、sh、fish**

$ eval $(op signin)

**PowerShell**

PS C:\ >Invoke-Expression $(op signin)

サインインすると、1Password CLIはセッション トークンをCreateし、環境変数OP\_SESSIONを設定します。手動でエクスポートできるトークンを取得するには、--rawフラグを含めます。

セッショントークンは30分間操Createがないと期限切れになります。その後は再度サインインして新しいトークンをSaveする必要があります。

サインアウトするには、[op signout](https://developer.1password.com/docs/cli/reference/commands/signout/)コマンドを使います。

#### オプション：--accountフラグを使ってアカウントを切り替える <a href="#aebphal7dddf" id="aebphal7dddf"></a>

複数のアカウントを追加し、対話型ターミナルを使っている場合、1Password CLIはサインインするアカウントを選択するように要求します。矢印キーを使ってアカウントを選択し、リターンキーを押してサインインします。

サインイン時にアカウントを選択するプロンプトをバイパスしたい場合は、[アカウントの短縮形、サインイン アドレス、または ID](https://developer.1password.com/docs/cli/sign-in-manually/#appendix-find-an-account-shorthand-or-id)を--accountにフラグを含めます。

例：

**Bash、Zsh、sh、fish**

$ eval $(op signin --account personal)

**PowerShell**

PS C:\ > Invoke-Expression $(op signin --account personal)

常に同じアカウントにサインインするには、環境変数OP\_ACCOUNTを[アカウントの短縮形かサインインアドレスかID](https://developer.1password.com/docs/cli/sign-in-manually/#appendix-find-an-account-shorthand-or-id)に設定します。\
例：

**Bash、Zsh、sh**

$ export OP\_ACCOUNT=my.1password.com

**fish**

$ set -x OP\_ACCOUNT my.1password.com

**PowerShell**

PS C : \ > $Env:OP\_ACCOUNT = "my.1password.com"

複数のアカウントに同時にサインインし、--accountフラグを使って各コマンドを実行するアカウントを指定できます。アカウントを指定しない場合、1Password CLIはデフォルトで最後にサインインしたアカウントを使用します。

例えば短縮形personalとagilebitsを使ってアカウントにサインインするには、次のようになります。

例：

**Bash、Zsh、sh、fish**

$ eval $(op signin --account personal) && eval $(op signin --account agilebits)

**PowerShell**

PS C : \ >Invoke-Expression $(op signin --account personal); Invoke-Expression $(op signin --account agilebits)

短縮形のpersonalと共にop vault listコマンドを実行するには、次のように入力します。

$ op vault list --account personal\
次に、agilebitsアカウントで同じコマンドを実行します。

$ op vault list --account agilebits

アカウントを追加するときに、[カスタムのショートカットを指定する](https://developer.1password.com/docs/cli/sign-in-manually/#set-a-custom-account-shorthand)こともできます。

### [**トラブルシューティング**](https://developer.1password.com/docs/cli/sign-in-manually/#troubleshooting) <a href="#g84wqx3d627c" id="g84wqx3d627c"></a>

[1Password アプリの統合](https://developer.1password.com/docs/cli/get-started/#step-2-turn-on-the-1password-desktop-app-integration)を既にオンにしている場合は、コマンドラインでアカウントを追加する前に、これをオフにする必要があります。

### **さらに詳しく知るには** <a href="#id-2121wwtwf2q0" id="id-2121wwtwf2q0"></a>

* [1Password CLIを1Passwordデスクトップアプリと統合する](https://developer.1password.com/docs/cli/app-integration/)
* [1Passwordデスクトップアプリ統合のセキュリティーについて](https://developer.1password.com/docs/cli/app-integration-security/)

### 付録：アカウントの短縮形またはIDを見つける <a href="#id-8v2uiqyu4l8" id="id-8v2uiqyu4l8"></a>

1Password CLIは、追加した各アカウントを参照するためにアカウントの省略形を使用します。追加した全アカウント、その省略形、およびアカウントの詳細を表示するには、op account listを実行します。\
実行例：

$ op account list

結果の例：\
SHORTHAND URL EMAIL USER UUID

my <https://my.1password.com> <wendy.c.appleseed@gmail.com> A10S...

agilebits <https://agilebits-inc.1password.com> <wendy_appleseed@agilebits.com> ONJ9…

コマンド内の特定のアカウントを参照するには、短縮形、サインイン アドレス、またはユーザーIDを使用できます。


---

# 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://manual.dxable.com/1password/sign-in-to-your-1password-account-manually.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.
