How to export my bookmarks via CLI in Google Chrome?

Solution 1:

Chrome stores bookmarks in you profile directory, in the Bookmarks file, which is in JSON format

Solution 2:

Here is a neat thing on macosx :

BOOKMARKS=/Users/$USER/Library/Application\ Support/Google/Chrome/Default/Bookmarks.bak

# method 1
python test.py $BOOKMARKS

# pipe example
# shuffle tty's for pdb to work

cat $BOOKMARKS | python test.py 

test.py :

import json
import fileinput
from io import BytesIO

bookmarks = BytesIO()
for line in fileinput.input():
    bookmarks.write(line.encode('utf-8'))
bookmarks.seek(0)
bakmarks = json.loads(bookmarks.read())
import pdb;pdb.set_trace()