Get started with 1Password CLI
1Password CLI brings 1Password to your terminal. Learn how to install the CLI, then integrate it with your 1Password app and sign in with Touch ID, Windows Hello, or another system authentication option.
Step 1: Install 1Password CLI
Requirements
- Mac
- Windows
- Linux
- 1Password subscription
- 1Password for Mac*
- macOS Big Sur 11.0.0 or later
Supported shells: Bash, Zsh, sh, fish
*Required to integrate 1Password CLI with the 1Password app.Supported shells: PowerShell
- 1Password subscription
- 1Password for Linux*
- PolKit*
- A PolKit authentication agent running*
Supported shells: Bash, Zsh, sh, fish
*Required to integrate 1Password CLI with the 1Password app.- Mac
- Windows
- Linux
- homebrew
- Manual
-
To install 1Password CLI with homebrew:
-
Check that 1Password CLI installed successfully:
To manually install 1Password CLI on macOS:
-
Download the latest release of 1Password CLI.
Learn how to verify its authenticity. -
- Package file: Open
op.pkg
and install 1Password CLI in the default location (usr/local/bin
). - ZIP file: Double-click
op.zip
to unzip the file, then moveop
tousr/local/bin
.
- Package file: Open
-
Check that 1Password CLI was installed successfully:
- winget
- Manual
-
To install 1Password CLI with winget:
-
Check that 1Password CLI installed successfully:
To manually install 1Password CLI on Windows:
-
Download the latest release of 1Password CLI and extract
op.exe
.
Learn how to verify its authenticity. -
Open PowerShell as an administrator.
-
Create a folder to move
op.exe
into. For example,C:\Program Files\1Password CLI
. -
Move the
op.exe
file to the new folder. -
Add the folder containing the
op.exe
file to your PATH.Windows 10 and later
- Search for Advanced System Settings in the Start menu.
- Select Environment Variables.
- In the System Variables section, select the PATH environment variable and click Edit.
- In the prompt, click New and add the directory where
op.exe
is located. - Sign out and back in to Windows for the change to take effect.
-
Check that 1Password CLI installed successfully:
If you'd rather install 1Password CLI with a single block of commands, run the following in PowerShell as administrator:
If your Windows operating system uses a language other than English, you'll need to manually set $arch
in the first line. To do this, replace $arch = (Get-CimInstance Win32_OperatingSystem).OSArchitecture
with $arch = "64-bit"
or $arch = "32-bit"
.
- APT
- YUM
- Alpine
- NixOS
- Manual
To install 1Password CLI using APT on Debian- and Ubuntu-based distributions:
-
Run the following command:
See a step-by-step version of the script
-
Add the key for the 1Password
apt
repository: -
Add the 1Password
apt
repository: -
Add the debsig-verify policy:
-
Install 1Password CLI:
-
-
Check that 1Password CLI installed successfully:
Alternatively, download the latest 1Password CLI .deb
package directly from one of the following links:
To install 1Password CLI using YUM on RPM-based distributions:
-
Run the following commands:
The above script is comprised of the following steps
-
Import the public key:
-
Configure the repository information:
-
Install 1Password CLI:
-
-
Check that 1Password CLI installed successfully:
Alternatively, download the latest 1Password CLI .rpm
package directly from one of the following links:
To install 1Password CLI on Alpine x86_64 distributions:
-
Run the following commands:
The above script is comprised of the following steps
-
Add Password CLI to your list of repositories:
-
Add the public key to validate the APK to your keys directory:
-
Install 1Password CLI:
-
-
Check that 1Password CLI installed successfully:
The Nix package is available from the NixOS open source community.
To install 1Password CLI on your NixOS system:
-
Add 1Password to your
/etc/nixos/configuration.nix
file, orflake.nix
if you're using a flake. For example, the following snippet includes 1Password CLI and the 1Password app: -
After you make changes to your configuration file, apply them:
-
If you added 1Password to
/etc.nixos/configuration.nix
, run: -
If you added 1Password to
flake.nix
, replace<flake-directory-path>
with the directory your flake is in and<output-name>
with the name of the flake output containing your system configuration, then run the command.
-
-
Check that 1Password CLI installed successfully:
Learn more about using 1Password on NixOS.
To install 1Password CLI on Linux without a package manager:
Or follow the extended guide
-
Download the latest release of 1Password CLI and extract it. To verify its authenticity:
-
Move
op
to/usr/local/bin
, or another directory in your$PATH
. -
Check that 1Password CLI installed successfully:
-
Create the
onepassword-cli
group if it doesn't yet exist: -
Set the correct permissions on the
op
binary:
Step 2: Turn on the 1Password desktop app integration
- Mac
- Windows
- Linux
- Open and unlock the 1Password app.
- Click your account or collection at the top of the sidebar.
- Navigate to Settings > Developer.
- Select Integrate with 1Password CLI.
- If you want to authenticate 1Password CLI with your fingerprint, turn on Touch ID in the app.
- Open and unlock the 1Password app.
- Click your account or collection at the top of the sidebar.
- Turn on Windows Hello in the app.
- Navigate to Settings > Developer.
- Select Integrate with 1Password CLI.
- Open and unlock the 1Password app.
- Click your account or collection at the top of the sidebar.
- Navigate to Settings > Security.
- Turn on Unlock using system authentication.
- Navigate to Settings > Developer.
- Select Integrate with 1Password CLI.
Learn more about the 1Password desktop app integration.
Step 3: Enter any command to sign in
After you've turned on the app integration, enter any command and you'll be prompted to authenticate.
Run this command to see all the vaults in your account:
If you use multiple accounts, enter op signin
to switch between accounts. You can also specify an account to sign in to with the --account
flag or by setting the OP_ACCOUNT
environment variable.
Next steps
- Get started with basic 1Password CLI commands.
- Set up 1Password Shell Plugins to handle authentication for your other command-line tools.
- Learn how to securely load secrets from your 1Password account without putting any plaintext secrets in code.