bm

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: MIT

README

bm

release build

Terminal bookmark manager with vim keybindings. Folders, fuzzy search, copy to clipboard — all in a single YAML file you can keep in your dotfiles, private repo, or self-hosted server.

bm showing the example bookmark tree

Installation

With Homebrew (macOS):

brew install bopeng95/tap/bm

With Go:

go install github.com/bopeng95/bm/cmd/bm@latest

Prebuilt binaries are on the releases page.

A Nerd Font is recommended for the icons; --ascii works without one.

Usage

Run bm. If you know vim you already know your way around — motions, counts, / to fuzzy-search, : for commands. A few things worth knowing:

  • a adds: a trailing slash makes a folder (docs/), and paths nest (work/go/GitHub creates the folders in between).
  • Enter copies the bookmark's URL — it works even over SSH via OSC 52. Set open_in_browser: true to open it in the browser instead.
  • Edits stay in memory until you save with :w.
  • The mouse works: wheel scrolls, click selects, click again toggles.

Press ? inside bm for the full keybinding list, settings, and themes.

Commands
Command
:w save
:wq, :x save and quit
:q, :q! quit; ! skips the unsaved-changes prompt
:sort, :sort all sort the current folder / every folder
:fold, :unfold collapse / expand all folders
:theme <name> switch themes (see Themes)
:set <key> <value> change a setting (see Configuration)
CLI flags
Flag
--file <path> use another bookmarks file (settings.file_location makes it persistent)
--theme <name> theme for this run only
--ascii plain ASCII icons
--import <file> import a browser's bookmarks HTML export
--export export as browser-importable HTML
--out <dir> output directory for --import/--export

Configuration

Bookmarks live in ~/.config/bm/bookmarks.yaml (or under $XDG_CONFIG_HOME) — plain YAML you can edit by hand:

version: 1
folders:
  - name: "dev"
    bookmarks:
      - name: "GitHub"
        url: "https://github.com"
bookmarks:
  - name: "Hacker News"
    url: "https://news.ycombinator.com"

For a fuller starting point, copy examples/bookmarks.yaml (the tree in the screenshot above).

Hand-edit freely: broken entries are kept and flagged rather than dropped, saves are atomic, and bm never writes a file it can't read back. And because a bookmarks file may come from someone else, bm treats it as untrusted — escape sequences are stripped, only http(s) URLs will open, and YAML aliases (*a) are refused outright.

Settings live in a separate ~/.config/bm/config.yaml; most can also be changed in-app (? or :set):

settings:
  line_numbers: true # show line numbers in the tree
  open_in_browser: false # Enter opens the URL in the browser instead of copying it
  confirm_open: true # confirm before opening in the browser (with open_in_browser)
  confirm_sort_all: true # confirm before :sort all
  display_url: true # show each bookmark's URL next to its name
  mouse: true # wheel scrolls, click selects; off restores plain drag-to-select
  name_truncate: 50 # cut names at this many columns; 0 = window edge
  max_indent: 0 # maximum visible nesting levels; zero means unlimited
  path_segments: 3 # trailing path segments shown in the header; 0 = full path
  theme: "" # a built-in theme name; empty = terminal colors
  file_location: "" # default bookmarks file; empty = the path above
ascii:
  enabled: false # plain ASCII icons instead of Nerd Font glyphs
  bookmark: "-"
  folder_closed: ">"
  folder_open: "v"

Import & export

Every browser reads and writes the same bookmarks HTML format:

bm --import path/to/bookmarks.html   # → ~/.config/bm/imports/<source>-<time>.yaml
bm --export                          # → ./<source>-<time>.html

An import never touches your current bookmarks — it writes a fresh file, which you open with bm --file. Only http(s) URLs are imported; anything skipped is listed.

Themes

By default bm uses only the 16 ANSI colors, so it matches your terminal's theme. 17 truecolor themes ship built in:

catppuccin-frappe · catppuccin-latte · catppuccin-macchiato · catppuccin-mocha · tokyonight-night · tokyonight-storm · tokyonight-moon · kanagawa-wave · kanagawa-dragon · gruvbox · everforest · rose-pine · rose-pine-moon · nord · onedark · dracula · solarized

Pick one with :theme <name>, the --theme flag, or settings.theme; :theme default returns to your terminal's colors.

License

MIT.

Directories

Path Synopsis
cmd
bm command
internal
model
Package model holds the bookmark tree domain types and operations.
Package model holds the bookmark tree domain types and operations.
netscape
Package netscape reads and writes the Netscape bookmark file format — the HTML file every browser writes from "export bookmarks", and the only interchange format they all agree on.
Package netscape reads and writes the Netscape bookmark file format — the HTML file every browser writes from "export bookmarks", and the only interchange format they all agree on.
open
Package open launches URLs in the user's browser without disturbing the TUI: children are detached and their output discarded.
Package open launches URLs in the user's browser without disturbing the TUI: children are detached and their output discarded.
storage
Package storage loads and saves the bookmarks file.
Package storage loads and saves the bookmarks file.
theme
Package theme defines the color palettes bm can render with.
Package theme defines the color palettes bm can render with.
tui
Package tui implements the bm terminal UI: a vim-keybound tree of folders and bookmarks backed by internal/model and internal/storage.
Package tui implements the bm terminal UI: a vim-keybound tree of folders and bookmarks backed by internal/model and internal/storage.
tools
siteicons-gen command
siteicons-gen generates internal/tui/siteicons_gen.go: the static domain → icon table behind bm's favicon-style bookmark icons.
siteicons-gen generates internal/tui/siteicons_gen.go: the static domain → icon table behind bm's favicon-style bookmark icons.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL