bear-cli
bear-cli is a native Rust CLI for Bear that talks directly to Bear's CloudKit container.
Features
- authenticate with Bear's CloudKit web flow
- list, open, search, and export notes
- inspect tags and tag membership
- create notes, edit note text, attach files, trash, and archive
- rename and delete tags
- compute duplicates, stats, health checks, and other library summaries from CloudKit data
Requirements
- macOS
- a Bear account with iCloud sync enabled
- network access to Apple's CloudKit endpoints
Installation
From crates.io
From source
The installed binary name is bear.
Authentication
Authenticate once before using CloudKit-backed commands:
The auth flow opens a localhost page and prefers Safari for CloudKit sign-in on macOS.
If you already have a valid ckWebAuthToken, you can save it directly:
On success the token is saved locally and reused by subsequent commands.
Usage
Commands
Reading notes and tags
notesopen-notetagsopen-tagsearchexportduplicatesstatshealthuntaggedtodotodaylocked
Examples:
Writing notes and tags
createadd-textadd-filetrasharchiverename-tagdelete-tag
Examples:
Notes
- All operational commands are CloudKit-based.
- Authentication is required for both reads and writes.
- The CloudKit API token used by this project was reverse-engineered from Bear Web's public frontend bundle.
- The auth flow is browser-sensitive. Safari is the preferred path on macOS.
- Some large-note edge cases may still require additional CloudKit asset-handling work if Bear stores note bodies outside
textADP.
Development