From 2dd3440a9761f06919b71dd2214064ad6d129bfc Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sun, 17 Apr 2022 20:06:00 +0200 Subject: [PATCH] Added 1password-cli to the knowledge base --- knowledge base/1password-cli.md | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 knowledge base/1password-cli.md diff --git a/knowledge base/1password-cli.md b/knowledge base/1password-cli.md new file mode 100644 index 0000000..3837226 --- /dev/null +++ b/knowledge base/1password-cli.md @@ -0,0 +1,38 @@ +# 1password-cli + +## TL;DR + +```shell +# installation +brew cask install 1password-cli + +# first login +op signin company.1password.com user.name@company.com +# subsequent logins +op signin company + +# automatically set environment variables +# needed to run the export command manually +eval $(op signin company) + +# show all the items in the account +op list items +``` + +## Gotchas + +- After you have signed in the first time, you can sign in again using your account shorthand, which is your sign-in address subdomain (in this example, _company_); `op signin` will prompt you for your password and output a command that can save your session token to an environment variable: + + ```shell + op signin company + ``` + +- Session tokens expire after 30 minutes of inactivity, after which you'll need to sign in again + +## Further readings + +- [CLI getting started] guide +- [CLI guide] + +[cli getting started]: https://support.1password.com/command-line-getting-started/ +[cli guide]: https://support.1password.com/command-line/