-
Notifications
You must be signed in to change notification settings - Fork 10
Core Concepts
Understanding these core concepts will help you use bkmr effectively.
In bkmr, a bookmark is any piece of content you want to store and retrieve later:
- Web URLs
- Code snippets
- Shell scripts
- Markdown documents
- Environment variables
- File references
Each bookmark has:
- URL/Content: The actual content (can be a URL or text)
- Title: A descriptive name
- Description/Comments: Optional additional context
- Tags: For organization and filtering
-
System Tags: Automatic tags that determine behavior (e.g.,
_snip_,_shell_)
Tags are the primary organization mechanism in bkmr.
- Free-form labels you assign
- Comma-separated, no spaces:
python,security,auth - Used for filtering and organization
- Case-sensitive
Examples:
bkmr add <content> python,web,tutorial
bkmr search -t python,securitySpecial tags that determine how bkmr handles content:
| System Tag | Purpose | Default Action |
|---|---|---|
_snip_ |
Code snippet | Copy to clipboard |
_shell_ |
Shell script | Interactive edit + execute |
_md_ |
Markdown document | Render in browser |
_env_ |
Environment variables | Print for sourcing |
_imported_ |
Imported file content | Copy to clipboard |
Automatic assignment:
- Added with
--type snip→ Gets_snip_tag - Added with
--type shell→ Gets_shell_tag - Imported
.mdfiles → Get_md_tag
Content types determine how bkmr processes and presents your bookmarks. See Content Types for detailed information.
1. URLs
bkmr add https://example.com dev,reference
# Opens in browser when accessed2. Snippets
bkmr add "console.log('test')" javascript,_snip_ --title "Debug Log"
# Copies to clipboard when accessed3. Shell Scripts
bkmr add "#!/bin/bash\necho 'Hello'" utils,_shell_ --title "Greeting"
# Interactive editor before execution4. Markdown
bkmr add "# Title\n\n## Section" docs,_md_ --title "Documentation"
# Renders in browser with TOCbkmr automatically selects the appropriate action based on content type (system tag):
# Same command, different actions:
bkmr open <url-id> # Opens in browser
bkmr open <snippet-id> # Copies to clipboard
bkmr open <shell-id> # Interactive editor + execute
bkmr open <md-id> # Renders in browserThis context-aware behavior means you don't need different commands for different content types.
bkmr stores everything in a local SQLite database:
- Default location:
~/.config/bkmr/bkmr.db - Configurable via
BKMR_DB_URLenvironment variable - Includes full-text search (FTS5) index
- Optional: Semantic embeddings for AI-powered search
bkmr provides multiple ways to find content:
1. Full-Text Search (FTS)
bkmr search "python security"
bkmr search "containerization"2. Tag Filtering
bkmr search -t python,tutorial # Must have ALL tags
bkmr search -T deprecated,old # Must NOT have these tags3. Fuzzy Finding (Interactive)
bkmr search --fzf # Interactive picker
bkmr search --fzf -t python # Pre-filtered fuzzy search4. Semantic Search (AI-powered)
bkmr --openai sem-search "deploy automation"
# Finds conceptually similar contentSee Search and Discovery for comprehensive search documentation.
bkmr can import files with metadata and track changes:
# Import with frontmatter
bkmr import-files ~/scripts/backup.sh
# Smart editing (edits source file)
bkmr edit <imported-id>See File Import and Editing for details.
Make content dynamic with Jinja2 templates:
# Dynamic date in URL
bkmr add "https://reports.com/{{ current_date | strftime('%Y-%m-%d') }}" reports
# Environment variables in scripts
bkmr add "export PATH={{ env('HOME') }}/bin:\$PATH" env,_env_See Template Interpolation for details.
- Basic Usage - Learn common commands
- Content Types - Deep dive into each content type
- Search and Discovery - Master search techniques
bkmr Documentation