Jump to content

1Password — Search and open 1Password items


Recommended Posts

This Workflow is for 1Password 8. For older versions, see Alfred Preferences → Features → 1Password.


Use 1p to interact with your 1Password items.


On first run you’ll need to set up your account with 1Password’s official command-line tool. Your terminal will open and guide you through the process.


164914491-1c1b4da5-a0b1-4cdf-9881-a62a8e


From then on, 1p will show your items. ↵ opens the website in your browser (and fills the credentials if you have the browser extension installed) while ⌘↵ opens the item in 1Password.


167198194-cb5bf2b7-52ee-4b39-bf0a-a921eb


The Workflow will attempt to detect when you update items in 1Password and present you with the option to refresh them. You can disable this behaviour by flipping the auto_refresh Workflow Environment Variable to 0. Set logins_only to 1 if you want to hide other item types. Set hostnames_only to 0 if you want to see full URLs in results.


Uncommon but useful actions, such as toggling vaults, can be accessed via :1pextras.


165388195-40975de6-6fe4-4607-96d9-ce96d8


166268572-bc504873-5ff0-43a1-b76c-90bf38


!gddiagnostic inspects the current Workflow configuration. It is to be run when asking for help.

 

Download | Source

Edited by vitor
Link to comment
Posted (edited)

If you need help with the Workflow, run !1pdiagnostic in Alfred. Wait for the notification/sound and paste the output.

 

Account management is done via the terminal because that’s the new official method offered by 1Password. They have deprecated their previous third-party integration.

Edited by vitor
Link to comment

Hi Vitor

 

Thank you! After my quick and dirty URL Scheme-based WF stopped with 1Password Beta 8 I am trying your new one. I executed and opened terminal, but I am receiving the following error. Seems I need to enable something in 1P?

 

---------------------------- INSTRUCTIONS ----------------------------

The official 1Password command-line tool will ask you to sign in.
This is necessary to get the items list for the 1Password Workflow.

For account details, consult your 1Password Emergency Kit:

  https://support.1password.com/emergency-kit/#get-your-emergency-kit

----------------------------------------------------------------------

[ERROR] 2022/04/25 10:41:21 connecting to desktop app: not connected
./1password.js: execution error: Error: SyntaxError: JSON Parse error: Unexpected EOF (-2700)
[ERROR] 2022/04/25 10:41:21 connecting to desktop app: not connected

Updating items list. It will take a few seconds to complete.
You may close the terminal at any time.
.[ERROR] 2022/04/25 10:41:22 connecting to desktop app: not connected
./1password.js: execution error: Error: SyntaxError: JSON Parse error: Unexpected EOF (-2700)

Link to comment
Posted (edited)
4 hours ago, Acidham said:

Seems I need to enable something in 1P?

 

On the contrary, you need to disable biometric unlock on the CLI tool (in the 1Password app → Preferences → Developer). As per the second post, their current implementation for the biometric unlock requires a small inconvenience (that you install their CLI yourself) which I’d like to avoid. It’s looking like for the near future it won’t be possible to have both biometric unlock and not requiring that manual step, so I’m reworking the Workflow with that in mind.

Edited by vitor
Link to comment

Just released a version with support for biometric unlock.

 

@Acidham with the new one, you would instead have seen:

 

------------------------- IMPORTANT -------------------------

To use biometric unlock, you need to manually install
the 1Password command-line tool. Download it at:

  https://1password.com/downloads/command-line/

Then run the Workflow again.

Alternatively, disable Biometric unlock for 1Password CLI
in the 1Password app preferences, under Developer.

You may close the terminal.

-------------------------------------------------------------

 

If you follow those instructions and reenable biometric unlock, it should now work.

Link to comment

Is there any way to configure this to trigger without using 1p? With the old bookmarks integration I was able to have logins show up in the default alfred search without a keyword trigger. For instance, I would just type in Twitter to open the 1password bookmark

Link to comment

Update.

  • Replace account shorthands with account URLs.
  • Force use of Zsh in terminal (relevant for people on alternative shells, like Fish).
  • Add !1pdiagnostics (run that when asking for help; it auto gathers important information).

Link to comment

Hi Vitor,

 

I have your workflow working on one Mac (M1 Pro MacBook) but not on my Intel iMac. When I try to run the "sign in and update items" command, terminal opens but I get the following (user directory is "rich"). Biometric unlock is not ticked. 

 

I have tried installing the 1Passord CLI (based on the "old version of the command line" statement). But it made no difference. I found that I couldn't log into the CLI on my iMac at all, I get the same error about "cannot create directories" there as well. It seems like permissions, but I can't work out for what?

 

Last login: Tue May  3 18:32:04 on ttys000

  /bin/zsh

  export alfred_workflow_data=/Users/rich/Library/Application\ Support/Alfred/Workflow\ Data/com.alfredapp.1password && export logins_only=0 && /Users/rich/Library/CloudStorage/OneDrive-Personal/Backups/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DA5B1E61-154D-431E-9E9B-E62E56E9A689/signin.zsh

rich@Richs-iMac ~ %   /bin/zsh

rich@Richs-iMac ~ %   export alfred_workflow_data=/Users/rich/Library/Application\ Support/Alfred/Workflow\ Data/com.alfredapp.1password && export logins_only=0 && /Users/rich/Library/CloudStorage/OneDrive-Personal/Backups/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DA5B1E61-154D-431E-9E9B-E62E56E9A689/signin.zsh

 

 

 

 

 

 

 

 

 

 

 

 

[ERROR] 2022/05/03 18:37:35 cannot create directory "/Users/rich/.config/op" and the parent directories: mkdir /Users/rich/.config/op: permission denied

./1password.js: execution error: Error: SyntaxError: JSON Parse error: Unexpected EOF (-2700)

[ERROR] 2022/05/03 18:37:35 cannot create directory "/Users/rich/.config/op" and the parent directories: mkdir /Users/rich/.config/op: permission denied

./1password.js: execution error: Error: SyntaxError: JSON Parse error: Unexpected EOF (-2700)

/Users/rich/Library/CloudStorage/OneDrive-Personal/Backups/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DA5B1E61-154D-431E-9E9B-E62E56E9A689/signin.zsh:18: command not found: ''

 

------------------------- IMPORTANT -------------------------

 

You have an old version of the 1Password command-line tool.

Install the latest version from:

 

  https://1password.com/downloads/command-line/

 

Then run the Workflow again.

 

You may close the terminal.

 

-------------------------------------------------------------

 

rich@Richs-iMac ~ %

Link to comment
On 4/29/2022 at 11:13 AM, vitor said:

@mjking No, but I’ve just made a release to add it as a Fallback Search, which gets you close (essentially requires an extra ↵).

Hi @vitor - the old integration with v7 had the ability to integrate 1Password results into the default with no keyword required - see attached option in the settings. Is this possible to be added to the workflow to match the functionality with v7? The fallback search doesn't quite work the same way. 

CleanShot 2022-05-04 at 16.39.58@2x.png

Link to comment

Hi, I am having difficulty configuring this workflow. 

 

I have 1Password 8 installed. I have downloaded the Alfred workflow. I attempted to follow the  terminal instructions. At present, I cannot 1Password invoke bookmarks, etc, when typing 1p. My debugger info is pasted below. 

 

Thanks. 

 

 

 

[16:06:04.489] Logging Started...

[16:06:10.806] 1Password[Script Filter] Queuing argument '(null)'

[16:06:10.821] 1Password[Script Filter] Script with argv '(null)' finished

[16:06:10.823] 1Password[Script Filter] {"items":[]}

[16:06:18.853] Logging Stopped.

[16:06:19.361] Logging Started...

[16:06:27.460] 1Password[Script Filter] Queuing argument '(null)'

[16:06:27.533] 1Password[Script Filter] Script with argv '(null)' finished

[16:06:27.535] 1Password[Script Filter] {"items":[]}

[16:06:42.142] 1Password[Script Filter] Queuing argument '(null)'

[16:06:42.154] 1Password[Script Filter] Script with argv '(null)' finished

[16:06:42.155] 1Password[Script Filter] {"items":[]}

[16:06:43.260] 1Password[Keyword] Processing complete

[16:06:43.261] 1Password[Keyword] Passing output '' to Run Script

[16:06:44.150] 1Password[Run Script] Processing complete

[16:06:44.154] 1Password[Run Script] Passing output '### Workflow version

2022.9

 

### Alfred version

4.6.6

 

### macOS version

12.3.1

 

### Architecture

i386

 

### Workflow environment variables

Dict {

    auto_refresh = 1

    logins_only = 0

}

 

### 1Password version

8.7.0

 

### op version

In Workflow: 2.1.0

In /usr/local: NOT installed

 

### Biometric unlock

NOT enabled

 

### Custom terminal feature

NOT enabled

 

### Launchd job

Loaded: - 0 com.alfredapp.1password

Installed

' to Copy to Clipboard

[16:06:44.155] 1Password[Copy to Clipboard] Processing complete

[16:06:44.156] 1Password[Copy to Clipboard] Passing output '### Workflow version

2022.9

 

### Alfred version

4.6.6

 

### macOS version

12.3.1

 

### Architecture

i386

 

### Workflow environment variables

Dict {

    auto_refresh = 1

    logins_only = 0

}

 

### 1Password version

8.7.0

 

### op version

In Workflow: 2.1.0

In /usr/local: NOT installed

 

### Biometric unlock

NOT enabled

 

### Custom terminal feature

NOT enabled

 

### Launchd job

Loaded: - 0 com.alfredapp.1password

Installed

' to Post Notification

[16:06:44.158] 1Password[Post Notification] Processing complete

[16:06:44.158] 1Password[Post Notification] Passing output '### Workflow version

2022.9

 

### Alfred version

4.6.6

 

### macOS version

12.3.1

 

### Architecture

i386

 

### Workflow environment variables

Dict {

    auto_refresh = 1

    logins_only = 0

}

 

### 1Password version

8.7.0

 

### op version

In Workflow: 2.1.0

In /usr/local: NOT installed

 

### Biometric unlock

NOT enabled

 

### Custom terminal feature

NOT enabled

 

### Launchd job

Loaded: - 0 com.alfredapp.1password

Installed

' to Play Sound

Link to comment
1 hour ago, Handcuffs said:

Is this possible to be added to the workflow to match the functionality with v7? The fallback search doesn't quite work the same way. 

 

Welcome @Handcuffs. Not at the moment.

 

1 hour ago, stenti1 said:

I attempted to follow the  terminal instructions.

 

Welcome @stenti1. That part is missing from your report. I need to know the Terminal output because everything else seems fine.

Link to comment
6 minutes ago, vitor said:

Welcome @Handcuffs. Not at the moment.

Thanks for the welcome. Is this a limitation on the 1Password side of things or on the Alfred side? You say it isn't possible at the moment - is there a possibility of it being added/changed in the future via an updated workflow? 

Link to comment
4 minutes ago, Handcuffs said:

Is this a limitation on the 1Password side of things or on the Alfred side?

 

Workflow’s can’t interfere with the default results. Though you can replace them with not too much effort. The Fallback Search is the closest we can get in the Workflow, unless you want to follow that guide.

Link to comment

Interesting. Hopefully this is something that the Alfred developers may consider changing (by exception) as having quick access to those bookmarks was an excellent feature of the 1p v7 integration.

Link to comment

Thank you, @vitor. 

 

I have now successfully configured the workflow.

 

I had miss entered the sign-in address in the first prompt, and this was throwing things off. Typing “1p” wouldn't show me anything.  

 

So I invoked the workflow command :1pextras. I then selected Reset Accounts. Now "1p" broght me back to the set-up. I could then get back to the 1password terminal interface. From there, I figured it out. 

 

Thanks. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...