Skip to main content

Use the 1Password desktop app to sign in to 1Password CLI

You can use the 1Password desktop app integration to quickly and securely sign in to 1Password CLI. The app integration allows you to:

  • Seamlessly sign to the 1Password accounts you've added to the app in your terminal.
  • Authenticate 1Password CLI the same way you unlock your device, like with your fingerprint, face, Apple Watch, Windows Hello PIN, or device user password.
  • Track recent 1Password CLI activity from your 1Password app.

Requirements

Set up the app integration

Step 1: Turn on the app integration

  1. Open and unlock the 1Password app.
  2. Select your account or collection at the top of the sidebar.
  3. Navigate to Settings > Developer.
  4. Select Integrate with 1Password CLI.
  5. If you want to authenticate 1Password CLI with your fingerprint, turn on Touch ID in the app.
The 1Password Developer settings pane with the Integrate with 1Password CLI option selected.The 1Password Developer settings pane with the Integrate with 1Password CLI option selected.

Step 2: Enter any command to sign in

After you've turned on the app integration, enter any command and you'll be prompted to authenticate. For example, run this command to see all the vaults in your account:

If you have multiple accounts

If you've added multiple 1Password accounts to your desktop app, you can use op signin to select an account to sign in to with 1Password CLI. Use the arrow keys to choose from the list of all accounts added to your 1Password app.

See result...

You can also select an account on a per-command basis using the --account flag with your account's sign-in address or ID.

If you're signed in to multiple accounts in the app but only want to use a specific account with 1Password CLI, you can set the OP_ACCOUNT environment variable to your account's sign-in address or ID.

Optional: Remove previously added account details

caution

Make sure you have access to your Secret Key and account password before removing account details from your configuration file.

If you previously added an account to 1Password CLI manually and now want to exclusively use the 1Password app to sign in, you can remove your account details from your configuration file.

Your configuration file is in one of the following locations:

  • ~/.op/config
  • ~/.config/op/config
  • ~/.config/.op/config

Use the account forget command to remove all existing account information from your configuration file. This won't impact the accounts added to your 1Password app.

Optional: Set the biometric unlock environment variable

You can use the OP_BIOMETRIC_UNLOCK_ENABLED environment variable to temporarily toggle the app integration on or off.

To turn on the integration:

To turn off the integration:

Track 1Password CLI activity

You can track 1Password CLI activity authenticated with the 1Password app, including the command, when it was run, the application where it was run, and the name of the account accessed.

To see your 1Password CLI activity log:

  1. Open and unlock the 1Password desktop app.
  2. Select your account or collection at the top of the sidebar and choose Settings > Developer.
  3. Turn on Show 1Password Developer in Sidebar.
  4. Close the settings window, then select Developer in the sidebar.
  5. Select View CLI.
The 1Password CLI activity log.The 1Password CLI activity log.

You'll see a table with your recent 1Password CLI activity.

Learn more about 1Password Developer.

Troubleshooting

If op signin doesn't list your account

op signin returns a list of all accounts you've added to the 1Password desktop app. To sign in to 1Password CLI with a new 1Password account, you'll need to add the account to the app.

If you see a connection error

If you see a connectionreset error, or an error that 1Password CLI couldn't connect to the 1Password desktop app, try the following:

Open System Settings > General > Login Items and make sure Allow in background is turned on for 1Password.


If you still see an error, try the following:

  1. Make sure you're using the latest version of the 1Password desktop app.
  2. Restart the app.

If you're using 1Password for Mac version 8.10.12 or earlier, the 1Password CLI binary must be located in the /usr/local/bin/ directory.

If you see a LostConnectionToApp error when you try to authenticate:

Make sure the option to keep 1Password in the menu bar is turned on:

  1. Open and unlock the 1Password desktop app.
  2. Select your account or collection at the top of the sidebar.
  3. Select Settings > General.
  4. Make sure "Keep 1Password in the menu bar" is selected.

If you aren't prompted to authenticate with your preferred method

If you've turned on the app integration, but aren't prompted to sign in to 1Password CLI with your expected authentication method:

Make sure you've set up Touch ID or an Apple Watch to unlock 1Password on your Mac.

Learn more

Was this page helpful?