Screenshot of workflow in use. Query 'vsc temp' results in four VSCode workspaces.

Alfred workflow to quickly navigate Visual Studio Code workspaces

I created a workflow to open VSCode workspaces for the macOS search tool Alfred quickly. It supports local and remote repositories.

Usage

You can activate the workflow by writing the prefix vsc into Alfred. Now, it lists all known workspaces that you can filter further.

Screenshot of workflow in use. Query 'vsc temp' results in four VSCode workspaces.

Installation

=== Update ===

Since release 1.1.0 you don’t need to set the path to code anymore

==============

You need to have Node.js installed on your Mac to use the workflow. You can install the workflow with the Node Package Manager with the following command:

npm i -g @phartenfeller/alfred-vscode-workspaces

Additionally, you need to configure the path to your VSCode installation. You can find out where it is installed like this:

where code
# for example /opt/homebrew/bin/code

Copy that path and access the workflow settings by searching for alfred preferences in Alfred. On the tab “workspaces” navigate to the new workflow and click on the variables section on the top right.

Screenshot of workflow preferences in alfred. The button to edit variables is higlighted on the top right.

In the dialog change the environment variable codepath to your copied path. Make sure to save the changes.

Screenshot of workflow environment variables preferences dialog in alfred. On the right side is a variable named 'codepath' that should include your path to vscode.

Now you are set up to use the workflow and quickly open Visual Studio Code workspaces. Note that you can also find remote ones, for example, set up with SSH.

Contribute and Bugs

If you want to improve this workflow or report bugs/ideas feel free to open issues in this Git repo.

Other Posts

Comments

Loading comments...
Homepage All Blogposts

AI disclaimer: I spend hours writing my blog posts by hand, adding my own thoughts and experiences to them. In my view, purely AI-generated content lacks that human depth and isn't worth publishing. I only use AI for research and editing assistance.