{"id":15711210,"url":"https://github.com/rxw1/sbh","last_synced_at":"2025-10-08T18:18:09.329Z","repository":{"id":150510685,"uuid":"616574100","full_name":"rxw1/sbh","owner":"rxw1","description":"Session Buddy (Backup) Helper","archived":false,"fork":false,"pushed_at":"2023-04-04T01:32:57.000Z","size":61,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T18:39:13.386Z","etag":null,"topics":["backup","backup-utility","browser","browser-extension","extension-chrome","session-management","sessions"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rxw1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-20T16:47:28.000Z","updated_at":"2025-04-08T16:47:23.000Z","dependencies_parsed_at":"2023-04-27T04:45:33.665Z","dependency_job_id":null,"html_url":"https://github.com/rxw1/sbh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxw1%2Fsbh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxw1%2Fsbh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxw1%2Fsbh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxw1%2Fsbh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rxw1","download_url":"https://codeload.github.com/rxw1/sbh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253666079,"owners_count":21944621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","backup-utility","browser","browser-extension","extension-chrome","session-management","sessions"],"created_at":"2024-10-03T21:12:10.280Z","updated_at":"2025-10-08T18:18:09.279Z","avatar_url":"https://github.com/rxw1.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Session Buddy Helper\n====================\n\n**Command line tool to do various things with your Session Buddy database**\n\nWhat\n----\n\n[Session Buddy](https://sessionbuddy.com/) is a Google Chrome [extension](https://chrome.google.com/webstore/detail/session-buddy/edacconmaakjimmfgnblocblbcdcpbko) to store and restore browser tabs. All its data is stored in a SQLite3 database. There is a Google Group where some discussion about Session Buddy takes place and, it seems, people sometimes lose their data or are having problems exporting or importing their stuff. This utility aims to do various operations on that database and help out those in need.\n\nFeatures\n--------\n\n* **Backup:** Create a JSON file similar to what the extension would do. The produced output is not exactly the same, but should be viable to be imported into Session Buddy again.\n\n* **Import:** Import a backup file created by either the extension or this tool into a database.\n\n* **Search:** Search your disk for Session Buddy databases. Sometimes it's a little bit cumbersome to figure out the path to the extension's database, so this should make things easier.\n\n* **New:** Create a new and empty Session Buddy database. It will have the same schema as when created by the extension.\n\n* **Debug:** Try to figure out if something is wrong with a database or a backup file.\n\n* **Stats:** Print various stats about a database. Useful to figure out what happened after executing some other task on the database.\n\n* **Dump:** Print all links to stdout.\n\nCurrent State \u0026 Motivation\n--------------------------\n\nSo far it seems to work.\n\nOver the years I have aggregated multiple databases with in summary around 5,000 stored sessions consisting of around 15,000 windows and more than 130.0000 tabs. The extension would choke on exporting or just crash the extension or make the browser itself freeze. By doing all the stuff on the SQLite database itself, all that works.\n\nBut still, it may be not advisable to carry all your stuff around in a Chrome extension all the time. By scheduling regular backups and pruning operations on the database Session Buddy probably won't lose it and, you have convenient (and performant) access to all your data.\n\nIf you have any ideas or wishes regarding this tool or need help rescuing your thousands of tabs, feel free to reach out in the [discussions](https://github.com/rxw1/sbh/discussions).\n\nInstallation\n------------\n\n```\ncargo install sbh\n```\n\n```\ngit clone https://www.github.com/rxw1/sbh\ncd sbh\ncargo install --release .\n```\n\n```sh\ncurl -LSfs https://japaric.github.io/trust/install.sh |\\\n sh -s -- --git rxw/sbh\n```\n\nOr download precompiled packages from [here](http://www.github.com/rxw1/sbh/releases).\n\nUsage Examples\n--------------\n\n### Search for databases\n\nSearch for databases and print out the paths. By default, we're trying to figure out the proper path automatically depending on the operating system. For more information about these paths have a look at [dirs-rs](https://github.com/dirs-dev/dirs-rs).\n\n```\nsbh search\n```\n\nOr you can pass any path to search there:\n\n```\nsbh search ~/.config\n```\n\n### Backup a database to JSON\n\n```sh\nsbh backup -o whatever.json\n```\n\nIf you do not specify an output file, the produced JSON will be printed to the standard output.\n\n### Search and backup each found database to a timestamped file\n\n```sh\nfor db in \"$(sbh search)\"; do\n  o=sb-$(sbh id $db)-$(date +%Y%m%d%H%M%S).json\n  sbh backup -o $o $db\n  sbh validate backup $o\ndone\n```\n\n### Dump sort and count all URLs stored in a database\n\n```sh\nsbh search | while read -r l; do\n  sbh dump \"$l\" | grep -Ev 'chrome(|-.*)://' | sort | uniq -c | sort -g\ndone\n```\n\nTODO (Maybe)\n-----------\n\n* CSV export\n* Prune the database using certain criteria\n* Have config file to configure stuff\n* Handle `CurrentSession` and `PreviousSession` sessions\n\nIs it any good?\n---------------\n\nYes, of course. It is written in Rust, and it's blazingly fast.\n\nFindings\n--------\n\n* For whatever reason, the JSON backups produced by the extension have `\u003cfeff\u003e` as the first byte, i.e. a `BOM character` aka `Zero Width No-Break Space`, which breaks it for most parsers. I don't think having this in the beginning of a JSON file is a good thing. After removal, everything is fine. Here's some discussion about that on Stack Overflow: [https://stackoverflow.com/q/4990095/220472](https://stackoverflow.com/q/4990095/220472).\n\nDisclaimer\n----------\n\nNeither me or this tool is in any way affiliated with the developers of Session Buddy.\n\n--\n\n**https://github.com/rxw1/sbh**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxw1%2Fsbh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frxw1%2Fsbh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxw1%2Fsbh/lists"}