Add Create 1Password Login Item From The CLI as a Workflow TIL

This commit is contained in:
jbranchaud
2026-10-24 13:49:07 -05:00
parent ae83a39fa8
commit 0f143e71ed
2 changed files with 40 additions and 1 deletions
+2 -1
View File
@@ -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)
@@ -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.