Summary
Implement automation for exporting and importing Chrome bookmarks.
The goal is to provide a simple shell-based solution that allows bookmarks to be backed up into the repository and restored later with minimal user interaction.
This feature is intended for personal backup and synchronization workflows.
Goals
- Implement using POSIX shell (
.sh)
- Avoid Python unless absolutely necessary
- Support macOS as the primary platform
- Keep implementation simple and transparent
- Store exported bookmarks inside the repository
- Allow restoring bookmarks from a previously exported file
Folder structure
scripts/
chrome/
export-bookmarks.sh
import-bookmarks.sh
wait-download.sh
data/
bookmarks/
bookmarks.html
Export workflow
close chrome (optional)
↓
open bookmark manager
↓
navigate to
Bookmarks Manager
↓
open overflow menu
↓
Export Bookmarks
↓
wait for download
↓
move downloaded html
↓
data/bookmarks/bookmarks.html
Import workflow
verify bookmarks.html exists
↓
open bookmark manager
↓
open overflow menu
↓
Import Bookmarks
↓
select bookmarks.html
↓
wait until completed
↓
done
Assumptions
- User is already logged into Chrome
- User uses the default Downloads directory
- User has permission to automate Chrome
- User can grant Accessibility permissions if required
- Existing bookmarks may be merged by Chrome
The script does not attempt to manage synchronization conflicts.
Script responsibilities
export-bookmarks.sh
- Open Chrome if necessary
- Open the bookmark manager page
- Trigger bookmark export
- Wait until an HTML file appears in Downloads
- Move the exported file to:
data/bookmarks/bookmarks.html
- Replace the previous backup if one exists
import-bookmarks.sh
data/bookmarks/bookmarks.html
- Open Chrome bookmark manager
- Trigger bookmark import
- Select the backup file
- Wait for completion
- Exit successfully
wait-download.sh
Utility script responsible for polling the Downloads directory.
Pseudo workflow:
loop
if newest html file exists
return path
sleep 1
timeout after configurable period
Future improvements
- Timestamped bookmark backups
bookmarks/
2026-06-10.html
2026-07-01.html
latest.html
-
Chromium support
-
Brave support
-
Arc support
CLI
./scripts/chrome/export-bookmarks.sh
./scripts/chrome/import-bookmarks.sh
Later these can be wrapped by:
shuttle bookmarks export
shuttle bookmarks import
Definition of done
- Export script creates
data/bookmarks/bookmarks.html
- Import script restores from
data/bookmarks/bookmarks.html
- Scripts are idempotent
- Existing backup is overwritten safely
- Errors are handled gracefully
- Timeouts prevent infinite waiting
- Scripts are documented and runnable from a fresh clone
Summary
Implement automation for exporting and importing Chrome bookmarks.
The goal is to provide a simple shell-based solution that allows bookmarks to be backed up into the repository and restored later with minimal user interaction.
This feature is intended for personal backup and synchronization workflows.
Goals
.sh)Folder structure
Export workflow
Import workflow
Assumptions
The script does not attempt to manage synchronization conflicts.
Script responsibilities
export-bookmarks.sh
import-bookmarks.sh
wait-download.sh
Utility script responsible for polling the Downloads directory.
Pseudo workflow:
Future improvements
Automatic diff between backups
Restore specific snapshot
Multiple Chrome profiles
Chromium support
Brave support
Arc support
CLI
Later these can be wrapped by:
Definition of done
data/bookmarks/bookmarks.htmldata/bookmarks/bookmarks.html