# Buku ![Screenshot](http://i.imgur.com/UPKcSuN.png) `buku` is a powerful cmdline bookmark management utility written in Python3 and SQLite3. `buku` exists because of my monumental dependency on historious. I wanted the same database on my local system. However, I couldn't find an equally flexible cmdline solution. Hence, `Buku` (after my son's nickname). You can add bookmarks to `buku` with title and tags, optionally fetch page title from web, search by keywords for matching tags or title or URL, update and remove bookmarks, title or tags. You can open the URLs from search results directly in the browser. You can encrypt or decrypt the database file manually, optionally with custom number of hash passes for key generation. `buku` can also handle piped input, which lets you combine it with `xsel` (on Linux) and use a shortcut to add selected or copied text as bookmark without touching the terminal. Ref: [buku & xsel: add selected or copied URL as bookmark](http://tuxdiary.com/2016/03/26/buku-xsel/) The SQLite3 database file is stored in `$HOME/.local/share/buku/bookmarks.db` (or `$XDG_DATA_HOME/buku/bookmarks.db`, if XDG_DATA_HOME is defined) for each user. Before version 1.9, buku stored database in `$HOME/.cache/buku/bookmarks.db`. If the file exists, buku automatically moves it to new location. `buku` is **GPLv3** licensed. Copyright (C) 2015 [Arun Prakash Jana](mailto:engineerarun@gmail.com). Find `buku` useful? If you would like to donate, visit the [![Donate Button](https://img.shields.io/badge/paypal-donate-orange.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q) page. # Table of Contents - [Features](#features) - [Installation](#installation) - [Dependencies](#dependencies) - [Installing from this repository](#installing-from-this-repository) - [Running as a standalone utility](#running-as-a-standalone-utility) - [Installing with a package manager](#installing-with-a-package-manager) - [Usage](#usage) - [Cmdline options](#cmdline-options) - [Operational notes](#operational-notes) - [Examples](#examples) - [Bookkeeping](#bookkeeping) - [Contributions](#contributions) - [Developers](#developers) # Features - Add, update or remove a bookmark - Add tags to bookmarks - Manual password protection using AES256 encryption algorithm - Optionally fetch page title data from the web (default: disabled) - Add a custom page title manually - Use (partial) tags or keywords to search bookmarks - Any or all search keyword match options - Unique URLs to avoid duplicates, show index if URL already exists - Open bookmark in browser using index - Open search results in browser - Optional Json formatted output - Modify or delete tags in DB - Show all unique tags sorted alphabetically - Browser (Chromium and Firefox based) errors and warnings suppression - Show single bookmark by ID or all bookmarks in a go - Refresh all bookmarks online - Auto-compact DB on a single bookmark removal - Delete all bookmarks from DB - Show all bookmarks with empty titles or no tags (for bookkeeping) - Add a bookmark at Nth index, to fill deleted bookmark indices - Secure parameterized SQLite3 queries to access database - Supports HTTP compression - Handle multiple HTTP redirections (reports redirected URL, loops, IP blocking) - Unicode in URL works - UTF-8 request and response, page character set detection - Handle piped input - Coloured output for clarity - Easily create compatible batch add or update scripts - Unformatted selective output (for creating batch update scripts) - Manpage for quick reference - Optional debug information - Fast and clean (no ads or clutter) - Minimal dependencies - Open source and free # Installation ## Dependencies `buku` requires Python 3.x to work. For optional encryption support, install PyCrypto module. Run: $ sudo pip3 install pycrypto or on Ubuntu: $ sudo apt-get install python3-crypto ## Installing from this repository If you have git installed, run: $ git clone https://github.com/jarun/buku/ or download the latest [stable release](https://github.com/jarun/Buku/releases/latest) or [development version](https://github.com/jarun/buku/archive/master.zip). Install to default location: $ sudo make install or, a custom location (PREFIX): $ PREFIX=/path/to/prefix make install To remove, run: $ sudo make uninstall or, if you have installed to a custom location (PREFIX): $ PREFIX=/path/to/prefix make uninstall You may need to use `sudo` with `PREFIX` depending on your permissions on destination directory. ## Running as a standalone utility `buku` is a standalone utility. From the containing directory, run: $ ./buku ## Installing with a package manager `buku` is also available on - [AUR](https://aur.archlinux.org/packages/buku/) for Arch Linux; - Void Linux repos. $ sudo xbps-install -S buku - [Homebrew](http://braumeister.org/formula/buku) for OS X, or its Linux fork, [Linuxbrew](https://github.com/Linuxbrew/linuxbrew/blob/master/Library/Formula/buku.rb). # Usage ## Cmdline options Usage: buku OPTIONS [URL] [TAGS] [KEYWORDS ...] A private cmdline bookmark manager. Your mini web! General options -a URL [tags] add URL as bookmark with comma separated tags -d N delete entry at DB index N (from -P), move last entry to N -g list all tags alphabetically -m title manually specify the title, for -a, -i, -u -s keyword(s) search all bookmarks for a (partial) tag or any keyword -S keyword(s) search all bookmarks for a (partial) tag or all keywords -u N URL [tags] update all fields of entry at DB index N -w fetch title from web, for -a, -i, -u Power toys -D delete ALL bookmarks -e show bookmarks with empty titles or no tags -i N insert new bookmark at free DB index N -j show results in Json format -k decrypt (unlock) database file -l encrypt (lock) database file -o N open URL at DB index N in browser -p N show details of bookmark record at DB index N -P show all bookmarks along with index from DB -r oldtag [newtag] replace oldtag with newtag, delete oldtag if newtag empty -R refresh title from web for all bookmarks, update if non-empty -t N use N (> 0) hash iterations to generate key, for -k, -l -x N modify -P behaviour, N=1: show only URL, N=2: show URL and tag -z show debug information Keys 1-N open Nth search result in browser Enter exit buku ## Operational notes - It's advisable to copy URLs directly from the browser address bar, i.e., along with the leading `http://` or `https://` token. `buku` looks up title data (found within