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 [-h] [-a URL [TAG ...]] [-s QUERY] [-u [ID]] [-d ID] [-p] [-r [ID]] [-l [SEARCH]] [-S [SEARCH]] [-A [TAG]] [-R [TAG]] [-D [ID]] [-P] [-o [FMT]] [-f FMT] [-e [ID]] [-c] [-v] [-t TITLE] [-U URL] [-k] [-g [SEARCH]] [-i] [-B DB] [-n] [-z] [ID [ID ...]]

PARAMETERS

-h, --help
    Show help message and exit

-a URL [TAG ...], --add
    Add bookmark(s); auto-fetch title if omitted

-s QUERY, --ssearch
    Search bookmarks; fuzzy multi-term

-u [ID], --url
    Print URL(s) of bookmark(s)

-d ID, --delete
    Delete bookmark(s)

-p, --print
    Print bookmark index, title, URL, tags

-r [ID], --refresh
    Refresh title(s)

-l [SEARCH], --list
    List bookmarks (all or matching)

-A [TAG], --stag
    Add tag(s) to bookmark(s)

-R [TAG], --rtag
    Remove tag(s) from bookmark(s)

-D [ID], --dupe
    Show/print duplicate(s)

-P, --dpurge
    Purge duplicates keeping lowest index

-o [FMT], --open
    Open with browser; FMT='index|title|tags|url'

-f FMT, --format
    Custom print format string

-e [ID], --edit
    Edit bookmark(s) with $EDITOR

-c, --clear
    Clear screen before output

-v, --verbose
    Verbose output

-t TITLE, --ntitle
    Add bookmark with new title

-U URL, --nurl
    Edit URL(s)

-k, --lock
    Lock DB during operation

-g [SEARCH], --gsearch
    Print browser-searchable HTML

-i, --import
    Interactive add/search/import

-B DB, --db
    Custom database path

-n, --nounique
    Allow duplicate bookmarks

-z, --zenity
    Use zenity for browser integration

DESCRIPTION

Buku is a lightweight, fast command-line tool for managing bookmarks in the Linux shell.

It uses a single SQLite database file (default: ~/.local/share/buku/buku.db) to store URLs, titles, and tags, enabling efficient CRUD operations, fuzzy searches, and scripting.

Key features include: adding bookmarks with automatic title fetching via curl, multi-term fuzzy or regex searches, tagging/untagging, editing, deleting, listing with JSON/CSV export, browser integration for querying from Firefox/Chrome, and a companion buku-server for web UI.

Designed for power users, it supports bulk operations, duplicates detection, refresh titles, and customizable prompts. No GUI dependencies; pure Python 3 with optional python-Levenshtein for faster fuzzy search.

Ideal for terminal workflows, it integrates with shells, rifle, or rofi/dmenu for quick access. Search results show index, title, URL, and tags; open with xdg-open. Highly scriptable, extensible via hooks.

CAVEATS

Requires Python 3.6+ and sqlite3. Default DB locked during writes; use -k for concurrency. Fuzzy search slower without python-Levenshtein. Title fetching needs network/internet. Browser extensions need manual setup.

EXAMPLES

buku -a https://example.com work
Adds bookmark with tag 'work'.

buku 'linux kernel'
Searches fuzzy.

buku -p 42 | xdg-open
Opens bookmark #42.

CONFIGURATION

Edit ~/.config/buku/bukushell.json or ~/.local/share/buku/buku.conf for browser path, colors, format strings, hooks.

HISTORY

Created in 2016 by Alejandro 'ajr' Rodriguez as a personal shell bookmark tool. First release on GitHub; reached v4+ by 2020 with browser sync, server mode. Actively maintained; v5+ added JSON APIs, better fuzzy matching.

SEE ALSO

sqlite3(1), xdg-open(1), curl(1), rofi(1)

Copied to clipboard