Buku in action!

Introduction

buku is a powerful bookmark manager written in Python3 and SQLite3. When I started writing it, I couldn't find a flexible command-line solution with a private, portable, merge-able database along with seamless GUI integration. Hence, Buku (after my son's nickname, meaning close to the heart in my language).

bukuserver exposes a browsable front-end on a local web host server.

buku can auto-import bookmarks from your browser(s) or fetch the title and description of a bookmarked url from the web. You can use your favourite editor to compose and update bookmarks. With multiple search options, including regex and a deep scan mode (particularly for URLs), it can find any bookmark instantly. buku can look up the latest snapshot of a broken link on the Wayback Machine. There's an Easter egg to revisit random forgotten bookmarks too! Buku is too busy to track you: no hidden history, obsolete records, usage analytics or homing.

To get started right away, jump to the Quickstart section. We have one of the best documentation around. You'll find handy examples in the man page too. For more details, please refer to the wiki page on operational notes.

There are several projects based on buku, including a browser plug-in.

Love smart and efficient utilities? Explore my repositories. Buy me a cup of coffee if they help you.

Table of Contents

  • Installation
  • Usage
  • Troubleshooting

Features

  • Store bookmarks with auto-fetched title, tags and description
  • Auto-import from Firefox, Google Chrome and Chromium
  • Open bookmarks and search results in browser
  • Shorten, expand URLs, browse cached page from Wayback Machine
  • Text editor integration
  • Lightweight, clean interface, custom colors
  • Powerful search options (regex, substring..)
  • Continuous search with on the fly mode switch
  • Portable, merge-able database to sync between systems
  • Import/export bookmarks from/to HTML, Markdown or Orgfile
  • Smart tag management using redirection (>>, >, <<)
  • Multithreaded full DB refresh, manual encryption support
  • Shell completion scripts, man page with handy examples

Installation

Dependencies

FeatureDependency
Scripting languagePython 3.5+
HTTPScertifi, urllib3
Encryptioncryptography
HTMLbeautifulsoup4, html5lib

To install package dependencies using pip3, run:

or on Ubuntu:

To copy url to clipboard at the prompt Buku uses xsel (or xclip) on Linux, pbcopy (default installed) on OS X, clip (default installed) on Windows, termux-clipboard on Termux (terminal emulation for Android). If X11 is missing, GNU Screen or tmux copy-paste buffers are recognized.

From a package manager

  • Alpine Linux (apk add buku)
  • AUR (yay -S buku)
  • Debian (apt-get install buku)
  • Fedora (dnf install buku)
  • FreeBSD (pkg install www/py-buku)
  • Gentoo (emerge buku)
  • macOS/Homebrew (brew install buku)
  • macOS/MacPorts (port install buku)
  • NixOS (nix-env -i buku)
  • OpenBSD (pkg_add buku)
  • openSUSE (zypper in python3-buku)
  • PyPI (pip3 install buku)
  • Raspbian Testing (apt-get install buku)
  • Slackware (slackpkg install buku)
  • Termux (pip3 install buku)
  • Ubuntu (apt-get install buku)
  • Void Linux (xbps-install -S buku)

Release packages

Auto-generated packages (with only the cli component) for Arch Linux, CentOS, Debian, Fedora, openSUSE Leap and Ubuntu are available with the latest stable release.

NOTE: CentOS may not have the python3-beautifulsoup4 package in the repos. Install it using pip3.

From source

If you have git installed, clone this repository. Otherwise download the latest stable release or development version (risky).

Install the cli component to default location (/usr/local):

To remove, run:

PREFIX is supported, in case you want to install to a different location.

Running standalone

buku is a standalone utility. From the containing directory, run:

Shell completion

Shell completion scripts for Bash, Fish and Zsh can be found in respective subdirectories of auto-completion/. Please refer to your shell's manual for installation instructions.

Usage

Command-line options

Colors

buku supports custom colors. Visit the wiki page on how to customize colors for more details.

Quickstart

  1. Export VISUAL or EDITOR to point to your favourite editor. Note that VISUAL takes precedence over EDITOR.

  2. Create a sweeter shortcut with some convenience.

  3. Auto-import bookmarks from your browser(s). Please quit the relevant browsers beforehand to ensure the databases are not locked.

  4. Manually add a bookmark (for hands-on).

  5. List your bookmarks with DB index.

  6. For GUI and browser integration (or to sync bookmarks with your favourite bookmark management service) refer to the wiki page on System integration.

Examples

  1. Edit and add a bookmark from editor:

    The first command picks editor from the environment variable EDITOR. The second command opens gedit in blocking mode. The third command opens macvim with option -f and the URL and tags populated in template.

  2. Add a bookmark with tagssearch engine and privacy, commentSearch engine with perks, fetch page title from the web:

    where, >: url, +: comment, #: tags

  3. Add a bookmark with tags search engine & privacy and immutable custom titleDDG:

    Note that URL must precede tags.

  4. Add a bookmark without a title (works for update too):

  5. Edit and update a bookmark from editor:

    This will open the existing bookmark's details in the editor for modifications. Environment variable EDITOR must be set.

  6. Update existing bookmark at index 15012014 with new URL, tags and comments, fetch title from the web:

  7. Fetch and update only title for bookmark at 15012014:

    Watch Fairy Tail Episode 235 English Subbed & Dubbed Online at fairytailepisodes.org. Lucy Heartfilia,a 17-year old girl,wishes to become a full-fledged mage and join one of the most prestigious Mage Guilds in the world,Fairy Tail. Set in an imaginary world,the Earth Land,there exists a Mage Guild called “Fairy Tail”. Fairy Fairy Tail is stationed in the town Magnolia,residing in the Kingdom of Fiore,and is currently governed by Makarov,Guild’s master.

  8. Update only comment for bookmark at 15012014:

    Applies to --url, --title and --tag too.

  9. Export bookmarks tagged tag 1 or tag 2 to HTML, Markdown, Orgfile or a new database:

    All bookmarks are exported if search is not opted.

  10. Import bookmarks from HTML, Markdown or Orgfile:

  11. Delete only comment for bookmark at 15012014:

    Applies to --title and --tag too. URL cannot be deleted without deleting the bookmark.

  12. Update or refresh full DB with page titles from the web:

    This operation can update the title or description fields of non-immutable bookmarks by parsing the fetched page. Fields are updated only if the fetched fields are non-empty. Tags remain untouched.

  13. Delete bookmark at index 15012014:

    The last index is moved to the deleted index to keep the DB compact.

  14. Delete all bookmarks:

  15. Delete a range or list of bookmarks:

  16. Search bookmarks for ANY of the keywords kernel and debugging in URL, title or tags:

  17. Search bookmarks with ALL the keywords kernel and debugging in URL, title or tags:

  18. Search bookmarks taggedgeneral kernel concepts:

  19. Search for bookmarks matching ANY of the tags kernel, debugging, general kernel concepts:

  20. Search for bookmarks matching ALL of the tags kernel, debugging, general kernel concepts:

  21. Search for bookmarks matching any of the keywords hello or world, excluding the keywords real and life, matching both the tags kernel and debugging, but excluding the tags general kernel concepts and books:

  22. List all unique tags alphabetically:

  23. Run a search and update the results:

  24. Run a search and delete the results:

  25. Encrypt or decrypt DB with custom number of iterations (15) to generate key:

    The same number of iterations must be specified for one lock & unlock instance. Default is 8, if omitted.

  26. Show details of bookmarks at index 15012014 and ranges 20-30, 40-50:

  27. Show details of the last 10 bookmarks:

  28. Show all bookmarks with real index from database:

  29. Replace tag 'old tag' with 'new tag':

  30. Delete tag 'old tag' from DB:

  31. Append (or delete) tags 'tag 1', 'tag 2' to (or from) existing tags of bookmark at index 15012014:

  32. Open URL at index 15012014 in browser:

  33. List bookmarks with no title or tags for bookkeeping:

  34. List bookmarks with immutable title:

  35. Shorten URLwww.google.com and the URL at index 20:

  36. Append, remove tags at prompt (taglist index to the left, bookmark index to the right):

  37. List bookmarks with colored output:

  38. More help:

Automation

Interactive workflows can be automated using expect. Issue #368 has a working example on automating auto-import.

Troubleshooting

Editor integration

You may encounter issues with GUI editors which maintain only one instance by default and return immediately from other instances. Use the appropriate editor option to block the caller when a new document is opened. See issue #210 for gedit.

Collaborators

Copyright © 2015-2019 Arun Prakash Jana

Contributions

Missing a feature? There's a rolling ToDo List with identified tasks. Contributions are welcome! Please follow the PR guidelines.

Related projects

  • bukubrow, WebExtension for browser integration
  • oil, search-as-you-type cli front-end
  • buku_run, rofi front-end
  • pinku, a Pinboard-to-Buku import utility
  • buku-dmenu, a simple bash dmenu wrapper
  • poku, sync between Pocket and Buku

In the Press