extensions
extensions copied to clipboard
New Extension: YubiKey Code
Description
A new extension to help get OTPs from your YubiKey.
Screencast
https://user-images.githubusercontent.com/9059772/193303916-919b78a1-5c42-4437-a944-68e4f63cbd02.mp4
Checklist
- [x] I read the extension guidelines
- [x] I read the documentation about publishing
- [x] I ran
npm run build
and tested this distribution build in Raycast - [x] I checked that files in the
assets
folder are used by the extension itself - [x] I checked that assets used by the
README
are placed outside of themetadata
folder
Congratulation on your new Raycast extension! :rocket:
We will review it shortly. Once the PR is approved and merged, the extension will be available on the Store.
Seems to do the job as expected, but you could maybe look into finding the brew path automatically like the Brew extension is doing it
What do you think about that?
That seems like a good improvement. I'll try to get that worked in when I have a chance.
@pernielsentikaer Alright, so now that I've had a chance to sit down and look at this for a minute, I have a potentially silly question. I believe the code you were referring to is this bit here, but when I try to run that locally, it fails with "command not found" and always defaults back to the cpus()[0].model.includes("Apple") ? "/opt/homebrew" : "/usr/local"
line.
I'm able to run brew --prefix
through the terminal with no issues, so is there something about my local dev environment which could cause this, or is it possible that this code isn't working in the Brew extension either? If that is the case, I can just add the cpus()[0].model.includes("Apple")
check as a sensible default with the option to set a custom path through the preferences. Let me know what you think.
Hi 👋
I gave it another spin, I have some feedback for you 😊
- It would be useful if it told you that
ykman
doesn't exist instead, since right now it can be hard to understand what's going on - maybe even combine with a nice List.Emptyview 😊

Do you have some ideas for that?
@pernielsentikaer thanks for the helpful feedback. I made some updates to try to improve the things you mentioned. Let me know what you think 😊
@yoyoyeti
@pernielsentikaer Alright, so now that I've had a chance to sit down and look at this for a minute, I have a potentially silly question. I believe the code you were referring to is this bit here, but when I try to run that locally, it fails with "command not found" and always defaults back to the cpus()[0].model.includes("Apple") ? "/opt/homebrew" : "/usr/local" line.
I think that code is incorrect, or at least incomplete. I think you need to pass { shell: true }
to execSync
. This indicates that the command should be run via the user's shell, rather than directly. When not running in a shell, as is the default, brew
can't be found because there is no PATH
to be searched, or if there is it doesn't have /usr/local/bin
on it.
It's probably better to pass a full path to /usr/local/bin/brew
if it's always installed in the same place as using a shell is quite a bit heavier weight, but up to you to judge.
Apologies, slightly wrong in my previous comment, execSync
doesn't use the user's shell, but rather /bin/sh
by default. This might be enough to see binaries at /usr/local/lib
though so I'd give it a go.
@danpalmer Thanks for getting back to me on that. I'm getting an error that looks more like /bin/sh: bin/brew: No such file or directory
with { shell: true }
, but still no luck.
Even if I could make this work, I found that adding the extra command to find the brew prefix slowed down the workflow enough to make it a little frustrating to use. I feel like the current setup is faster and will work out of the box for most people. There's also the option to override the path for anybody who needs it. I'm willing to keep trying if you have any more suggestions, but do you think the extension would be fine in its current state?
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊
@pernielsentikaer is there anything else this needs before it can be merged?
Published to the Raycast Store: https://raycast.com/yoyoyeti/yubikey-code