bogrep 0.1.5

Full-text search for bookmarks from multiple browsers
Documentation

Bogrep – Grep your bookmarks

Latest Version Build Status codecov

Bogrep downloads and caches your bookmarks in plaintext without images or videos. Use the Bogrep CLI to grep through your cached bookmarks in full-text search.

bogrep "reed-solomon code"

Bogrep mockup

Install Bogrep

Install Bogrep from crates.io

# Build and install bogrep binary to ~/.cargo/bin
cargo install bogrep

Install Bogrep from github.com

git clone git@github.com:quambene/bogrep.git
cd bogrep

# Build and install bogrep binary to ~/.cargo/bin
cargo install --path .

Usage

Settings and cache are installed to ~/.config/bogrep, after Bogrep has been run for the first time.

# Configure the path to the bookmarks file (e.g. of your browser)
bogrep config --source "my/path/to/bookmarks_file.json"

# Import bookmarks
bogrep import

# Fetch and cache bookmarks
bogrep fetch

# Search your bookmarks in full-text search
bogrep <pattern>

Getting help

# Check version
bogrep --version

# Print help
bogrep --help

# Print help for subcommands
bogrep config --help
bogrep import --help
bogrep fetch --help

Import bookmarks

Currently, bookmarks in JSON format for Firefox, Chrome, and Chromium are supported. Bookmark files in HTML format are not supported yet.

The path of bookmarks may be different for your operating system.

Firefox

Configure Firefox as source for bookmarks, where <my_profile> is your Firefox profile:

# Ubuntu (snap package)
bogrep config --source ~/snap/firefox/common/.mozilla/firefox/<my_profile>/bookmarkbackups

# Ubuntu (apt package)
bogrep config --source ~/.mozilla/firefox/<my_profile>/bookmarkbackups

# macOS
bogrep config --source ~/Library/Application Support/Firefox/Profiles/<my_profile>/bookmarkbackups

Directory bookmarkbackups contains multiple compressed backup files (in format .jsonlz4), and bogrep will choose the most recent bookmarks file.

Chrome

Configure Chrome as source for bookmarks:

# Ubuntu
bogrep config --source ~/.config/google-chrome/Default/Bookmarks

# macOS
bogrep config --source ~/Library/Application Support/Google/Chrome/Default/Bookmarks

Chromium

Configure Chromium as source for bookmarks:

# Ubuntu (snap package)
bogrep config --source ~/snap/chromium/common/chromium/Default/Bookmarks

Specify bookmark folders

Specify which bookmark folders are imported. Multiple folders are separated by comma:

bogrep config --source "my/path/to/bookmarks_file.json" --folders dev,science,articles

Ignore urls

Ignore specific urls. The content for these urls will not be fetched and cached.

It can be useful to ignore urls for video or music platforms which usually don't include relevant text to grep.

# Ignore one or more urls
bogrep ignore <url1> <url2> ...

Diff websites

Fetch difference between cached and fetched website for multiple urls, and display changes:

bogrep fetch --diff <url1> <url2> ...

Request throttling

Fetching of bookmarks from the same host is conservatively throttled, but can also be configured in the settings.json usually placed at ~/.config/bogrep in your home directory:

{
    "cache_mode": "text",
    "max_concurrent_requests": 100,
    "request_timeout": 60000,
    "request_throttling": 3000
}

where request_throttling is the waiting time between requests for the same host in milliseconds.

Supported operating systems

Bogrep assumes a configuration path at ~/.config/bogrep in your home directory for storing the settings.json, bookmarks.json, and cache folder. This should work for most Linux derivatives. Feel free to open an issue if you need support for Windows.

You can configure the configuration path via the environment variable BOGREP_HOME. For example,

BOGREP_HOME="my/config/path" bogrep config --source bookmarks.json

Testing

# Run unit tests
cargo test

# Run integration tests
cargo test --test '*' --features integration-test

# Run unit and integration tests
cargo test --features integration-test