BUKU(1)

NAME
buku - Powerful command-line bookmark manager. Your mini web!

SYNOPSIS
buku [OPTIONS] [KEYWORD [KEYWORD ...]]

DESCRIPTION
buku is a command-line utility to store, tag, search and organize bookmarks.

Features

  * Add, open, tag, comment on, update, remove, shorten URLs
  * Fetch page title from web, refresh all titles in a go
  * Multiple search options, continuous search at prompt
  * Portable merge-able database to sync between systems
  * Import/export in Markdown or HTML (FF, Chrome compatible)
  * Open (multiple) search results directly in default browser
  * Manual password protection using AES256 encryption
  * Completion scripts (Bash, Fish, Zsh), man page with examples
  * Several options for power users (see help or man page)
  * Fast and clean interface, distinct symbols for record fields
  * Minimal dependencies

OPERATIONAL NOTES

1.  The database file is stored in:
      - $XDG_DATA_HOME/buku/bookmarks.db, if XDG_DATA_HOME is defined (first preference) or
      - $HOME/.local/share/buku/bookmarks.db, if HOME is defined (second preference) or
      - the current directory.

2.  If the URL contains characters like ';', '&' or brackets they may be interpreted specially by the shell. To avoid it, add the URL within single or double quotes ('/").

3.  URLs are unique in DB. The same URL cannot be added twice.

4.  Bookmarks with immutable titles are listed with bold '(L)' after the URL.

5.  Tags:
      - Comma (',') is the tag delimiter in DB. A tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted. Tags are stored in lower case and can be replaced, appended or deleted.

6.  Update operation:
      - If --title, --tag or --comment is passed without argument, clear the corresponding field from DB.
      - If --url is passed (and --title is omitted), update the title from web using the URL.
      - If indices are passed without any other options (--url, --title, --tag, --comment and --immutable), read the URLs from DB and update titles from web. Bookmarks marked immutable are skipped.

7.  Delete operation:
      - When a record is deleted, the last record is moved to the index.
      - Delete doesn't work with range and indices provided together as arguments. It's an intentional decision to avoid extra sorting, in-range checks and to keep the auto-DB compaction functionality intact. On the same lines, indices are deleted in descending order.
      - Can delete bookmarks matching a search, when combined with any of the search options.

8.  Search works in mysterious ways:
      - Case-insensitive.
      - Matches words in URL, title and tags.
      - --sany : match any of the keywords in URL, title or tags.
      - --sall : match all the keywords in URL, title or tags.
      - --deep : match substrings (`match` matches `rematched`) in URL, title and tags.
      - --sreg : match a regular expression (ignores --deep).
      - --stag : search bookmarks by a tag, or list all tags alphabetically with usage count (if no arguments).
      - Search results are indexed serially. This index is different from actual database index of a bookmark record which is shown in bold within '[]' after the URL.

9.  Encryption is optional and manual. AES256 algorithm is used. To use encryption, the database file should be unlocked (-k) before using buku and locked (-l) afterwards. Between these 2 operations, the database file lies unencrypted on the disk, and NOT in memory. Also, note that the database file is unencrypted on creation.

10. Proxy support: please refer to the ENVIRONMENT section.

GENERAL OPTIONS

-a --add URL [tag, ...]
    Bookmark URL along with comma-separated tags. A tag can have multiple words.

-u --update [...]
    Update fields of the bookmarks at specified indices in DB. If no arguments are specified, all titles are refreshed from the web. Works with update modifiers for the fields url, title, tag and comment. If only indices are passed without any edit options, titles are fetched and updated (if not empty). Accepts hyphenated ranges and space-separated indices.

-d --delete [...]
    Delete bookmarks. Accepts space-separated list of indices (e.g. 5 6 23 4 110 45) or a single hyphenated range (e.g. 100-200). Note that range and list don't work together. Deletes search results when combined with search options.

-h --help
    Show program help and exit.

EDIT OPTIONS

--url [...]
    Specify the URL, works with --update only. Fetches and updates title if --title is not used.

--tag [+|-] [...]
    Specify comma separated tags, works with --add, --update. Clears the tags, if no arguments passed. Appends or deletes tags, if list of tags is preceded by '+' or '-' respectively.

-t --title [...]
    Manually specify the title, works with --add, --update. Omits or clears the title, if no arguments passed.

-c --comment [...]
    Add comment or description on the bookmark, works with --add, --update. Clears the comment, if no arguments passed.

--immutable N
    Set the title of a bookmark immutable during updates. Works with --add, --update. N=1 sets the immutable flag, N=0 removes it. If omitted, bookmarks are added with N=0.

SEARCH OPTIONS

-s --sany keyword [...]
    Search bookmarks with ANY of the keyword(s) in URL, title or tags and show the results. Prompts to enter result number to open in browser. Note that the sequential result index is not the DB index. The DB index is shown in bold within '[]' after the URL.

-S --sall keyword [...]
    Search bookmarks with ALL keywords in URL, title or tags and show the results. Behaviour same as --sany.
    Special keywords:
    "blank": list entries with empty title/tag
    "immutable": list entries with locked title
    NOTE: To search the keywords, use --sany

--sreg expression
    Scan for a regular expression match.

--deep
    Search modifier to match substrings. Works with --sany, --sall.

--stag [...]
    Search bookmarks by a tag. List all tags alphabetically, if no arguments. The usage count (number of bookmarks having the tag) is shown within first brackets.

ENCRYPTION OPTIONS

-l --lock [N]
    Encrypt (lock) the DB file with N (> 0, default 8) hash passes to generate key.

-k --unlock [N]
    Decrypt (unlock) the DB file with N (> 0, default 8) hash passes to generate key.

POWER OPTIONS

-e --export file
    Export bookmarks to Firefox bookmarks formatted HTML. Works with --tag to export only specific tags.

-i --import file
    Import bookmarks exported from Firefox or Google Chrome in HTML format.

--markdown
    Use markdown for --export and --import. Supported format is '[title](url)', one entry per line.

-m --merge file
    Add bookmarks from another Buku database file.

-p --print [...]
    Show details (DB index, URL, title, tags and comment) of bookmark record by DB index. If no arguments, all records with actual index from DB are shown. Accepts hyphenated ranges and space-separated indices.

-f --format N
    Show selective monochrome output with specific fields. Works with --print. Search results honour the option when used along with --json. Useful for creating batch scripts.
    N = 1, show only URL.
    N = 2, show URL and tags in a single line.
    N = 3, show only title.

-r --replace oldtag [newtag ...]
    Replace oldtag with newtag if both are passed; delete oldtag if newtag is omitted.

-j --json
    Output data formatted as json, works with --print output and search results.

--noprompt
    Do not show the prompt, run and exit.

-o --open [N]
    Open URL at DB index N in browser. Open a random index if N is omitted.

--shorten N/URL
    Shorten the URL at DB index N or an independent URL using the tny.im URL shortener service.

--tacit
    Show lesser output. Reduces the verbosity of certain operations like add, update etc.

--threads
    Maximum number of parallel network connection threads to use during full DB refresh. By default 4 connections are spawned. N can range from 1 to 10.

--upstream
    Check the latest upstream version available. This is FYI. It is possible the latest upstream released version is still not available in your package manager as the process takes a while.

-z --debug
    Show debug information and additional logs.

PROMPT KEYS

1-N Browse search results by indices and ranges.

a   Open all search results in browser.

s keyword [...]
    Search for records with ANY keyword.

S keyword [...]
    Search for records with ALL keywords.

d   Toggle deep search to match substrings ('pen' matches 'opened').

r expression
    Run a regular expression search.

t [...]
    Search bookmarks by a tag. List all tags alphabetically, if no arguments. The index of a tag from the tag list can be used to search all bookmarks having the tag. Note that multiple indices and/or ranges do not work in this case.

?   Show help on prompt keys.

q, ^D, double Enter
    Exit buku.

ENVIRONMENT

BROWSER
    Overrides the default browser. Refer to:
    http://docs.python.org/library/webbrowser.html

https_proxy
    If defined, will be used to access http and https resources through the configured proxy. Supported format:
        http[s]://[username:password@]proxyhost:proxyport/

GUI integration
    buku can be integrated in a GUI environment with simple tweaks. Refer to:
    https://github.com/jarun/Buku#gui-integration

EXAMPLES

1.  Add a bookmark with tags 'linux news' and 'open source', comment 'Informative website on Linux and open source', fetch page title from the web:

    buku -a https://tuxdiary.com linux news, open source -c Informative website on Linux and open source
    In the output, >: title, +: comment, #: tags.

2.  Add a bookmark with tags 'linux news' and 'open source' & immutable custom title 'Linux magazine':

    buku -a http://tuxdiary.com linux news, open source -t 'Linux magazine' --immutable 1

    Note that URL must precede tags.

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

    buku -a http://tuxdiary.com linux news, open source -t

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

    buku -u 15012014 --url http://tuxdiary.com/ --tag linux news, open source, magazine -c site for Linux utilities

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

    $ buku -u 15012014

6.  Update only comment for bookmark at 15012014:

    buku -u 15012014 -c this is a new comment

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

7.  Export bookmarks tagged 'tag 1' or 'tag 2' to HTML and markdown:

    buku -e bookmarks.html --tag tag 1, tag 2
    buku -e bookmarks.md --markdown --tag tag 1, tag 2

    All bookmarks are exported if --tag is not specified.

8.  Import bookmarks from HTML and markdown:

    buku -i bookmarks.html
    buku -i bookmarks.md --markdown

9.  Delete only comment for bookmark at 15012014:

    buku -u 15012014 -c

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

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

    buku -u
    buku -u --tacit (show only failures and exceptions)

    This operation does not modify the indexes, URLs, tags or comments. Only title is refreshed if fetched title is non-empty.

11. Delete bookmark at index 15012014:

    buku -d 15012014

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

12. Delete all bookmarks:

    buku -d

13. Delete a range or list of bookmarks:

    $ buku -d 100-200
    $ buku -d 100 15 200

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

    buku -s kernel debugging

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

    buku -S kernel debugging

16. Search bookmarks tagged 'general kernel concepts':

    buku --stag general kernel concepts

17. List all unique tags alphabetically:

    buku --stag

18. Run a search and delete the results:

    buku -s kernel debugging -d

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

    buku -l 15
    buku -k 15

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

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

    buku -p 20-30 15012014 40-50

21. Show all bookmarks with real index from database:

    buku -p
    buku -p | more

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

    buku -r 'old tag' new tag

23. Delete tag 'old tag' from DB:

    buku -r 'old tag'

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

    buku -u 15012014 --tag + tag 1, tag 2
    buku -u 15012014 --tag - tag 1, tag 2

25. Open URL at index 15012014 in browser:

    buku -o 15012014

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

    buku -S blank

27. List bookmarks with immutable title:

    buku -S immutable

28. Shorten the URL www.google.com and the URL at index 20:

    buku --shorten www.google.com
    buku --shorten 20

AUTHOR
Arun Prakash Jana <engineerarun@gmail.com>.

HOME
https://github.com/jarun/Buku

REPORTING BUGS
https://github.com/jarun/Buku/issues

LICENSE
Copyright © 2015-2016 Arun Prakash Jana <engineerarun@gmail.com>.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.