bookmark-organizer is a Python CLI for scanning, analyzing, planning, and safely reorganizing browser bookmarks.
It is built for an agent-friendly workflow:
- machine-readable JSON output
- deterministic
plan.json - backup before apply
- dry-run planning before any write
Most bookmark tools either dump everything into broad folders or require manual drag-and-drop. This project treats bookmark cleanup as an auditable workflow:
- discover candidate folders
- flatten the target subtree
- classify bookmarks into a taxonomy
- generate a reusable JSON plan
- apply only after review
The goal is not "auto sort everything blindly". The goal is a safe scan -> analyze -> plan -> apply contract that another agent or human can inspect before any local data is rewritten.
- Chrome bookmarks file support
- macOS, Windows, and Linux path discovery for Chrome profiles
- folder-level reorganization with custom taxonomy JSON
- backup-on-write safety model
- deterministic plan generation for review and reuse
python3 -m venv .venv
source .venv/bin/activate
pip install .If you want to run from source without installing:
PYTHONPATH=src python3 -m bookmark_organizer.cli scanReplace <folder-name> and <folder-id> with a folder discovered by bookmark-organizer scan. Do not copy the placeholders literally.
List top-level folders:
bookmark-organizer scan
bookmark-organizer scan --profile DefaultFlatten a target folder:
bookmark-organizer analyze --root-name "<folder-name>"
bookmark-organizer analyze --root-id <folder-id> --output /tmp/bookmarks.jsonGenerate a reviewable plan:
bookmark-organizer plan --root-name "<folder-name>" --output /tmp/plan.json
bookmark-organizer plan --root-name "<folder-name>" --taxonomy examples/default-taxonomy.json --include-debugValidate a plan before writing:
bookmark-organizer validate --plan-file /tmp/plan.jsonReview the intended moves:
bookmark-organizer diff --plan-file /tmp/plan.jsonApply a plan after review and with Chrome closed:
bookmark-organizer apply --plan-file /tmp/plan.jsonDiscover candidate bookmark folders and counts.
Flatten a target folder into bookmark rows so classification is based on actual content rather than old nested structure.
Generate a deterministic plan.json. This is the default dry run step and does not modify bookmarks.
Back up the browser bookmark file, validate the plan against current bookmark ids, and write the new folder structure.
Check whether a plan is still safe to apply against the current bookmark file. This catches stale plans, missing bookmark ids, duplicate assignments, and unmapped bookmarks before any write.
Show which bookmarks would move from the current top-level layout into the planned folders. This is the quickest review step before apply.
{
"target": { "id": "166", "name": "Research Links" },
"folder_specs": [
{ "id": "cat-01", "name": "01 SEO & Marketing" }
],
"plan": {
"cat-01": ["49", "196"]
}
}scanandanalyzeare read-onlyplanis read-onlyapplycreates a backup before writingapplyrefuses to run while Chrome is openapplyvalidates that the generated plan still matches current bookmark ids
Agents can treat the CLI as a four-step contract:
scanto discover candidate foldersanalyzeto flatten the selected targetplanto generateplan.jsonapplyonly after explicit confirmation
This makes the tool safe to automate from Codex, Claude Code, or shell scripts without inventing a custom protocol.
src/bookmark_organizer/ core CLI and bookmark operations
examples/ sample taxonomy and fixtures
tests/ regression tests for planner and CLI behavior
marketing/ launch copy and distribution drafts
media/ tracked README assets
.github/ issue templates, PR template, and CI
Run the built-in test suite:
python3 -m unittest discover -s tests -vCheck CLI help:
PYTHONPATH=src python3 -m bookmark_organizer.cli --help- Edge / Brave adapters
- runtime API fallback when browser sync rewrites file changes
- duplicate detection
- dead-link checks
- interactive TUI selection
See CONTRIBUTING.md for development workflow and issue expectations.
If you find a data-loss or unsafe-write issue, see SECURITY.md.
