Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
New! Use the 1Password Credential Broker to give CI/CD and other machine workflows short-lived access to secrets, without managing service account tokens.
CLI
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.
is maintained by both Homebrew and 1Password developers in the open-source Homebrew Cask repository. 1Password CLI downloads from our CDN on agilebits.net/.com domains. To install 1Password CLI on your NixOS system:
Learn more about the 1Password desktop app integration.
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:
New to 1Password developer tools?
Follow the developer quickstart to set up the CLI, secure your secrets, and add biometric SSH signing in one guide.
Step 1: Install 1Password CLI
Requirements
Requirements
- Mac
- Windows
- Linux
- 1Password subscription
- 1Password for Mac*
- macOS Big Sur 11.0.0 or later
Supported shells: PowerShell
- 1Password subscription
- 1Password for Linux*
- PolKit*
- A PolKit authentication agent running*
- Mac
- Windows
- Linux
- homebrew
- Manual
-
To install 1Password CLI with homebrew:
brew install 1password-cli -
Check that 1Password CLI installed successfully:
op --version
To manually install 1Password CLI on macOS:
-
Download the latest release of 1Password CLI.
Learn how to verify its authenticity. -
- Package file: Open
op.pkgand install 1Password CLI in the default location (usr/local/bin). - ZIP file: Open
op.zipand unzip the file, then moveoptousr/local/bin.
- Package file: Open
-
Check that 1Password CLI was installed successfully:
op --version
- winget
- Manual
-
To install 1Password CLI with winget:
winget install 1password-cli -
Check that 1Password CLI installed successfully:
op --version
To manually install 1Password CLI on Windows:If your Windows operating system uses a language other than English, you’ll need to manually set
-
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.exeinto. For example,C:\Program Files\1Password CLI.mkdir "C:\Program Files\1Password CLI" -
Move the
op.exefile to the new folder.mv ".\op.exe" "C:\Program Files\1Password CLI" -
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 select Edit.
- In the prompt, select New and add the directory where
op.exeis located. - Sign out and back in to Windows for the change to take effect.
-
Check that 1Password CLI installed successfully:
op --version
$arch = (Get-CimInstance Win32_OperatingSystem).OSArchitecture
switch ($arch) {
'64-bit' { $opArch = 'amd64'; break }
'32-bit' { $opArch = '386'; break }
Default { Write-Error "Sorry, your operating system architecture '$arch' is unsupported" -ErrorAction Stop }
}
$installDir = Join-Path -Path $env:ProgramFiles -ChildPath '1Password CLI'
Invoke-WebRequest -Uri "https://cache.agilebits.com/dist/1P/op2/pkg/v2.41.0/op_windows_$($opArch)_v2.41.0.zip" -OutFile op.zip
Expand-Archive -Path op.zip -DestinationPath $installDir -Force
$envMachinePath = [System.Environment]::GetEnvironmentVariable('PATH','machine')
if ($envMachinePath -split ';' -notcontains $installDir){
[Environment]::SetEnvironmentVariable('PATH', "$envMachinePath;$installDir", 'Machine')
}
Remove-Item -Path op.zip
$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:
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | \ sudo tee /etc/apt/sources.list.d/1password.list && \ sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/ && \ curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \ sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol && \ sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22 && \ curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg && \ sudo apt update && sudo apt install 1password-cliSee a step-by-step version of the script
-
Add the key for the 1Password
aptrepository:curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg -
Add the 1Password
aptrepository:echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | sudo tee /etc/apt/sources.list.d/1password.list -
Add the debsig-verify policy:
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/ curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \ sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol && \ sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22 && \ curl -sS https://downloads.1password.com/linux/keys/1password.asc | \ sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg -
Install 1Password CLI:
sudo apt update && sudo apt install 1password-cli
-
Add the key for the 1Password
-
Check that 1Password CLI installed successfully:
op --version
.deb package directly from one of the following links:To install 1Password CLI using YUM on RPM-based distributions:
-
Run the following commands:
sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc sudo sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"https://downloads.1password.com/linux/keys/1password.asc\"" > /etc/yum.repos.d/1password.repo' sudo dnf check-update -y 1password-cli && sudo dnf install 1password-cliThe above script is comprised of the following steps
-
Import the public key:
sudo rpm --import https://downloads.1password.com/linux/keys/1password.asc -
Configure the repository information:
sudo sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"https://downloads.1password.com/linux/keys/1password.asc\"" > /etc/yum.repos.d/1password.repo' -
Install 1Password CLI:
sudo dnf check-update -y 1password-cli && sudo dnf install 1password-cli
-
Import the public key:
-
Check that 1Password CLI installed successfully:
op --version
.rpm package directly from one of the following links:To install 1Password CLI on Alpine x86_64 distributions:
-
Run the following commands:
echo https://downloads.1password.com/linux/alpinelinux/stable/ >> /etc/apk/repositories wget https://downloads.1password.com/linux/keys/alpinelinux/support@1password.com-61ddfc31.rsa.pub -P /etc/apk/keys apk update && apk add 1password-cliThe above script is comprised of the following steps
-
Add Password CLI to your list of repositories:
echo https://downloads.1password.com/linux/alpinelinux/stable/ >> /etc/apk/repositories -
Add the public key to validate the APK to your keys directory:
wget https://downloads.1password.com/linux/keys/alpinelinux/support@1password.com-61ddfc31.rsa.pub -P /etc/apk/keys -
Install 1Password CLI:
apk update && apk add 1password-cli
-
Add Password CLI to your list of repositories:
-
Check that 1Password CLI installed successfully:
op --version
The Nix package is available from the NixOS open source community.
-
Add 1Password to your
/etc/nixos/configuration.nixfile, orflake.nixif you’re using a flake. For example, the following snippet includes 1Password CLI and the 1Password app:# NixOS has built-in modules to enable 1Password # along with some pre-packaged configuration to make # it work nicely. You can search what options exist # in NixOS at https://search.nixos.org/options # Enables the 1Password CLI programs._1password = { enable = true; }; # Enables the 1Password desktop app programs._1password-gui = { enable = true; # this makes system auth etc. work properly polkitPolicyOwners = [ "<your-linux-username>" ]; }; -
After you make changes to your configuration file, apply them:
-
If you added 1Password to
/etc.nixos/configuration.nix, run:sudo nixos-rebuild switch -
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.sudo nixos-rebuild switch --flake <flake-directory-path>.#<output-name>
-
If you added 1Password to
-
Check that 1Password CLI installed successfully:
op --version
To install 1Password CLI on Linux without a package manager:
ARCH="<choose between 386/amd64/arm/arm64>" && \
wget "https://cache.agilebits.com/dist/1P/op2/pkg/v2.41.0/op_linux_${ARCH}_v2.41.0.zip" -O op.zip && \
unzip -d op op.zip && \
sudo mv op/op /usr/local/bin/ && \
rm -r op.zip op && \
sudo groupadd -f onepassword-cli && \
sudo chgrp onepassword-cli /usr/local/bin/op && \
sudo chmod g+s /usr/local/bin/op
Or follow the extended guide
Or follow the extended guide
-
Download the latest release of 1Password CLI and extract it. To verify its authenticity:
gpg --keyserver keyserver.ubuntu.com --receive-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22 gpg --verify op.sig op -
Move
opto/usr/local/bin, or another directory in your$PATH. -
Check that 1Password CLI installed successfully:
op --version -
Create the
onepassword-cligroup if it doesn’t yet exist:sudo groupadd onepassword-cli -
Set the correct permissions on the
opbinary:sudo chgrp onepassword-cli /usr/local/bin/op && \ sudo chmod g+s /usr/local/bin/op
Step 2: Turn on the 1Password desktop app integration
- Mac
- Windows
- Linux
- Open and unlock the 1Password app.
- Select 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.
- Select 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.
- Select 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.
You can also authenticate 1Password CLI using a service account token scoped to specific vaults or Environments. We recommend using service accounts for shared building, automated access, and headless server authentication.
Step 3: Enter any command to sign in
op vault list
If you have multiple accounts
If you’ve added multiple 1Password accounts to your desktop app, you can useop 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.
Learn more about using multiple accounts with 1Password CLI.
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.
Learn more
Was this page helpful?
