pacmax beta

Alfred Pac by drgrib on GitHub

bear

Streamlined note searching and creation for Bear using Alfred

From their README

Donate

Bear Workflow

Streamlined note searching and creation for Bear using Alfred.

Install

  1. Download the latest release and double-click Bear.alfredworkflow. Alfred will open the workflow and install it.
  2. Authorize all the executables used by the workflow.

If you are on an Intel Mac, use this download link for the last Intel-compatible version.

If you are using an old version of Bear before 2.0 use this download link for the latest version supporting it.

Search

bs or bsearch

Recent Notes

Leave the search field empty to see recent notes with their tags as subtitles.

Basic Search

Start typing to search through the titles and text of most recent notes, title matches first.

Tag Search

Type # at any time to autocomplete your tags.

Start typing to search tags.

Once completed, the notes will be filtered by that tag.

Add more tags to filter by multiple tags.

Start typing to search titles and text within a tag.

All these terms can be typed in any order and they will work the same. For example, if you want to add a tag after typing a bare search term, the autocomplete will still help you. Or if you remember you want to filter by another tag after typing the first tag and a bare search term, you can autocomplete and add the second tag by typing # again.

Search in Bear App

You can search any query you type in the Bear app's main window by holding down the option key. If you've entered a tag, it will open the Bear main window to that tag for further browsing.

Open Note in Bear App

Similarly, you can open any note you select in the Bear app's main window by holding down the command key.

Link Pasting

While in your Bear notes, you can paste a link to another note by searching for it and holding down the shift key.

Table of Contents Pasting

Similarly, you can paste a table of contents for a note by searching for it and holding down the command and shift keys.

New Notes

bn or bnew followed by title and optional tags.

Tag autocomplete works the same. Also, any text in your clipboard can be added to the new note by holding down the command key.

Create/Search

bcs or bcsearch

You may find sometimes that you want to retrieve a note if it exists and create it if it does not. This command provides that functionality by combining the behavior of search and create. It will provide all the same search results as normal search and additionally add a create item third in the list using normal create options.

If there are less than two search items, the create item will be the last or only item.

You can additionally create links to notes by holding the shift key while selecting a search item. Selecting the create item while holding the shift key will do nothing.

Why I created this

I am especially grateful to Chris Brown, who created a Python based Bear workflow. It was the basis for this project. However, I decided to create my own project for a few reasons:

  • Compiled Go is faster than interpretted Python. Not that much faster but fast enough for me to notice when searching and creating notes throughout the day.
  • I wanted the features involving tag searching and autocompletion, link pasting, and automatic clipboard note content.
  • I wanted fewer, more optimized SQL queries into the Bear database to increase speed since this appears to be the main bottleneck on performance.

Authorization

The first time you use the workflow after installing or upgrading, you will see a security warning:

This is a quirk of macOS 10.15 and above. Apple currently forces developers to pay $99 a year to be able to officially sign their executables and avoid this warning, which I'm not going to pay since I'm providing this workflow for free as an open source project.

After seeing this warning, you have to go to System Preferences > Security & Privacy > General and click the new button that has appeared to allow the executable to run. You then have to run it again and you will see this security warning again but now it will have a new button that lets you allow the executable to run.

These warnings will appear once for each of the executables inside the workflow as you use new features. Once you have authorized all of them, you won't see these warnings anymore until you install a new version.

Authorize All Executables

If you want to authorize all Bear Workflow executables at once or if you do not see the above security warnings but the workflow isn't working, you can do the following:

  1. Go to the Workflows section in Alfred Preferences
  2. Right click on Bear by drgrib and select Open in Terminal
  3. Copy this command and execute it:
xattr -rd com.apple.quarantine cmd

This should authorize all the Alfred Bear the executables and fix the security errors.

If you are trying to use the Bear workflow loaded from prefrences via cloud (e.g. through Google Drive) on a new Mac, you may also need to run this command, which will make the executables executable:

find . -mindepth 3 -maxdepth 3 -type f \! -name "*.go" -exec chmod +x {} \;

Install Rosetta

Note: v1.2.5 and later run natively on Apple Silicon and do not require Rosetta. The steps below only apply to v1.2.4 and earlier.

If your mac is based on an Apple Silicon chip (M1, M2, etc.), you need to have Rosetta installed on your system, otherwise Alfred workflows will fail silently.

Copy this command and execute in terminal to install Rosetta:

softwareupdate --install-rosetta

If that fails, try this version, which requires your admin password:

sudo softwareupdate --install-rosetta --agree-to-license

Latest release

  • 1.2.51 month ago, 31.6 MBDownload

    This will likely be my final update for alfred-bear. All binaries have been recompiled natively for Apple Silicon (arm64), so the workflow now runs on Apple Silicon Macs without Rosetta and will continue working once Apple removes Rosetta in future macOS releases.

    If you are on macOS 27 (or newer) on Apple Silicon, this release removes the need to reinstall Rosetta after OS upgrades. If you are on an Intel Mac, stay on the previous release, since this version is Apple Silicon only.

    Why Likely the Final Update?

    I was holding out hope that my employer would not ban Bear on my corporate laptop due to its built-in iCloud syncing, but that day finally came and I had to uninstall it. Quick note-taking and search are critical to my daily work, which rendered Bear unusable for me professionally.

    Another limitation of Bear for my workflow is that notes are stored in SQLite rather than plain Markdown files, which makes Git versioning and refactoring with AI agents difficult. For these reasons, I am migrating my personal Bear notes to Obsidian.

    Moving Forward: alfred-obsidian

    For Alfred integration, I originally planned on using shimmering-obsidian, but it requires a plugin that is also blocked by my company, and the project is broader in scope than the minimal workflow I wanted. Instead, I built alfred-obsidian around the same streamlined interface and commands as alfred-bear.

    alfred-obsidian is rewritten in Rust with a local caching framework (plus local image OCR and PDF indexing). Most notably, after the initial index refresh on an empty query, every character you type searches strictly from the cache, which is a major responsiveness upgrade over alfred-bear.

    I wish I had the time to port this architecture back to alfred-bear, but I am just one person and unfortunately do not have the bandwidth. Anyone is welcome to examine the open-source code in both alfred-obsidian and alfred-bear and fork or build a new Bear workflow based on the Rust caching design. Otherwise, if you want these quality-of-life improvements, you are welcome to migrate to Obsidian with me, whether now (if you have already been considering the switch) or someday down the road.

    Thank you all for your support, bug reports, and contributions that made the Alfred Bear Workflow a success. I have done my best to ensure it keeps working smoothly for you for as long as you still need it.

19 earlier releases
  • 1.2.43 years ago, 33.6 MBDownload

    This corrects a long-standing flaw in the workflow that I wasn't even aware of until recently: when searching with multiple tags, the search was not narrowed down to the intersection of the tags but rather their union. This was particularly frustrating if you were trying to narrow down the scope of the search to notes containing all tags. It required the most complicated SQL query yet but the problem is corrected.

    Apologies for the flurry of releases in the past week. If I had foreseen all these issues, I would have grouped them into a single release. In case you missed it these features were also just added:

    • Default link pastes are now wiki-links to support backlinking
    • Image search
  • 1.2.33 years ago, 33.1 MBDownload

    Adds image search support.

  • 1.2.23 years ago, 33.1 MBDownload

    Adds wiki-link as default shift link to support new Bear backlinks in info tab (context).

    An annoying caveat to this is that you must now cmd-click links to open them in a new window. @msageryd has made a feature request with Bear support to have "open links in new window" as a global Bear setting and they sound receptive to supporting it in future releases .

    You can paste the previous default links with shift-cmd. Pasting ToC has been changed to option-cmd since it is less useful now with Bear 2's built-in ToC support.

  • 1.2.13 years ago, 27.0 MBDownload

    Adds support for tags with spaces in the form of #multiword tag#.

  • 1.23 years ago, 26.9 MBDownload

    This update adds support for Bear 2.0. A special thanks to @verginer for authoring most of this and cleaning up the SQL query formatting in the source. Thanks also to @xiaogaozi for doing early testing on this and taking the time to write step-by-step instructions for others to use it early.

    Note: this is not backward compatible with previous versions of Bear as I saw no compelling reason to add backwards compatibility. If you are sticking with previous versions of Bear, use version 1.1.9. Otherwise, be sure to update Bear to 2.0 before installing this.

  • 1.1.94 years ago, 27.2 MBDownload

    I've increased the speed and lowered (eliminated?) the crash rate for queries by lowering the amount of database rows returned by the lite db queries. I've noticed no change in accuracy for my test queries, so this should hopefully just be a net gain in performance with no noticeable cost in accuracy.

  • 1.1.85 years ago, 28.0 MBDownload

    Adds ability to paste table of contents for a note with command + shift.

  • 1.1.75 years ago, 23.4 MBDownload

    Minor update to remove errant spaces that were getting added to titles on creation.

  • 1.1.66 years ago, 22.4 MBDownload

    Enables case-insensitive search for non-English characters.

  • 1.1.56 years ago, 22.7 MBDownload

    You can now search for terms out of order or without typing the full exact titles of notes or full sentences of note contents and the search algorithm will merge and intelligently sort the best matching results from each of the words you type. You can put quotes around phrases for strict matching but it should rarely be necessary due to the preemptive sorting of the strongest matches to the top.

  • 1.1.46 years ago, 22.4 MBDownload

    Updates keys to more optimal layout:

    • shift to paste link to selected note
    • command to open selected note in main Bear app window
    • option to open query in main Bear app window

    The reasoning being that holding either shift or option has negative effects on opening the selected note in the Bear app of selecting all text or not scrolling up, respectively. Next, shift is easier to press than option and I personally paste links much more often than I search queries in the Bear app window. Which leaves those queries with option.

  • 1.1.36 years ago, 22.4 MBDownload

    Calibrates opening queries and notes in the main Bear app. Queries will now be opened using shift instead of option. Notes can be opened using option. The reasoning for this change is in #25. Also removes unwanted ordering of Create and Search [Query] in Bear App items.

  • 1.1.26 years ago, 21.8 MBDownload

    Fixes versioning / mod issues, adds autocomplete for special search keywords, and adds support for special search keywords, queries, and tags in Bear app main window as documented here: https://github.com/drgrib/alfred-bear#search-in-bear-app

  • 1.1.16 years ago, 20.5 MBDownload

    Adds external trigger, fixes bcs row errors, fixes apostrophe / single quote searching, more robust set cursor after search.

  • 1.16 years ago, 19.4 MBDownload

    Adds the bcs command for Create/Search as documented in the updated README.md. Additionally, places the cursor at the top left of notes opened via search for easy keyboard-only navigation and editing.

  • 1.0.66 years ago, 14.6 MBDownload

    Supports searching, linking, and creation using non-english characters. Drops support for Alfred 3.

  • 1.0.57 years ago, 14.0 MBDownload

    Compatible with both Alfred 3 and Alfred 4, with some redundancy cleanup in info.plist.

  • 1.0.47 years ago, 14.0 MBDownload
  • 1.0.37 years ago, 14.0 MBDownload

    Includes notes without tags in recent note and tagless search queries.