buku/buku.1

381 lines
11 KiB
Groff
Raw Normal View History

2016-07-14 11:23:36 -05:00
.TH "BUKU" "1" "Jul 2016" "Version 2.3" "User Commands"
.SH NAME
2016-06-22 09:48:22 -05:00
buku \- A powerful command-line bookmark manager. Your mini web!
.SH SYNOPSIS
2016-06-08 11:57:50 -05:00
.B buku [OPTIONS] [KEYWORD [KEYWORD ...]]
.SH DESCRIPTION
.B buku
is a command-line tool to save, tag and search bookmarks.
2016-04-19 13:57:58 -05:00
.SH OPERATIONAL NOTES
.PP
2016-04-24 09:37:51 -05:00
The SQLite3 database file is stored in:
2016-06-16 10:43:16 -05:00
- \fI$XDG_DATA_HOME/buku/bookmarks.db\fR, if XDG_DATA_HOME is defined (first preference) or
- \fI$HOME/.local/share/buku/bookmarks.db\fR, if HOME is defined (second preference) or
- the \fIcurrent directory\fR.
2016-04-24 09:37:51 -05:00
.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 <title></title> tags of HTML) from the web ONLY for fully-formed HTTP(S) URLs.
.PP
2016-06-28 12:51:19 -05:00
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 ('/").
.PP
URLs are unique in DB. The same URL cannot be added twice. You can update tags and re-fetch title data.
.PP
2016-06-16 10:43:16 -05:00
\fITags\fR:
- Comma (',') is the tag delimiter in DB. Any tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted.
.PP
2016-06-16 16:08:38 -05:00
\fIDelete\fR operation:
- When a record is deleted, the last record is moved to the index.
2016-06-17 00:25:24 -05:00
- 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.
2016-07-10 10:45:43 -05:00
- Can delete bookmarks matching a search, when combined with any of the search options.
2016-06-16 16:08:38 -05:00
.PP
2016-06-16 10:43:16 -05:00
\fIUpdate\fR 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.
.PP
2016-06-16 10:43:16 -05:00
\fISearch\fR works in mysterious ways:
2016-04-19 14:08:39 -05:00
- 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 \fBsubstrings\fR (`match` matches `rematched`) in URL, title and tags.
2016-05-18 12:23:08 -05:00
- --st : search bookmarks by tag, or show all tags alphabetically.
2016-06-06 12:26:12 -05:00
- 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.
.PP
2016-06-16 10:43:16 -05:00
\fIEncryption\fR 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 \fBunencrypted on creation\fR.
2016-04-22 12:01:17 -05:00
.SH GENERAL OPTIONS
.TP
.BI \-a " " \--add " URL [tags ...]"
Bookmark
.I URL
2016-05-18 22:24:46 -05:00
along with comma-separated tags. A tag can have multiple words.
.TP
.BI \-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).
2016-05-20 13:26:01 -05:00
.TP
2016-06-16 16:08:38 -05:00
.BI \-d " " \--delete " [...]"
2016-07-10 10:45:43 -05:00
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.
2016-05-20 13:46:44 -05:00
.TP
.BI \-h " " \--help
Show program help and exit.
.SH EDIT OPTIONS
.TP
2016-05-20 13:26:01 -05:00
.BI \--url " [...]"
Specify the URL, works with -u only. Fetches and updates title if --title is not used.
2016-05-20 13:26:01 -05:00
.TP
2016-07-03 16:50:44 -05:00
.BI \--tag " [+|-] [...]"
2016-07-11 12:18:40 -05:00
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.
.TP
.BI \-t " " \--title " [...]"
2016-05-17 15:11:31 -05:00
Manually specify the title, works with -a, -u. Omits or clears the title, if no arguments passed.
.TP
.BI \-c " " \--comment " [...]"
Add comment or description on the bookmark, works with -a, -u. Clears the comment, if no arguments passed.
.SH SEARCH OPTIONS
2016-04-22 12:01:17 -05:00
.TP
.BI \-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 '[]'.
.TP
.BI \-S " " \--sall " keyword [...]"
Search bookmarks with ALL keywords in URL, title or tags and show the results. Behaviour same as -s.
.br
2016-05-18 12:23:08 -05:00
Special keyword:
.br
"blank": list entries with empty title/tag
2016-05-18 11:06:54 -05:00
.TP
.BI \--deep
Search modifier to match substrings. Works with -s, -S.
.TP
2016-05-18 12:23:08 -05:00
.BI \--st " " \--stag " [...]"
Search bookmarks by tag. List all tags alphabetically, if no arguments.
.SH ENCRYPTION OPTIONS
2016-03-23 07:23:35 -05:00
.TP
.BI \-l " " \--lock " [N]"
Encrypt (lock) the DB file with
.I N
2016-06-28 12:51:19 -05:00
(> 0, default 8) hash passes to generate key.
.TP
.BI \-k " " \--unlock " [N]"
Decrypt (unlock) the DB file with
.I N
2016-06-28 12:51:19 -05:00
(> 0, default 8) hash passes to generate key.
.SH POWER OPTIONS
.TP
.BI \-p " " \--print " [N]"
Show details (URL, title and tags) of bookmark record stored at index
.I N
in DB. If
.I N
is omitted, all records with actual index from DB are shown.
.TP
.BI \-f " " \--format " N"
Show selective monochrome output. Works with -p. Useful for creating batch update scripts.
.br
.I N
= 1, only URL is shown.
.br
2016-04-20 10:09:18 -05:00
.I N
= 2, URL and tags are shown in a single line.
.TP
.BI \-r " " \--replace " oldtag [newtag ...]"
2016-04-22 12:01:17 -05:00
Replace
.I oldtag
with
.I newtag
if both are passed, delete
.I oldtag
if
.I newtag
is omitted.
.TP
2016-05-15 04:41:37 -05:00
.BI \-j " " \--json
2016-05-18 14:15:57 -05:00
Output data formatted as json, works with -p, -s, -S, --st.
.TP
.BI \-e " " \--export " file"
Export bookmarks to Firefox bookmarks formatted HTML.
.TP
.BI \-i " " \--import " file"
Import bookmarks exported from Firefox, Google Chrome or IE in HTML format.
.TP
.BI \-m " " \--merge " file"
2016-05-29 02:19:11 -05:00
Merge bookmarks from another Buku database file.
.TP
.BI \--noprompt
Do not show the prompt, run and exit.
.TP
.BI \-o " " \--open " N"
Open URL at DB index
.I N
in browser.
.TP
.BI \-z " " \--debug
Show debug information and additional logs.
2016-04-23 00:25:26 -05:00
.SH PROMPT KEYS
.TP
.BI "1-N"
Open
.I Nth
2016-09-05 03:18:21 -05:00
search result in browser. Multiple bookmarks are opened if ranges or space-separated result indices are specified.
2016-04-19 10:46:19 -05:00
.TP
2016-05-24 11:09:59 -05:00
.BI "double Enter"
2016-04-19 10:46:19 -05:00
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
2016-05-17 15:11:31 -05:00
\fBAdd\fR a bookmark with \fBtags\fR 'linux news' and 'open source', \fBcomment\fR 'Informative website on Linux and open source', \fBfetch page title\fR from the web:
2016-04-21 10:29:32 -05:00
.PP
.EX
.IP
2016-05-20 13:46:44 -05:00
.B buku -a https://tuxdiary.com linux news, open source -c Informative website on Linux and open source
In the output, >: title, +: comment, #: tags.
2016-04-21 10:29:32 -05:00
.PP
.IP 2. 4
\fBAdd\fR a bookmark with tags 'linux news' and 'open source' & \fBcustom title\fR 'Linux magazine':
.PP
.EX
.IP
.B buku -a http://tuxdiary.com linux news, open source -t 'Linux magazine'
.EE
.PP
.IP "" 4
Note that URL must precede tags.
.PP
2016-04-21 10:29:32 -05:00
.IP 3. 4
\fBAdd\fR a bookmark \fBwithout a title\fR (works for update too):
.PP
.EX
.IP
.B buku -a http://tuxdiary.com linux news, open source -t
.PP
2016-04-21 10:29:32 -05:00
.IP 4. 4
2016-05-20 13:46:44 -05:00
\fBUpdate\fR existing bookmark at index 15012014 with new URL, tags and comments, fetch title from the web:
.PP
.EX
.IP
2016-05-20 13:46:44 -05:00
.B buku -u 15012014 --url http://tuxdiary.com/ --tag linux news, open source, magazine -c site for Linux utilities
.PP
.IP 5. 4
\fBFetch and update only title\fR for bookmark at 15012014:
.PP
.EX
.IP
.B $ buku -u 15012014
.PP
.IP 6. 4
\fBUpdate only comment\fR for bookmark at 15012014:
.PP
.EX
.IP
.B buku -u 15012014 -c this is a new comment
.EE
.PP
.IP "" 4
2016-05-20 13:46:44 -05:00
Applies to --url, --title and --tag too.
.PP
2016-05-20 13:46:44 -05:00
.IP 7. 4
\fBImport\fR bookmarks:
.PP
.EX
.IP
.B buku -i bookmarks.html
.EE
.PP
.IP "" 4
HTML exports from Firefox, Google Chrome and IE are supported.
.PP
.IP 8. 4
2016-05-20 13:46:44 -05:00
\fBDelete only comment\fR for bookmark at 15012014:
.PP
.EX
.IP
.B buku -u 15012014 -c
.EE
.PP
.IP "" 4
Applies to --title and --tag too. URL cannot be deleted without deleting the bookmark.
.PP
.IP 9. 4
2016-04-21 10:37:11 -05:00
\fBUpdate\fR or refresh \fBfull DB\fR with page titles from the web:
.PP
.EX
.IP
.B buku -u
.EE
.PP
.IP "" 4
2016-05-20 13:26:01 -05:00
This operation does not modify the indexes, URLs, tags or comments. Only title is refreshed if fetched title is non-empty.
.PP
.IP 10. 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 11. 4
\fBDelete all\fR bookmarks:
.PP
.EX
.IP
.B buku -d
.PP
.IP 12. 4
2016-06-16 16:08:38 -05:00
\fBDelete\fR a \fBrange or list\fR of bookmarks:
.PP
.EX
.IP
.B $ buku -d 100-200 // delete bookmarks from index 100 to 200
.B $ buku 100 15 200 // delete bookmarks at indices 100, 15 and 200
.PP
.IP 13. 4
2016-05-01 03:55:32 -05:00
\fBSearch\fR bookmarks for \fBANY\fR of the keywords 'kernel' and 'debugging' in URL, title or tags:
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -s kernel debugging
.PP
2016-06-16 16:08:38 -05:00
.IP 14. 4
2016-05-01 03:55:32 -05:00
\fBSearch\fR bookmarks with \fBALL\fR the keywords 'kernel' and 'debugging' in URL, title or tags:
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -S kernel debugging
.PP
2016-06-16 16:08:38 -05:00
.IP 15. 4
2016-09-05 10:51:06 -05:00
\fBSearch\fR bookmarks \fBtagged\fR 'general kernel concepts':
.PP
.EX
.IP
2016-05-18 11:06:54 -05:00
.B buku --st general kernel concepts
.PP
2016-06-16 16:08:38 -05:00
.IP 16. 4
2016-05-01 03:55:32 -05:00
List \fBall unique tags\fR alphabetically:
.PP
.EX
.IP
2016-05-18 12:23:08 -05:00
.B buku --st
.PP
2016-06-16 16:08:38 -05:00
.IP 17. 4
2016-05-01 03:55:32 -05:00
\fBEncrypt or decrypt\fR DB with \fBcustom number of iterations\fR (15) to generate key:
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -l 15
.br
.B buku -k 15
.EE
.PP
.IP "" 4
2016-09-05 10:51:06 -05:00
The same number of iterations must be specified for one lock & unlock instance. Default is 8, if omitted.
.PP
2016-06-16 16:08:38 -05:00
.IP 18. 4
2016-05-01 03:55:32 -05:00
\fBShow details\fR of bookmark at index 15012014:
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -p 15012014
.PP
2016-06-16 16:08:38 -05:00
.IP 19. 4
2016-05-01 03:55:32 -05:00
\fBShow all\fR bookmarks with real index from database:
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -p
2016-05-03 12:52:36 -05:00
.B buku -p | more
.PP
2016-06-16 16:08:38 -05:00
.IP 20. 4
2016-05-01 03:55:32 -05:00
\fBReplace tag\fR 'old tag' with 'new tag':
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -r 'old tag' new tag
.PP
2016-06-16 16:08:38 -05:00
.IP 21. 4
2016-05-01 03:55:32 -05:00
\fBDelete tag\fR 'old tag' from DB:
2016-04-19 12:30:06 -05:00
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -r 'old tag'
.PP
2016-06-16 16:08:38 -05:00
.IP 22. 4
2016-07-11 12:18:40 -05:00
\fBAppend (or delete) tags\fR 'tag 1', 'tag 2' to (or from) existing tags of bookmark at index 15012014:
2016-06-12 05:48:10 -05:00
.PP
.EX
.IP
.B buku -u 15012014 --tag + tag 1, tag 2
2016-07-11 12:18:40 -05:00
.B buku -u 15012014 --tag - tag 1, tag 2
2016-06-12 05:48:10 -05:00
.PP
2016-06-16 16:08:38 -05:00
.IP 23. 4
2016-05-01 03:55:32 -05:00
\fBOpen URL\fR at index 15012014 in browser:
.PP
.EX
.IP
2016-05-01 03:55:32 -05:00
.B buku -o 15012014
.PP
2016-06-16 16:08:38 -05:00
.IP 24. 4
To list bookmarks with no title or tags for \fBbookkeeping\fR:
.PP
.EX
.IP
.B buku -S blank
.SH AUTHOR
Arun Prakash Jana <engineerarun@gmail.com>.
.SH HOME
2016-08-13 14:31:35 -05:00
.I https://github.com/jarun/Buku
.SH REPORTING BUGS
2016-08-13 14:31:35 -05:00
.I https://github.com/jarun/Buku/issues
2016-05-02 12:22:26 -05:00
.SH LICENSE
Copyright \(co 2015-2016 Arun Prakash Jana <engineerarun@gmail.com>.
.PP
2016-05-02 12:22:26 -05:00
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.