.TH "BUKU" "1" "Apr 2016" "Version 1.9" "User Commands" .SH NAME buku \- A private cmdline bookmark manager. Your mini web! .SH SYNOPSIS .B buku .I OPTIONS .RI [ URL ] .RI [ TAGS ] .I [KEYWORDS ...] .SH DESCRIPTION .B buku is a command-line tool to save, tag and search bookmarks. .SH OPERATIONAL NOTES .PP The SQLite3 database file is stored in: - \fB$XDG_DATA_HOME/buku/bookmarks.db\fR, if XDG_DATA_HOME is defined (first preference) or - \fB$HOME/.local/share/buku/bookmarks.db\fR, if HOME is defined (second preference) or - the \fBcurrent directory\fR, e.g. on Windows. .PP Before version 1.9, .B buku stored its database in \fB$HOME/.cache/buku/bookmarks.db\fR. If the file exists, buku automatically moves it to new location. .PP The database index for entries starts from 1. Index 0 is used for special operations like show or refresh or delete all bookmarks. .PP 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 tags of HTML) from the web ONLY for fully-formed HTTP(S) URLs. .PP 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 ('/") qoutes. .PP The same URL cannot be added twice. You can update tags and re-fetch title data. You can also insert a new bookmark at a free index. .PP You can either add or update or delete record(s) in one instance. A combination of these operations is not supported in a single run. .PP Search works in mysterious ways: - Case-insensitive. - Substrings match ('match' matches 'rematched') for 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. - You can search bookmarks by tag (see example). - Search results are indexed serially. This index is different from actual database index of a bookmark record which is shown within '()' after the URL. .PP When a record is deleted, the last record is moved to the index. .PP AES256 is used for encryption. Optionally specify (-t) the number of hash iterations to use to generate key. Default is 8 iterations. .PP Encryption is optional and manual. 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. .SH GENERAL OPTIONS .TP .BI \-a " URL" " " "[tags]" Bookmark .I URL along with comma separated tags. A tag can have multiple words. The same URL cannot be added twice. .TP .BI \-d " N" Delete bookmark at index .I N in DB (from -p 0 output). The last record is moved to the removed index. .I N = 0 deletes all records from DB. .TP .B \-g List all unique tags sorted alphabetically. .TP .BI \-m " title" Manually specify the title, works with -a, -i, -u. `-m none` clears title. .TP .BI \-s " keywords" Search bookmarks for any of the keywords in URL, title or tags and show the results. Prompts to enter result number to open in browser. Note that the sequential index number may not match the real index in database. DB index is shown in the end within '()'. .TP .BI \-S " keywords" Search bookmarks with all keywords in URL, title or tags and show the results. Rest same as -s. .TP .BI \-u " N" " " "[URL]" " " "[tags]" Update fields of bookmark at index .I N in DB. The first keyword, if available, is treated as the URL. If URL is omitted (and -m is not used) the title of entry at index .I N is refreshed from the web, .I N = 0 refreshes all titles. .SH POWER OPTIONS .TP .B \-e Show all bookmarks with empty titles or no tags (for bookkeeping). .TP .BI \-i " N" Add a new record at free index .I N in DB. .TP .B \-j Output data formatted as json (works with -p and -s) .TP .B \-k Decrypt (unlock) the DB file. .TP .B \-l Encrypt (lock) the DB file. .TP .BI \-o " N" Open URL at DB index .I N in browser. .TP .BI \-p " N" Show details of bookmark record stored at index .I N in DB. .I N = 0 shows all records with actual index from DB. Shows URL, title and tags. .TP .BI \-r " oldtag" " " "[newtag]" Replace .I oldtag with .I newtag if both are passed, delete .I oldtag if .I newtag is omitted. .TP .BI \-t " N" Use .I N (> 0) hash iterations to generate key, works with -k, -l. .TP .BI \-x " N" Show selective monochrome output. Works with -p. If .I N = 1, only URL is shown. If .I N = 2, URL and tags are shown in a single line. Useful for creating batch update scripts. .TP .BI \-z Enable debugging. .TP .BI "" Any other option shows help and exits buku. .SH PROMPT KEYS .TP .BI "1-N" Open .I Nth search result in browser. .TP .BI "Enter" Exit buku. .SH ENVIRONMENT .TP .BI BROWSER Overrides the default browser. Ref: .I http://docs.python.org/library/webbrowser.html .SH EXAMPLES .PP .IP 1. 4 \fBAdd\fR a bookmark with \fBtags\fR 'linux news' and 'open source', \fBfetch page title\fR from the web: .PP .EX .IP .B buku -a http://tuxdiary.com linux news, open source .PP .IP 2. 4 \fBAdd\fR a bookmark with \fBmanual title\fR 'Linux magazine' & tags 'linux news' and 'open source': .PP .EX .IP .B buku -a -m 'Linux magazine' http://tuxdiary.com linux news, open source .EE .PP .IP "" 4 Note that URL must precede tags. Multiple words in title must be within quotes. The assigned automatic index 15012014 is unique, one greater than highest index already in use in database. .PP .IP 3. 4 \fBAdd\fR a bookmark \fBwithout a title\fR (works for update and insert too): .PP .EX .IP .B buku -a -m none http://tuxdiary.com linux news, open source .PP .IP 4. 4 \fBUpdate\fR existing bookmark at index 15012014 with new URL and tags, fetch title from the web: .PP .EX .IP .B buku -u 15012014 http://tuxdiary.com/ linux news, open source, magazine .EE .PP .IP "" 4 Tags are updated too. Original tags are removed. .PP .IP 5. 4 \fBUpdate\fR or refresh \fBfull DB\fR with page titles from the web: .PP .EX .IP .B buku -u 0 .EE .PP .IP "" 4 This operation does not modify the indexes, URLs or tags. Only titles, if non-empty, are refreshed. Any index other than 0 refreshes title for that index. .PP .IP 6. 4 \fBDelete\fR bookmark at index 15012014: .PP .EX .IP .B buku -d 15012014 .EE .PP .IP "" 4 The last index is moved to the deleted index to keep the DB compact. .PP .IP 7. 4 \fBDelete all\fR bookmarks: .PP .EX .IP .B buku -d 0 .PP .IP 8. 4 List \fBall unique tags\fR alphabetically: .PP .EX .IP .B buku -g .PP .IP 9. 4 \fBInsert\fR a bookmark at index 15012014 (fails if index or URL exists in database): .PP .EX .IP .B buku -i 15012014 http://tuxdiary.com/about linux news, open source .PP .IP 10. 4 \fBReplace a tag\fR with new one: .PP .EX .IP .B buku -r 'old tag' 'new tag' .PP .IP 11. 4 \fBDelete a tag\fR from DB: .PP .EX .IP .B buku -r 'old tag' .PP .IP 12. 4 \fBShow info\fR on bookmark at index 15012014: .PP .EX .IP .B buku -p 15012014 .PP .IP 13. 4 \fBShow all\fR bookmarks with real index from database: .PP .EX .IP .B buku -p 0 .PP .IP 14. 4 \fBOpen URL\fR at index 15012014 in browser: .PP .EX .IP .B buku -o 15012014 .PP .IP 15. 4 \fBSearch\fR bookmarks for \fBANY\fR of the keywords \fBkernel\fR and \fBdebugging\fR in URL, title or tags: .PP .EX .IP .B buku -s kernel debugging .PP .IP 16. 4 \fBSearch\fR bookmarks with \fBALL\fR the keywords \fBkernel\fR and \fBdebugging\fR in URL, title or tags: .PP .EX .IP .B buku -S kernel debugging .PP .IP 17. 4 \fBSearch\fR bookmarks tagged \fBgeneral kernel concepts\fR: .PP .EX .IP .B buku -S ',general kernel concepts,' .EE .PP .IP "" 4 Note the commas (,) before and after the tag. .PP .IP 18. 4 Encrypt/decrypt DB with \fBcustom number of iteration\fR to generate key: .PP .EX .IP .B buku -l -t 15 .PP .EX .IP .B buku -k -t 15 .EE .PP .IP "" 4 The same number of iterations must be used for one lock & unlock instance. .SH AUTHOR Written by Arun Prakash Jana . .SH HOME .I https://github.com/jarun/buku .SH REPORTING BUGS .I https://github.com/jarun/buku/issues .SH COPYRIGHT Copyright \(co 2015 Arun Prakash Jana . License GPLv3+: GNU GPL version 3 or later . .PP This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.