π» bearclaw
A Rust CLI tool for managing Bear notes on macOS. Designed for AI agent integration with structured JSON output.
Comes with an Amp skill for natural language note management.
Features
- π Read & Search β Full-text search with OCR support for attachments
- βοΈ Create & Edit β Create, replace, append, prepend note content
- π·οΈ Tag Management β List tags as tree, add/rename/delete tags, find untagged notes
- π Backlinks β Find notes that link to a given note
- π Statistics β Note counts, tag distribution, monthly trends
- π¦ Batch Operations β Bulk tag and archive
- π€ Export β Export notes as Markdown with YAML frontmatter
- π Safe β Reads from SQLite directly, writes through Bear's official API
- π€ Agent-friendly β JSON output, designed for AI tool integration
Installation
Pre-built binary (recommended)
Download the latest release for your Mac:
# Apple Silicon (M1/M2/M3/M4)
|
# Intel Mac
|
From crates.io
From source
Requirements
- macOS (Bear is macOS/iOS only)
- Bear installed
Quick Start
# Check everything is working
# Search notes
# Read a specific note
# Create a note
# View statistics
Commands
Note Operations
| Command | Description |
|---|---|
bearclaw read <id-or-title> |
Read a note's full content |
bearclaw search <query> |
Search notes (--ocr, --tag, --since, --before, --limit) |
bearclaw create --title "x" --body "y" |
Create a new note (--tags, --body-file) |
bearclaw edit <id> --body "x" |
Replace note body (--body-file) |
bearclaw append <id> --text "x" |
Append text (--header, --text-file) |
bearclaw prepend <id> --text "x" |
Prepend text (--text-file) |
bearclaw section <id> --header "x" |
Extract a section by header |
bearclaw trash <id> |
Move note to trash |
bearclaw archive <id> |
Archive a note |
Tag Operations
| Command | Description |
|---|---|
bearclaw tag list |
List all tags as hierarchical tree |
bearclaw tag add <id> --tags "a,b" |
Add tags to a note |
bearclaw tag rename <old> <new> |
Rename a tag |
bearclaw tag delete <name> |
Delete a tag |
bearclaw untagged |
List notes without tags |
Analysis & Links
| Command | Description |
|---|---|
bearclaw backlinks <id-or-title> |
Find notes linking to this note |
bearclaw stats |
Show statistics |
Batch & Export
| Command | Description |
|---|---|
bearclaw batch tag --filter "q" --tags "a,b" |
Bulk add tags |
bearclaw batch archive --filter "q" |
Bulk archive |
bearclaw export --output ./dir/ |
Export as Markdown (--tag, --since, --before) |
Diagnostics
| Command | Description |
|---|---|
bearclaw health |
Check Bear installation and database status |
Global Options
| Option | Description |
|---|---|
--pretty |
Pretty-print JSON output |
--db-path <path> |
Custom database path (or BEAR_DB_PATH env var) |
JSON Output
All commands return structured JSON:
// Success
// Error
Amp Skill Integration
This project includes an Amp skill that lets you manage Bear notes with natural language.
Install the Skill
Usage
Once installed, just talk to Amp naturally:
- "Search my Bear notes about Rust"
- "Organize my untagged notes"
- "Create a note summarizing this conversation"
- "Export all notes tagged 'work' to Markdown"
- "Show me my note statistics"
Amp will automatically use the bearclaw commands to fulfill your requests.
Architecture
ββββββββββββ βββββββββββββ ββββββββββββββββ
β AI Agent ββββββΆβ bearclaw ββββββΆβ Bear SQLite β (read-only)
β (Amp) βββββββ (Rust) ββββββΆβ Bear x-callback-url β (writes)
ββββββββββββJSON βββββββββββββ ββββββββββββββββ
- Reads: Direct SQLite access (fast, no Bear app needed)
- Writes: Bear's official
x-callback-urlAPI (safe, requires Bear running) - Output: JSON to stdout for agent consumption
License
MIT