Organize bookmarks from iOS/iPadOS Safari + Firefox with OpenAI, then either:
- generate an importable Firefox HTML file (safe mode), or
- apply folders/tags/bookmarks directly to Firefox
places.sqlite(optional).
Fastest safe path: run container, generate bookmarks.organized.html, import it in Firefox.
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install -y podmanLinux (Fedora):
sudo dnf install -y podmanmacOS:
brew install podman
podman machine init
podman machine startWindows (PowerShell):
winget install RedHat.Podman
podman machine init
podman machine startpodman login ghcr.io -u YOUR_GITHUB_USERNAME
podman pull ghcr.io/alfanick/borgmarks:v0.7.10- Find Firefox profile path (directory containing
places.sqlite). - Close Firefox before running.
- Optional iOS export (
Bookmarks.html) with explicit steps:- On iPhone/iPad open Safari and open the bookmark you want synced.
- Share it to Files (or copy links to Notes), then on Mac import them into Safari bookmarks.
- On Mac Safari:
File -> Export -> Bookmarks...and save asBookmarks.html. - Put
Bookmarks.htmlin your current working directory.
Firefox-only mode (no iOS file, useful for reclassifying new Firefox links):
export OPENAI_API_KEY="sk-..."
mkdir -p tmp
podman run --rm -it \
-e OPENAI_API_KEY \
-e BORG_OPENAI_JOBS=4 \
-v "$HOME/.mozilla/firefox/abcd.default-release:/firefox:Z" \
-v "$PWD/tmp:/tmp:Z" \
ghcr.io/alfanick/borgmarks:v0.7.10 organize \
--firefox-profile /firefox \
--skip-cacheMerged mode (Firefox + iOS input with equal priority):
export OPENAI_API_KEY="sk-..."
mkdir -p tmp
podman run --rm -it \
-e OPENAI_API_KEY \
-e BORG_OPENAI_JOBS=4 \
-v "$PWD/Bookmarks.html:/in/Bookmarks.html:Z" \
-v "$HOME/.mozilla/firefox/abcd.default-release:/firefox:Z" \
-v "$PWD/tmp:/tmp:Z" \
ghcr.io/alfanick/borgmarks:v0.7.10 organize \
--ios-html /in/Bookmarks.html \
--firefox-profile /firefox \
--skip-cacheResult files are written into Firefox profile:
/firefox/bookmarks.organized.html/firefox/bookmarks.organized.meta.jsonl/firefox/borg_cache.sqlite
This modifies bookmarks/folders/tags in places.sqlite (history is not touched):
podman run --rm -it \
-e OPENAI_API_KEY \
-e BORG_OPENAI_JOBS=4 \
-v "$PWD/Bookmarks.html:/in/Bookmarks.html:Z" \
-v "$HOME/.mozilla/firefox/abcd.default-release:/firefox:Z" \
-v "$PWD/tmp:/tmp:Z" \
ghcr.io/alfanick/borgmarks:v0.7.10 organize \
--ios-html /in/Bookmarks.html \
--firefox-profile /firefox \
--skip-cache \
--apply-firefoxplaces.sqlite backups are always created at begin/end in /tmp:
/tmp/borgmarks-places-begin-*.sqlite/tmp/borgmarks-places-end-*.sqlite
- Uses Firefox bookmarks as baseline input.
- Optionally merges iOS Safari export with equal priority.
- Deduplicates URLs (exact + near duplicates).
- Follows redirects and preserves link parity (excluding non-200 for sanity check).
- Classifies into folders + tags with OpenAI (conservative reclassification).
- Runs a dedicated tag pass over the whole tree (1-4 tags/link, max 50 global tags).
- Adds/keeps folder emojis and bookmark icons:
- favicon when available
- emoji icon fallback when favicon is missing
- Keeps cache in Firefox profile:
borg_cache.sqlite.
- Reuses cache aggressively unless
--skip-cacheis used. - Avoids moving bookmarks unless model has a strong reason.
- Reuses existing folders whenever possible.
- Keeps folder ordering deterministic and groups similar folders together.
- Sorts leaf links by freshness (newest first).
--skip-cache: rebuild cache from scratch.--no-fetch: skip website fetch.--no-openai: skip OpenAI classification.--no-folder-emoji: skip folder emoji enrichment for this run.--apply-firefox: write toplaces.sqlitebookmarks/tags/folders.--backup-firefox: extra profile backup in profile directory.--log-level DEBUG: verbose logs.
Env examples:
BORG_OPENAI_TIMEOUT_S=900BORG_OPENAI_RECLASSIFY=1BORG_OPENAI_AGENT_BROWSER=1(optional Agent/browser tool usage)BORG_OPENAI_REASONING_EFFORT=high
This project is licensed under the MIT License. See LICENSE.
- Whole coding is done via
gpt-5.3-thinking. - New features and bug reports are welcome via Issues.
- Issues are reviewed after maintainer moderation.
- Pull requests are not accepted.