Most of my alfred
workflows are in python
and I often use uv
to run them.
To make working on them a bit easier, I brainstormed an alfred-uv command to make it easier to develop.
uvx alfred-uv install
All the workflows I develop for myself, I tend to store as a git repo and then symlink.
To make this flow easier, I write a uvx alfred-uv install command.
Given the current directory, we can loop through the alfred workflows directory and check the existing symlinks there. If we find a link to our current directory, we’ve already installed things and can skip it. If we do not find a link, then we can create a symlink so that our repo now shows up as workflow.
For my first draft, I am just naively picking Path.cwd() from Python, but in a future revision, I may get the root git repo and use that as an extra safety check.
uvx alfred-uv open
When writing code for an extension, I will often want to open it in Alfred’s workflow page for the visual editor. While searching online, I found a link that can be used to open our workflow.
alfredpreferences://navigateto/workflows>workflow>{bundleid}
With this in mind, it is as simple as reading the bundle id from our current workflow’s info.plist and pulling out the bundleid then opening the url.
Future Ideas
Most of my workflows are only useful to me, but in the future perhaps I can add a uvx alfred-uv bundle or others to help with publishing workflows.
For now, code is on https://codeberg.org/kfdm/alfred-uv and ideas could be filed as issues.
Package is published to https://pypi.org/project/alfred-uv/ to allow running with uv.