BUKU(1)

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

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

DESCRIPTION
buku is a command-line tool to save, tag and search bookmarks.

OPERATIONAL NOTES

The SQLite3 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.

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 <title></title> tags of HTML) from the web ONLY for fully-formed HTTP(S) URLs.

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 ('/").

URLs are unique in DB. The same URL cannot be added twice. You can update tags and re-fetch title data.

Tags:
  - Comma (',') is the tag delimiter in DB. Any tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted.

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.

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 and --comment), read the URLs from DB and update titles from web.

Search works in mysterious ways:
  - Case-insensitive.
  - Matches exact words in URL, title and tags.
  - -s : match any of the keywords in URL, title or tags.
  - -S : match all the keywords in URL, title or tags.
  - --deep : match substrings (`match` matches `rematched`) in URL, title and tags.
  - --st : search bookmarks by tag, or show all tags alphabetically.
  - 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.

Encryption is optional and manual. AES256 algorithm is used. If you choose 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.

GENERAL OPTIONS

-a --add URL [tags ...]
    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).

-d --delete [...]
    Delete bookmarks. You can either provide a single hyphenated range (e.g. 100-200) or a space-separated list of indices (e.g. 5 6 23 4 110 45). 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 -u only. Fetches and updates title if --title is not used.

--tag [+|-] [...]
    Specify comma separated tags, works with -a, -u. 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 -a, -u. Omits or clears the title, if no arguments passed.

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

SEARCH OPTIONS

-s --sany keyword [...]
    Search bookmarks for 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 the end within '[]'.

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

--deep
    Search modifier to match substrings. Works with -s, -S.

--st --stag [...]
    Search bookmarks by tag. List all tags alphabetically, if no arguments.

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.

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

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

-p --print [N]
    Show details (URL, title and tags) of bookmark record stored at index N in DB. If N is omitted, all records with actual index from DB are shown.

-f --format N
    Show selective monochrome output. Works with -p. Useful for creating batch update scripts.
    N = 1, only URL is shown.
    N = 2, URL and tags are shown in a single line.

-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 -p, -s, -S, --st.

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

-o --open N
    Open URL at DB index N in browser.

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

PROMPT KEYS

1-N Open Nth search result in browser. Multiple bookmarks are opened if ranges or space-separated result indices are specified.

double Enter
    Exit buku.

ENVIRONMENT

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

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' & custom title 'Linux magazine':

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

    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.  Import bookmarks:

    buku -i bookmarks.html

    HTML exports from Firefox, Google Chrome and IE are supported.

8.  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.

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

    buku -u

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

10. Delete bookmark at index 15012014:

    buku -d 15012014

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

11. Delete all bookmarks:

    buku -d

12. Delete a range or list of bookmarks:

    $ buku -d 100-200 // delete bookmarks from index 100 to 200
    $ buku 100 15 200 // delete bookmarks at indices 100, 15 and 200

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

    buku -s kernel debugging

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

    buku -S kernel debugging

15. Search bookmarks tagged 'general kernel concepts':

    buku --st general kernel concepts

16. List all unique tags alphabetically:

    buku --st

17. 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.

18. Show details of bookmark at index 15012014:

    buku -p 15012014

19. Show all bookmarks with real index from database:

    buku -p
    buku -p | more

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

    buku -r 'old tag' new tag

21. Delete tag 'old tag' from DB:

    buku -r 'old tag'

22. 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

23. Open URL at index 15012014 in browser:

    buku -o 15012014

24. To list bookmarks with no title or tags for bookkeeping:

    buku -S blank

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.