BUKU(1)

πŸŽ€ buku(1) β€” User Commands πŸŽ€

okay bestie, sit down, hydrate, and let me tell you about buku β€” it's a manual page and it's a whole personality. πŸ’…


🌸 NAME 🌸

buku β€” Bookmark manager like a text-based mini-web πŸ’–


✨ SYNOPSIS ✨

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

like. that's it. that's the whole incantation. options then keywords, go off. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

buku is a command-line utility to store, tag, search and organize bookmarks. No browser extension, no account, no cloud, no nonsense β€” just you, your terminal, and a database that finally respects your organizational urges. ✨

πŸ‘‘ Features

  • Store bookmarks with auto-fetched title, tags and description πŸ”₯
  • Auto-import from Firefox, Google Chrome, Chromium, Vivaldi, Brave, and MS Edge
  • Open bookmarks and search results in browser
  • Browse cached page from the Wayback Machine πŸ•°οΈ
  • Text editor integration
  • Lightweight, clean interface, custom colors 🌈
  • Powerful search options (regex, substring...)
  • Continuous search with on the fly mode switch
  • Portable, merge-able database to sync between systems
  • Import/export bookmarks from/to HTML, XBEL, Markdown, RSS/Atom or Orgfile
  • Smart tag management using redirection (>>, >, <<) πŸ’…
  • Multi-threaded full DB refresh
  • Manual encryption support
  • Shell completion scripts, man page with handy examples
  • Privacy-aware (no unconfirmed user data collection) πŸ™ˆ
  • Can be used as a Python library 🐍
  • Has a compation Web-application (Bukuserver) with an HTTP-based API (for personal use only)
fr fr, that last one says "compation". that's what it says. we keep it. accuracy is the whole point. 🫢

πŸ“Œ OPERATIONAL NOTES πŸ“Œ

  1. The database file is stored in:
    • $BUKU_DEFAULT_DBDIR/bookmarks.db, if BUKU_DEFAULT_DBDIR is defined (first preference), or
    • $XDG_DATA_HOME/buku/bookmarks.db, if XDG_DATA_HOME is defined (second preference), or
    • $HOME/.local/share/buku/bookmarks.db, if HOME is defined (third preference), or
    • %APPDATA%\buku\bookmarks.db, if you are on Windows and APPDATA is defined (fourth preference), or
    • the current directory.

it checks them in that order and takes the first one that applies β€” no cap. πŸ‘‘

  1. 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 ('/ ").
bestie this is the classic "why did my terminal eat my URL" situation 😭 quote it and move on.
  1. URLs are unique in DB. The same URL cannot be added twice. periodt.
  2. Bookmarks with immutable titles are listed with (L) after the title. πŸ’€ that's your little locked-forever badge.
  3. 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.
    • Page keywords having a word to comma ratio > 3 are appended to description rather than tags.
    • Parent folder (and subfolder) names are converted to all-lowercase tags during bookmarks HTML import.
    • Releases prior to v2.7 support both capital and lower cases in tags. From v2.7 all tags are stored in lowercase. An undocumented option --fixtags is introduced to modify the older tags. It also fixes another issue where the same tag appears multiple times in the tagset of a record. Run buku --fixtags once.
    • Tags can be edited from the prompt very easily using >> (append), > (overwrite) and << (remove) symbols. The LHS of the operands denotes the indices and ranges of tags to apply (as listed by --tag or key t at prompt) and the RHS denotes the actual DB indices and ranges of the bookmarks to apply the change to.

tl;dr: left side = which tags, right side = which bookmarks. that's the whole redirect agenda. 🎯

  1. 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. Description is updated (if --comment is omitted). Tags remain untouched.
    • If indices are passed without any other options (--url, --title, --tag, --comment and --immutable), read the URLs from DB and update titles, description and append tags from web. Bookmarks marked immutable are skipped.
    • Can update bookmarks matching a search, when combined with any of the search options and no arguments to update are passed.
    • Additionally, --swap allows to modify records order (standalone operation).
  2. 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 and no arguments to delete are passed.
intentional. don't fight the design bestie, it's doing cardio for a reason. πŸ’ͺ
  1. Search works in mysterious ways:
    • Case-insensitive.
    • Matches words in URL, title and tags.
    • --sany : match any of the keywords in URL, title, description or tags. Default search option.
    • --sall : match all the keywords in URL, title, description or tags.
    • --deep : match substrings (match matches rematched) in URL, title, description and tags.
    • --markers : match each keyword to a specific field, depending on its prefix.
    • --sreg : match a regular expression (ignores --deep).
    • --stag : search bookmarks by tags, or list all tags alphabetically with usage count (if no arguments). Delimit the list of tags in the query with , to search for bookmarks that match ANY of the listed tags. Delimit tags with + to search for bookmarks that match ALL of the listed tags. Note that , and + cannot be used together in the same search. Exclude bookmarks matching certain tags from the results by using - followed by the tags. Note that the - operator and the + delimiter must be space separated: - instead of - and + instead of +. This is to distinguish them from hyphenated tags (e.g., some-tag-name) and tags with +s (e.g., some+tag+name).
    • Search for keywords along with tag filtering is possible. Two searches are issued (one for keywords and another for tags) and the intersection of the 2 sets is returned as the resultset.
    • Search results are indexed incrementally. This index is different from actual database index of a bookmark record which is shown within [] after the title.
    • Results for any keyword matches are ordered by the number of keyword matches - results matching more keywords (match score) will appear earlier in the list. Results having the same number of matches will be ranked by their record DB index. If only one keyword is searched, results will be ordered by DB index, since all matching records will have the same match score.
    • Sorting order can be specified (for matches with same amount of matched keywords, if relevant). This option also works with regular printing/export.

spaces matter here!! - and + with the spaces, otherwise you're just searching for a hyphenated tag like a normal person. iykyk. 🌈

  1. Import:
    • Auto-import looks in the default installation path and default user profile.
    • URLs starting with place:, file:// and apt: are ignored during import. πŸ™…
    • Parent folder (and subfolder) names are automatically imported as tags if --tacit is used.
    • Tags are merged even if bookmark URL exists when --tacit is used.
    • JSON files exported from browser can be imported. Export to JSON is not supported.
in only. JSON goes in, JSON does not come out. that's the deal. 🀝
  1. 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.
bestie the file is sitting wide open on your disk in that window. lock it back up when you're done. 🫢
  1. Editor support:
    • A single bookmark can be edited before adding. The editor can be set using the environment variable EDITOR or by explicitly specifying the editor. The latter takes precedence. If -a is used along with -w, the details are populated in the editor template.
    • In case of edit and update (a single bookmark), the existing record details are fetched from DB and populated in the editor template. The environment variable EDITOR must be set. Note that -u works independently of -w.
    • All lines beginning with # will be stripped. Then line 1 will be treated as the URL, line 2 will be the title, line 3 will be comma separated tags, and the rest of the lines will be parsed as descriptions.

✨ the template order is: URL, title, tags, then everything else as description. don't rearrange it, she's sensitive.

  1. Proxy support: please refer to the ENVIRONMENT section. 🧚
  2. Alternative DB file:
    • The option --db (to specify an alternative database file location) is app-only. Manual usage is prone to issues arising from human error.
    • Note that this option is useful if you want to store the db file in cloud synced location. Another mechanism could be to have the db file synced and create a symlink to it at the default location.
    • When the argument to --db contains neither . nor directory separator, it's considered a name and is resolved as the matching file with .db extension within the default DB directory.
    • When invoked specifically as buku --db, the program prints out the list of DB names in the default DB directory.
    • When running Bukuserver (webUI), alternative DB file can be specified via BUKUSERVER_DB_FILE environment variable. Additionally, the Bukuserver runner script supports switching between DB files within the default Buku DB folder.
    • In the interactive shell mode, the DB command can be used to similarly switch between DB files by name. (You can use non-standard extensions by specifying them, and switch directories by specifying a path – absolute or relative to the current DB. ~. stands for the default database.)

app-only, bestie. hand-editing this one is a human-error speedrun. ~. = the default database, cute little shorthand. πŸŽ€


✨ GENERAL OPTIONS ✨

Okay so, general vibes first, bestie. πŸ’–

  • -a, --add URL [+|-] [tag, ...] β€” bookmark URL along with comma-separated tags. A tag can literally have multiple words. πŸ’… These tags override fetched tags, unless preceded with + or -.
  • -u, --update [...] β€” update fields of the bookmarks at specified indices in DB. If no arguments are specified, all titles and descriptions are refreshed from the web. Tags remain untouched. Works with update modifiers for the fields url, title, tag and comment. If only indices are passed without any edit options, titles and descriptions are fetched and updated (if not empty). Accepts hyphenated ranges and space-separated indices. Updates search results when used with search options, if no arguments. slay ✨
  • -w, --write [editor|index] β€” edit a bookmark in editor before adding it. To edit and update an existing bookmark, the index should be passed. In this case the environment variable EDITOR must be set. The last record is opened in EDITOR if index=-1. πŸŽ€
  • -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, if no arguments. πŸ’€
  • --retain-order β€” when deleting bookmarks, shift indices of multiple records instead of replacing the deleted record with the last one. iconic 🫢
  • -v, --version β€” show program version and exit. ⭐
  • -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. πŸ’…
  • --title [...] β€” manually specify the title, works with --add, --update. Omits or clears the title, if no arguments passed. ✨
  • -c, --comment [...] β€” add notes or description of the bookmark, works with --add, --update. Clears the comment, if no arguments passed. πŸ’œ
  • --immutable N β€” set the title, description and tags of a bookmark immutable during autorefresh. Works with --add, --update. N=1 sets the immutable flag, N=0 removes it. If omitted, bookmarks are added with N=0. periodt πŸ‘‘
  • --swap N M β€” swap two records at specified indices. This is a standalone operation (cannot be invoked along with any other). πŸ™ˆ

πŸ’– 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 within [] after the title. This is the default search option for positional arguments if no other search option is specified. πŸ”
  • -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
  • --deep β€” search modifier to match substrings. Works with --sany, --sall. 🌊
  • --markers β€” search modifier to match specific fields based on (optional) prefix markers (i.e. beginning of the keyword):
    • . : search in title
    • > : search in description
    • : : search in URL
    • # : search in tags (comma-separated, partial matches; not affected by --deep)
      • #, : search in tags (comma-separated, exact matches; not affected by --deep)
    • * : search in all fields (same as no prefix)
  • -r, --sreg expression β€” scan for a regular expression match. 🧚
  • -t, --stag [tag [,|+] ...] [- tag, ...] β€” search bookmarks by tags.
    • Use , delimiter to find entries matching ANY of the tags
    • Use + delimiter to find entries matching ALL of the tags. (Note that the + delimiter must be space separated)
NOTE: Cannot combine , and + in the same search
  • Use - to exclude bookmarks that match the tags that follow. (Note that the - operator must be space separated).
  • List all tags alphabetically, if no arguments. The usage count (number of bookmarks having the tag) is shown within first brackets.
  • -x, --exclude keyword [...] β€” exclude bookmarks matching the specified keywords. Works with --sany, --sall, --sreg and --stag. πŸ’”
  • --random [N] β€” output random bookmarks out of the selection (1 unless amount is specified). 🎲
  • --order fields [...] β€” order printed/exported records by the given fields (from DB or JSON) and/or netloc. You can specify sort direction for each by prepending +/- (default is +). 🌈

πŸ” 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 πŸ‘‘

  • --ai β€” auto-import bookmarks from Firefox, Google Chrome, Chromium, Vivaldi, Brave, and MS Edge browsers. (Firefox profile can be specified using environment variable FIREFOX_PROFILE.) 🦊
  • -e, --export file β€” export bookmarks to Firefox bookmarks formatted HTML. Works with all search options. XBEL is used if file has extension .xbel. Markdown is used if file has extension .md. Markdown format: [title](url), 1 entry per line. Orgfile is used if file has extension .org Orgfile format: * [[url][title]], 1 entry per line. RSS is used if file has extension .rss/.atom RSS format: <entry> per bookmark with <title>, <link>, <category>, <content> elements A buku database is generated if file has extension .db. πŸ“¦
  • -i, --import file β€” import bookmarks from Firefox bookmarks formatted HTML. file is considered Firefox-exported JSON if it has .json extension, XBEL if it is .xbel, Markdown (compliant with --export format) if it is .md, Orgfile if the extension is .org, RSS if the extension is .rss/.atom or another buku database if the extension is .db. πŸ“₯
  • -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. A negative value (introduced for convenience) behaves like the tail utility, e.g., -n shows the details of the last n bookmarks. πŸ–¨οΈ
  • -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.
    • N = 4, show URL, title and tags in a single line.
    • N = 5, show title and tags in a single line. To omit DB index from printed results, use N0, e.g., 10, 20, 30, 40, 50.
  • -j, --json β€” output data formatted as JSON, works with --print output and search results. 🧾
  • --colors COLORS β€” set output colors. Refer to the COLORS section below for details. 🌈
  • --nc β€” disable color output in all messages. Useful on terminals which can't handle ANSI color codes or scripted environments. 🚫
  • -n, --count N β€” number of results to show per page (default 10). πŸ”’
  • --np β€” do not show the prompt, run and exit. πŸƒ
  • -o, --open [...] β€” open bookmarks by DB indices or ranges in browser. Open a random index if argument is omitted. 🌐
  • --oa β€” open all search results immediately in the browser. Works best with --np. When used along with --update or --delete, URLs are opened in the browser first and then modified or deleted. πŸš€
  • --default-scheme scheme β€” when opening a bookmark without a scheme in its URI, use this scheme (default http). πŸ”—
  • --replace old new β€” replace old tag with new tag if both are passed; delete old tag if new tag is not specified. πŸ”
  • --url-redirect β€” when fetching an URL, use the resulting URL from following permanent redirects (when combined with --export, the old URL is included as additional metadata). ↩️
  • --tag-redirect [tag] β€” when fetching an URL that causes permanent redirect, add a tag in specified pattern (using http:{} if not specified). 🏷️
  • --tag-error [tag] β€” when fetching an URL that causes an HTTP error, add a tag in specified pattern (using http:{} if not specified). ⚠️
  • --del-error [...] β€” when fetching an URL causes any (given) HTTP error, delete/do not add it. (Use a parameter like 404 or 400-404,500) πŸ—‘οΈ
  • --export-on [...] β€” export records affected by the above options, including removed info (requires --update and --export; specific HTTP response filter can be provided). πŸ“€
  • --reorder order... β€” update DB indices to match specified order (specified the same way as for --order). πŸ”„
  • --cached index|URL β€” browse the latest cached version of the URL at DB index or an independent URL using the Wayback Machine. Useful for viewing the content of bookmarks which are not live any more. πŸ•°οΈ
  • --offline β€” add a bookmark without connecting to the web. πŸ“΄
  • --suggest β€” show a list of similar tags to choose from when adding a new bookmark. πŸ’‘
  • --tacit β€” show lesser output. Reduces the verbosity of certain operations like add, update etc. 🀫
  • --nostdin β€” do not attempt to read data from standard input e.g. when the program is not executed from a tty. ⌨️
  • --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. 🧡
  • -V β€” 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. πŸ”Ž
  • -g, --debug β€” show debug information and additional logs. πŸ›

πŸŽ€ PROMPT KEYS πŸŽ€

okay bestie this is where buku gets FUN. once you're inside buku's prompt these are the keys that run the whole show πŸ’…

  • 1-N β€” browse your search results by indices and ranges. yes literally just type numbers, iconic.
  • O [id|range [...]] β€” try to open search results (or indices, when you're not in a search context) in a GUI browser. With no arguments it toggles try-to-open-urls in a GUI-based browser β€” even if BROWSER is set. and why do you care? because toggling is lowkey the move when you're trying to open bookmarks by DB index. πŸ–±οΈ
  • a β€” open ALL the search results in your browser. all of them. no thoughts, head empty, tabs everywhere.
  • s keyword [...] β€” search for records with ANY keyword.
  • S keyword [...] β€” search for records with ALL the keywords. capital letter, stricter vibes.
  • d β€” toggle deep search, so it matches substrings β€” like 'pen' matching 'opened'. sneaky but slay.
  • m β€” search with markers ✨ the search string gets split into keywords by prefix markers, and those markers decide which field each keyword gets searched in:
    • '.', '>' or ':' β€” title, description or URL
    • '#'/'#,' β€” tags (comma-separated, partial/full match)
    • '*' β€” all fields (can be omitted in the 1st keyword)
Note: the tag marker is not affected by d (deep search). fr fr.
  • v fields β€” change the sorting order (default is '+index'). you can stack multiple fields, comma- or space-separated.
  • v! fields β€” same energy but it actually updates the indices in the DB to match the order you specified. permanent. πŸ’€
  • r expression β€” run a regular expression search. regex girlies rise πŸ‘‘
  • t [...] β€” search bookmarks by a tag. if you give it no arguments it lists every tag, alphabetically.
  • g taglist id|range [...] [>>|>|<<] [record id|range ...] β€” append, set, or remove specific-or-all tags, by indices and/or ranges, to bookmark indices and/or ranges (peep the EXAMPLES section below for the tea β˜•). if records are omitted, it searches by space-separated taglist id(s) and/or range instead.
  • n β€” show the next page of search results.
  • N β€” show the previous page of search results. yes capital N, they're siblings.
  • o id|range [...] β€” browse bookmarks by indices and/or ranges.
  • p id|range [...] β€” print bookmarks by indices and/or ranges.
  • w [editor|id] β€” edit and add or update a bookmark.
  • c id β€” copy the url at that search result index to your clipboard. 🫢
  • DB [name] β€” with no name it shows you a list of available DBs (aka the files with a '.db' extension sitting in the folder of the current DB). with a name it switches you to that DB. you can drop the file extension ('.db' gets used), and you can hand it a path instead in order to switch a folder (if the path you picked is a folder, the default filename is assumed). if the DB file you named doesn't exist, it gets created. πŸ“
Note: you can use '~.' as a shortcut for the default DB.
  • ? β€” show help on prompt keys. when in doubt, ask the question mark.
  • q, ^D, double Enter β€” exit buku. three separate escape hatches, pick your fighter πŸšͺ

🌸 ENVIRONMENT 🌸

Completion scripts

Shell completion scripts for Bash, Fish and Zsh can be found in:

BROWSER

Overrides the default browser. Refer to:

EDITOR

If it's defined, it gets used as the editor for editing bookmarks with option --write. ✍️

https_proxy

If it's defined, it gets used to access http and https resources through the configured proxy. Supported format:

GUI integration

buku can be integrated into a GUI environment with simple tweaks. Please refer to:


🌈 COLORS 🌈

buku lets you customize the color scheme with a five-letter string, reminiscent of BSD LSCOLORS. and bestie those five letters represent the colors of:

  • index
  • title
  • URL
  • description/comment/note
  • tag

respectively. in that exact order, no swapping πŸ™…

That five-letter string gets passed as the argument to the --colors option, or you can hand it over as the value of the environment variable BUKU_COLORS. either way, same glow-up ✨

The colors/styles available are the ones the manual lays out.

The default colors string is oKlxm, which stands for:

  • bright cyan index
  • bold bright green title
  • bright yellow URL
  • normal description
  • bright blue tag

and now the fine print, because some terminals are messy:

  • Bright colors (implemented as \x1b[90m - \x1b[97m) may not be available in all color-capable terminal emulators;
  • Some terminal emulators draw bold text in bright colors instead;
  • Some terminal emulators only distinguish between bold and bright colors via a default-off switch.

Please consult the manual of your terminal emulator as well as:

for the details. πŸ’œ

✨ EXAMPLES ✨

Okay bestie, this is the part where it all clicks. Real commands, real outputs, no gatekeeping. Let's gooo 🫢


1. Editing and adding a bookmark straight from your editor:

buku -w
buku -w 'gedit -w'
buku -w 'macvim -f' -a https://ddg.gg search engine, privacy

Command one just yoinks the editor out of the EDITOR environment variable. Command two opens gedit in blocking mode. Command three opens macvim with the -f option, and your URL + tags are already sitting pretty in the template. Iconic πŸ’…

2. Adding a plain little bookmark:

buku --nostdin -a https://github.com/

In the output, > is your url, + is comment, and # is tags. That's the whole legend, memorize it fr.

3. Adding a bookmark with tags search engine and privacy, a comment Search engine with perks, and fetching the page title off the web:

buku -a https://ddg.gg search engine, privacy -c Search engine with perks

Again, output legend: > url, + comment, # tags. Same trio, every time.

4. Adding a bookmark with tags search engine & privacy plus an immutable custom title DDG:

buku -a https://ddg.gg search engine, privacy --title 'DDG' --immutable 1
Heads up bestie: the URL must come before the tags. Not negotiable, that's just how it vibes.

5. Adding a bookmark with no title at all (and yes, this works for update too):

buku -a https://ddg.gg search engine, privacy --title

6. Editing and updating a bookmark via the editor:

buku -w 15012014

This opens up that existing bookmark's details in your editor so you can change whatever you want. The environment variable EDITOR must be set β€” no editor, no party. πŸŽ€

7. Updating the bookmark at index 15012014 with a new URL, tags and comments, and fetching the title from the web:

buku -u 15012014 --url http://ddg.gg/ --tag web search, utilities -c Private search engine

8. Fetching and updating only the title for the bookmark at 15012014:

buku -u 15012014

9. Updating only the comment for the bookmark at 15012014:

buku -u 15012014 -c this is a new comment

This works the exact same way with --url, --title and --tag too. One field at a time, no drama.

10. Exporting bookmarks tagged tag 1 or tag 2 to HTML, XBEL, Markdown, Orgfile or a whole new database:

buku -e bookmarks.html --stag tag 1, tag 2
buku -e bookmarks.xbel --stag tag 1, tag 2
buku -e bookmarks.md --stag tag 1, tag 2
buku -e bookmarks.org --stag tag 1, tag 2
buku -e bookmarks.db --stag tag 1, tag 2

If you don't opt into any search, then all bookmarks get exported. All of them. The whole stash.

11. Importing bookmarks from HTML, XBEL, Markdown or Orgfile:

buku -i bookmarks.html
buku -i bookmarks.xbel
buku -i bookmarks.md
buku -i bookmarks.db

12. Deleting just the comment for the bookmark at 15012014:

buku -u 15012014 -c

Same deal applies to --title and --tag. But the URL? You can't delete that without deleting the whole bookmark. It's the load-bearing beam of the bookmark, soz. 😭

13. Updating or refreshing the entire DB with page titles from the web:

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

This can update the title or description fields of non-immutable bookmarks by parsing the fetched page. Fields only get updated if the fetched fields are non-empty β€” no blank overwrites here, we don't do that. Tags stay untouched, periodt.

14. Deleting the bookmark at index 15012014:

buku -d 15012014

The last index gets moved into the deleted index so the DB stays compact β€” it's giving tidy queen energy. Add --tacit to delete with zero confirmation.

15. Deleting all the bookmarks:

buku -d

16. Deleting a range or a list of bookmarks:

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

17. Searching bookmarks for ANY of the keywords kernel and debugging in URL, title or tags:

buku kernel debugging
buku -s kernel debugging

18. Searching bookmarks with ALL the keywords kernel and debugging in URL, title or tags:

buku -S kernel debugging

19. Searching for bookmarks tagged general kernel concepts:

buku --stag general kernel concepts

20. Searching for bookmarks matching ANY of the tags kernel, debugging, general kernel concepts:

buku --stag kernel, debugging, general kernel concepts

21. Searching for bookmarks matching ALL of the tags kernel, debugging, general kernel concepts:

buku --stag kernel + debugging + general kernel concepts

22. Searching for bookmarks matching any of the keywords hello or world, excluding the keywords real and life, matching both the tags kernel and debugging, but excluding the tags general kernel concepts and books:

buku hello world --exclude real life --stag 'kernel + debugging - general kernel concepts, books'

23. Searching for bookmarks with different tokens for each field, then printing them sorted by the tags (ascending) and URL (descending):

buku --order +tags,-url --markers --sall 'global substring' '.title substring' ':url substring' :https '> description substring' '#partial,tags:' '#,exact,tags' '*another global substring'

24. Listing all unique tags alphabetically:

buku --stag

25. Running a search and updating the results:

buku -s kernel debugging -u --tag + linux kernel

26. Running a search and deleting the results:

buku -s kernel debugging -d

27. Encrypting or decrypting the DB with a custom number of iterations (15) to generate the key:

buku -l 15
buku -k 15

For any one lock & unlock pair, you must specify the same number of iterations. Default is 8 if you just leave it out. Consistency is the vibe, bestie.

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

buku -p 20-30 15012014 40-50

29. Showing details of the last 10 bookmarks:

buku -p -10

30. Showing all bookmarks with their real index from the database:

buku -p
buku -p | more

31. Replacing tag old tag with new tag:

buku --replace 'old tag' 'new tag'

32. Deleting tag old tag from the DB:

buku --replace 'old tag'

33. Appending (or deleting) tags tag 1, tag 2 to (or from) the existing tags of the bookmark at index 15012014:

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

34. Opening the URL at index 15012014 in your browser:

buku -o 15012014

35. Listing bookmarks with no title or tags, just for bookkeeping:

buku -S blank

36. Listing bookmarks with an immutable title:

buku -S immutable

37. Appending and removing tags right at the prompt β€” taglist index on the left, bookmark index on the right, keep that straight:

// append tags at taglist indices 4 and 6-9 to existing tags in bookmarks at indices 5 and 2-3
buku (? for help) g 4 9-6 >> 5 3-2
// set tags at taglist indices 4 and 6-9 as tags in bookmarks at indices 5 and 2-3
buku (? for help) g 4 9-6 > 5 3-2
// remove all tags from bookmarks at indices 5 and 2-3
buku (? for help) g > 5 3-2
// remove tags at taglist indices 4 and 6-9 from tags in bookmarks at indices 5 and 2-3
buku (? for help) g 4 9-6 << 5 3-2

38. Listing bookmarks with colored output:

$ buku --colors oKlxm -p

aesthetic. πŸ’–

39. Adding a bookmark after following all permanent redirects, but only if the server doesn't respond with an error (and there's no network failure):

buku --add http://wikipedia.net --url-redirect --del-error
2. Wikipedia
   > https://www.wikipedia.org/
   + Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation.

40. Adding a bookmark tagged http redirect if the server responds with a permanent redirect, or tagged like http 404 on an error response:

buku --add http://wikipedia.net/notfound --tag-redirect 'http redirect' --tag-error 'http {}'
[ERROR] [404] Not Found
3. Not Found
   > http://wikipedia.net/notfound
   # http 404,http redirect

41. Updating all bookmarks matching the search β€” updating the URL if the server responds with a permanent redirect, deleting the bookmark if the server responds with HTTP error 400, 401, 402, 403, 404 or 500, or adding a tag shaped like http:{} for any other HTTP error β€” then exporting the affected ones into an HTML file, marking deleted records as well as old URLs for those replaced by a redirect:

buku -S ://wikipedia.net -u --url-redirect --tag-error --del-error 400-404,500 --export-on --export backup.html

42. Printing out a single random bookmark:

buku --random

43. Printing out 3 random bookmarks ordered by netloc (reversed), title and url:

buku --random 3 --order ,-netloc,title,+url

44. Printing out a single random bookmark matching the search criteria, and exporting it into a Markdown file (in DB order):

buku --random -S kernel debugging --export random.md

45. Swapping the positions of records #4 and #5:

buku --swap 4 5

46. Updating the indices in all bookmarks to match a specified order:

buku --reorder ,-netloc,title,+url

And that's the whole tour, bestie. 46 examples deep and every single one hits. 🌈


✨ AUTHOR ✨

Arun Prakash Jana <engineerarun@gmail.com> πŸ’œ

✨ HOME ✨

https://github.com/jarun/buku

✨ WIKI ✨

https://github.com/jarun/buku/wiki

✨ REPORTING BUGS ✨

https://github.com/jarun/buku/issues

Found a bug? Tell the maintainers, they're lovely about it, iykyk. 🫢

✨ LICENSE ✨

Copyright Β© 2015-2026 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. (Yes, that's the all-caps kind of no warranty, take it seriously bestie. πŸ’€)


And that's a wrap on BUKU(1) β€” this beauty is Version 5.1, dated 07 Dec 2025, and it's genuinely one of the most useful little tools in your terminal. Go bookmark something. Slay. πŸ‘‘πŸ¦‹πŸ’…

πŸ“¦ where this page comes from