I want to know how put some /my/folder/path/ to Sidebar in Favorites or Devices section, from terminal?


Per this GitHub page, a tool named sfltool can be used to add favorites. The tool is included with macOS El Capitan and later.

Example usage

/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///my/folder/path/

  • It's not working now. There's not official tool for slf2. – fxp Oct 13 '18 at 9:37

The add-item capability of sfltool has now been removed since 10.13 and going forward. So that's no longer an option.

An easier to use alternative is mysides, which can easily by installed via Homebrew Casks:

$ brew cask install mysides
$ mysides add example file:///Users/Shared/example
  • 1
    This worked for me on Mojave. – bearvarine Sep 21 '19 at 15:20

I used the mysides tool to create a link to the Trash folder on my sidebar. You will need admin (or sudo) permissions to install mysides.

$ brew cask install mysides
==> Satisfying dependencies
==> Downloading https://github.com/mosen/mysides/releases/download/v1.0.1/mysides-1.0.1.pkg
==> Verifying SHA-256 checksum for Cask 'mysides'.
==> Installing Cask mysides
==> Running installer for mysides; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
installer: Package name is mysides-1.0.1
installer: Installing at base path /
installer: The install was successful.
🍺  mysides was successfully installed!

$ mysides add Trash file:///Users/bearvarine/.Trash
Added sidebar item with name: Trash

Another option could be using Python to create a script with the PyPi package finder-sidebar-editor and call it from the terminal.

Would be something like:

from finder_sidebar_editor import FinderSidebar

sidebar = FinderSidebar()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.