Skip to content

sysid/bkmr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bkmr

Crates.io Crates.io Docs.rs Build Status

Combine any snippet (code, urls, markdown, text) with powerful search, interpolation and execution.

Beyond Bookmarks and Snippets: A CLI Knowledge Management System

bkmr reborn

bkmr - selected crate of the week 482 - is a fast, feature-rich command-line tool that extends bookmark management, snippet handling, markdown rendering, script execution and more.

Organize, find, and apply your various content types:

  • Web URLs with automatic metadata extraction
  • Code snippets for quick access and reuse
  • Shell commands with execution capabilities
  • Markdown documents with live rendering
  • Plain text with template interpolation
  • Local files and directories
  • Semantic embeddings for AI-powered search

Why bkmr?

  • Developer-focused: Integrates seamlessly with your workflow and toolchain
  • Multifunctional: Handles many content types with context-aware actions
  • Intelligent: Full-text and semantic search capabilities
  • Privacy-focused: Local database, no cloud dependencies unless enabled
  • Fast: 20x faster than similar Python tools

NEW: Editor Integrations!

  • Built-in LSP server: Use bkmr lsp for VS Code, Vim, Emacs - automatic snippet completion with language-aware filtering
  • Neovim Plugin: Visual interface with Telescope integration and zero configuration
  • IntelliJ Plugin: JetBrains Marketplace plugin for all IDEs

See Editor Integration for complete documentation.

Quick Examples

# Quick fuzzy search with interactive selection
bkmr search --fzf

# Add URL with automatic metadata extraction
bkmr add https://example.com tag1,tag2

# Store code snippet
bkmr add "SELECT * FROM users" sql,_snip_ --title "User Query"

# Shell script with interactive execution
bkmr add "#!/bin/bash\necho 'Hello'" utils,_shell_ --title "Greeting"

# Render markdown in browser with TOC
bkmr add "# Notes\n## Section 1" docs,_md_ --title "Project Notes"

# Import files with frontmatter
bkmr import-files ~/scripts/ --base-path SCRIPTS_HOME

# AI-powered semantic search
bkmr --openai sem-search "containerized application security"

Screenshots

Bookmarks: bookmarks

Snippets: fzf-snippets

Demos:

Getting Started

Installation

# Via cargo
cargo install bkmr

# Via pip/pipx/uv
pip install bkmr

# Via brew
brew install bkmr

See Installation Guide for detailed instructions and troubleshooting.

Initial Setup

# Generate configuration
bkmr --generate-config > ~/.config/bkmr/config.toml

# Create database
bkmr create-db ~/.config/bkmr/bkmr.db

# Optional: Configure location
export BKMR_DB_URL=~/path/to/db

First Use

# Add your first bookmark
bkmr add https://github.com/yourusername/yourrepo github,project

# Search and find
bkmr search github

# Interactive fuzzy search
bkmr search --fzf

Quick Start Guide: See the Quick Start for a 5-minute tutorial.

Command Reference

Command Description
search Search across all content with full-text and tag filtering
sem-search AI-powered semantic search using OpenAI embeddings
add Add new content (URLs, snippets, files, shell commands, etc.)
open Launch or interact with stored items (supports script arguments)
edit Smart editing: auto-detects file-imported bookmarks
import-files Import files/directories with frontmatter parsing
tags View and manage your tag taxonomy
set-embeddable Configure items for semantic search

Complete command documentation: See Basic Usage for detailed examples.

Smart Content Actions

bkmr intelligently handles different content types with appropriate actions:

Content Type Default Action System Tag
URLs Open in browser (none)
Snippets Copy to clipboard _snip_
Shell Scripts Interactive edit then execute _shell_
Environment Variables Print for sourcing in shell _env_
Markdown Render in browser with TOC _md_
Text Documents Copy to clipboard _imported_
Local Files Open with default application (none)

Learn more: Content Types | Core Concepts

Documentation

Comprehensive documentation is available in the bkmr Wiki:

Getting Started

Core Features

Advanced Topics

Reference

Editor Integrations

Access your snippets directly within your editor without context switching.

Neovim Plugin (Recommended)

bkmr-nvim provides visual interface with zero configuration.

{
  "sysid/bkmr-nvim",
  dependencies = { "nvim-lua/plenary.nvim" },
  config = function()
    require("bkmr").setup() -- Zero config required!
  end,
}

Features: Visual snippet browser, in-editor editing, automatic LSP setup, custom commands

Built-in LSP Server

Compatible with VS Code, Vim, Emacs, Sublime, and any LSP-compatible editor.

# Start LSP server
bkmr lsp

# Disable template interpolation if needed
bkmr lsp --no-interpolation

Features: Automatic completion, language-aware filtering, universal snippets, template interpolation

IntelliJ Platform Plugin

bkmr-intellij-plugin for all JetBrains IDEs.

Features: Seamless LSP integration, Tab navigation, works in IntelliJ IDEA, PyCharm, WebStorm, CLion, RustRover, and all JetBrains IDEs

Complete documentation: Editor Integration

Platform Compatibility

Wayland Support: Native Wayland clipboard support for modern Linux desktops.

  • Supported compositors: Hyprland, Sway, and other compositors supporting wlr-data-control-unstable-v1
  • Automatic detection: Falls back to X11/XWayland if unavailable
  • Compatibility: Check your compositor at wayland.app

Development

Building from Source

git clone https://github.com/sysid/bkmr.git
cd bkmr
cargo build --release

Running Tests

IMPORTANT: All tests must be run single-threaded:

# Run tests (REQUIRED: single-threaded)
cargo test -- --test-threads=1

# Or use Makefile
make test

Why single-threaded? Tests share SQLite database and environment variables. Parallel execution causes race conditions.

See Development for complete contributor guide.

Community and Contributions

We welcome contributions! Please check our Contributing Guidelines to get started.

Resources:

For developers: Remember to always run tests with --test-threads=1 to avoid database conflicts.

About

A Unified CLI Tool for Bookmark, Snippet, and Knowledge Management

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages