From 0f143e71ed1f299c71bfee0c487cf387e0c4826b Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 24 Oct 2026 13:49:07 -0500 Subject: [PATCH] Add Create 1Password Login Item From The CLI as a Workflow TIL --- README.md | 3 +- ...reate-1password-login-item-from-the-cli.md | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 workflow/create-1password-login-item-from-the-cli.md diff --git a/README.md b/README.md index dfc48fe..b36c2e2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1890 TILs and counting..._ +_1891 TILs and counting..._ See some of the other learning resources I work on: @@ -2148,6 +2148,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Change Window Name In iTerm](workflow/change-window-name-in-iterm.md) - [Configure Email Redirect With Cloudflare](workflow/configure-email-redirect-with-cloudflare.md) - [Control Media With Drop Keyboard](workflow/control-media-with-drop-keyboard.md) +- [Create 1Password Login Item From The CLI](workflow/create-1password-login-item-from-the-cli.md) - [Convert An ePub Document To PDF On Mac](workflow/convert-an-epub-document-to-pdf-on-mac.md) - [Create A Local Sanity Dataset Backup](workflow/create-a-local-sanity-dataset-backup.md) - [Create A Public URL For A Local Server](workflow/create-a-public-url-for-a-local-server.md) diff --git a/workflow/create-1password-login-item-from-the-cli.md b/workflow/create-1password-login-item-from-the-cli.md new file mode 100644 index 0000000..953fdd3 --- /dev/null +++ b/workflow/create-1password-login-item-from-the-cli.md @@ -0,0 +1,38 @@ +# Create 1Password Login Item From The CLI + +The default shape of a login item in 1Password is _Username_ and _Password_. +Whenever I'm trying to save something in 1Password, like an AWS Access Key for +example, I find myself manually adjusting the fields to get it into the right +shape for that item. + +What I realized would be nicer is using [`op` (the 1Password +CLI)](https://www.1password.dev/cli) to create a login item with the shape I +want (which I can later reference in my shell history). Then I can pop open the +desktop app and update the latest entry with the actually secret values that I +copy from, in this case, the AWS Console. + +```bash +❯ op item create --vault "Personal" --category login --title "AWS - jbranchaud-lastword-cli" \ + 'Access Key ID[text]=TODO' \ + 'Secret Access Key[concealed]=TODO' \ + 'Default region[text]=us-east-1' +ID: abc123 +Title: AWS - jbranchaud-lastword-cli +Vault: Personal (efg456) +Created: now +Updated: now +Favorite: false +Version: 1 +Category: LOGIN +Fields: + Access Key ID: TODO + Secret Access Key: [use 'op item get abc123 --reveal' to reveal] + Default region: us-east-1 +``` + +In this command I point to my `Personal` vault, I update the title of the login +item inline, and then I have some custom fields on the item that match the shape +of this scenario. + +When I hit enter, a listing of fields is output. I can then hop over to the +desktop app to set the actually ID and secret for the access key.