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.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

safari_bookmarks_cli-0.6.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file safari_bookmarks_cli-0.6.1.tar.gz.

File metadata

  • Download URL: safari_bookmarks_cli-0.6.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for safari_bookmarks_cli-0.6.1.tar.gz
Algorithm Hash digest
SHA256 ced9ebf51bb70c653f14333c3df5e7396866a3f8a7424b58107754622f0d2375
MD5 ac6c0999d280ea443e318320ea69a2c7
BLAKE2b-256 9000417193c67de7f354e6e9df40646b771b361b082a777175d5a53ea88c765c

See more details on using hashes here.

File details

Details for the file safari_bookmarks_cli-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for safari_bookmarks_cli-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ab1d3672e92c6a7cecb92baea61d54ed58e0ac7a636898df50127ac82bc2818
MD5 0ffc85dd52995f76d781a7cd32cb8f26
BLAKE2b-256 e88ce954f7086ede9cd96ed557703a3afca0df0a1cdce7dc6a99cefe44e63210

See more details on using hashes here.

Supported by

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