LinuxCommandLibrary

buku

Manage bookmarks from the command line

TLDR

Display all bookmarks matching "keyword" and with "privacy" tag

$ buku [keyword] [[-t|--stag]] [privacy]
copy

Add bookmark with tags "search engine" and "privacy"
$ buku [[-a|--add]] [https://example.com] [search engine], [privacy]
copy

Delete a bookmark
$ buku [[-d|--delete]] [bookmark_id]
copy

Open editor to edit a bookmark
$ buku [[-w|--write]] [bookmark_id]
copy

Remove "search engine" tag from a bookmark
$ buku [[-u|--update]] [bookmark_id] --tag - [search engine]
copy

SYNOPSIS

buku [options] [arguments]
Common usage examples:
buku -a <url> [tags] [description]
buku -s <search_terms...>
buku -l
buku -o <index>
buku -d <index>|<range>|<regex>

PARAMETERS

-a [tags] [description]
    Add a new bookmark. Tags are comma-separated. Description is optional.

-u [new_url] [new_tags] [new_description]
    Update an existing bookmark by index. Omitting fields preserves them.

-d ||
    Delete bookmark(s) by index, range (e.g., 1-5), or regex.

-s
    Search bookmarks by one or more terms. Case-insensitive by default.

-o
    Open the bookmark at the given index in your default web browser.

-l
    List all bookmarks. Use -l for filtered listing.

-m
    Print exact match search results only.

-p
    Print the database file path and exit.

-h
    Show the help message and exit.

-v
    Show program's version number and exit.

--immutable
    Do not modify the bookmark database. Useful for read-only operations.

--deep
    Perform a deep search including bookmark titles (fetched offline), URLs, tags, and descriptions.

--no-fetch
    Add bookmarks without fetching their titles from the web.

--import
    Import bookmarks from an HTML (Firefox/Chrome) or CSV file.

--export
    Export all bookmarks to an HTML or CSV file.

--encrypt
    Encrypt the bookmark database using AES256.

--decrypt
    Decrypt the bookmark database.

--toggle-private
    Toggle privacy mode for selected bookmarks (hides URL/title from public view).

--auto-update
    Automatically update fetched titles for all bookmarks.

--colors
    Force colored output.

--no-colors
    Disable colored output.

--prompt
    Prompt for password input for encryption/decryption.

--config
    Print path to the user configuration file.

--print-json
    Print search results in JSON format.

--print-url
    Print the URL of the specified bookmark index.

--yes
    Assume 'yes' to all prompts, useful for scripting.

--clipboard
    Copy URL to clipboard instead of opening browser.

--add-only-url
    When importing, only add URL and fetch title, ignore tags/description from file.

--tag-only-url
    When importing, use original tags only, ignore titles/descriptions from file.

DESCRIPTION

Buku is a free, open-source, powerful, and easy-to-use command-line utility for managing web bookmarks. Written in Python, it provides a simple yet comprehensive interface for storing, organizing, and retrieving your web links directly from the terminal.

It stands out with its capabilities for deep search (including regex and boolean logic), offline title fetching, and robust encryption of the bookmark database. Users can add, update, delete, and list bookmarks with associated tags and descriptions. Buku also supports importing and exporting bookmarks from/to HTML and CSV formats, making it versatile for integrating with other browsers or tools. Its lightweight nature and focus on privacy, along with features like auto-completion and an optional web interface (buku-html), make it an excellent choice for power users who prefer the command line.

CAVEATS

Buku stores its database in SQLite. Corruptions are rare but possible. Encryption requires the pypi-AES dependency, which might need separate installation. Fetching titles requires network access and the requests library. Regex search terms might require proper escaping depending on the shell. The buku-html web interface is a separate project and needs its own setup. The --encrypt / --decrypt options require a passphrase, which is not stored and must be remembered. Losing it means losing access to encrypted bookmarks.

DEFAULT DATABASE LOCATION

Buku stores its bookmarks in a SQLite database, typically located at ~/.local/share/buku/bookmarks.db or ~/.config/buku/bookmarks.db depending on the XDG Base Directory Specification.

CONFIGURATION

Users can customize buku's behavior via a configuration file, often found at ~/.config/buku/config.json. This file allows setting default options like opening browser, default search behavior, and colors.

WEB INTERFACE

A separate project, buku-html, provides a lightweight web interface for buku, allowing users to manage their bookmarks via a browser without leaving the buku backend.

CLIPBOARD INTEGRATION

Buku can be integrated with clipboard utilities like xclip or xsel to directly copy URLs to the clipboard using the --clipboard option, enhancing workflow efficiency.

HISTORY

Buku was created by Arun Prakash Jana and first released around 2015-2016. It gained popularity for its minimalist approach to bookmark management on the command line. Its development has been community-driven, with active contributions improving its features, such as advanced search capabilities, encryption, and import/export functionalities. It's written in Python, allowing for cross-platform compatibility. The project is hosted on GitHub and maintains a consistent release cycle addressing bugs and adding new features based on user feedback. It fills a niche for users who prefer terminal-based workflows over graphical browser bookmark managers.

SEE ALSO

grep(1), sed(1), awk(1), sqlite3(1), xclip(1)

Copied to clipboard