Skip to main content

A cli to manage bookmarks in the Safari web browser.

Project description

safari-bookmarks-cli

A cli to manage bookmarks in the Safari web browser.

This utility interacts with Safari's Bookmarks.plist file. When it detects changes it is reloaded without intervention.

Note macOS 10.14+ requires Full Disk Access for the application being used. ie. Terminal, iTerm, etc.

Installation

You can install safari-bookmarks-cli via pip:

pip3 install safari-bookmarks-cli

# verify installation
safari-bookmarks --version

Usage

The following assumes the default location for Safari's bookmarks, which is ~/Library/Safari/Bookmarks.plist. If this is not the case you can specify an alternate location by passing the arguments -f <elsewhere>.

For a full list of commands and options just run:

safari-bookmarks --help

To list all bookmarks run

safari-bookmarks list

To list all bookmarks in the menubar

safari-bookmarks list "BookmarksMenu"

Add a new bookmark to the menubar

safari-bookmarks add --title "New bookmark" --url "http://example.com" "BookmarksMenu"

Add a new bookmark to the menu

safari-bookmarks add --title "New folder" --list "BookmarksBar"

Move a bookmark to a different folder

safari-bookmarks move "BookmarksMenu" "New bookmark" --to "BookmarksBar" "New folder"

Remove a bookmark or folder

Note removing a folder will also remove all bookmarks and folders within it.

safari-bookmarks remove "BookmarksBar" "New folder"

Empty a folder

safari-bookmarks empty "BookmarksBar" "New folder"

Testing

Clone the repository:

git clone https://github.com/evilmarty/safari-bookmarks-cli.git

Install pytest and flake8

pip3 install pytest flake8

Run them

pytest && flake8

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

safari_bookmarks_cli-0.6.0.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distribution

safari_bookmarks_cli-0.6.0-py3-none-any.whl (13.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page