Jump to content

1Password — Search and open 1Password items


Recommended Posts

Setup


Install the 1Password CLI and turn on the integration in 1Password Preferences → Developer → Connect with 1Password CLI.


1password_preferences.png


Usage


Interact with your 1Password items via the 1p keyword.


1p.png

  • ↩: Open and Fill.
  • ⌘↩: View in 1Password.
  • ⌥↩: Copy Username.
  • ⌃↩: Copy Password.
  • ⇧↩: Copy One-Time Password

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


1pextras.png


vaults.png


A Fallback Search is included.


To report a problem, run !1pdiagnostic.


⤓ Install on the Alfred Gallery | Source

 

Link to comment

Before reporting an issue, make sure you have installed the Automation Tasks and try again.

 

To report a problem, run !1pdiagnostic and paste the results in this thread or on GitHub.

 

If the workflow appears to hang when updating items, open a terminal and run op item list:

  • If you get an error, something is wrong with 1Password’s command-line tool or its interaction with the app and it needs to be resolved with the 1Password support.
  • If you see your items, open the debugger and run :1pextras → Force Update Items. Include the debugger’s output in your report.
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
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

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

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...