Bear Notes
Use grizzly to create, read, and manage notes in Bear on macOS.
Requirements
- - Bear app installed and running
- For some operations (add-text, tags, open-note --selected), a Bear app token (stored in
~/.config/grizzly/token)
Getting a Bear Token
For operations that require a token (add-text, tags, open-note --selected), you need an authentication token:
- 1. Open Bear → Help → API Token → Copy Token
- Save it: INLINECODE2
Common Commands
Create a note
CODEBLOCK0
Open/read a note by ID
CODEBLOCK1
Append text to a note
CODEBLOCK2
List all tags
CODEBLOCK3
Search notes (via open-tag)
CODEBLOCK4
Options
Common flags:
- -
--dry-run — Preview the URL without executing - INLINECODE4 — Show the x-callback-url
- INLINECODE5 — Wait for Bear's response (needed for reading data)
- INLINECODE6 — Output as JSON (when using callbacks)
- INLINECODE7 — Path to Bear API token file
Configuration
Grizzly reads config from (in priority order):
- 1. CLI flags
- Environment variables (
GRIZZLY_TOKEN_FILE, GRIZZLY_CALLBACK_URL, GRIZZLY_TIMEOUT) - INLINECODE11 in current directory
- INLINECODE12
Example ~/.config/grizzly/config.toml:
CODEBLOCK5
Notes
- - Bear must be running for commands to work
- Note IDs are Bear's internal identifiers (visible in note info or via callbacks)
- Use
--enable-callback when you need to read data back from Bear - Some operations require a valid token (add-text, tags, open-note --selected)
Bear Notes
使用 grizzly 在 macOS 上的 Bear 应用中创建、读取和管理笔记。
要求
- - 已安装并运行 Bear 应用
- 某些操作(add-text、tags、open-note --selected)需要 Bear 应用令牌(存储在 ~/.config/grizzly/token)
获取 Bear 令牌
对于需要令牌的操作(add-text、tags、open-note --selected),你需要一个身份验证令牌:
- 1. 打开 Bear → 帮助 → API 令牌 → 复制令牌
- 保存令牌:echo YOUR_TOKEN > ~/.config/grizzly/token
常用命令
创建笔记
bash
echo 笔记内容 | grizzly create --title 我的笔记 --tag work
grizzly create --title 快速笔记 --tag inbox < /dev/null
通过 ID 打开/读取笔记
bash
grizzly open-note --id NOTE_ID --enable-callback --json
向笔记追加文本
bash
echo 附加内容 | grizzly add-text --id NOTE_ID --mode append --token-file ~/.config/grizzly/token
列出所有标签
bash
grizzly tags --enable-callback --json --token-file ~/.config/grizzly/token
搜索笔记(通过 open-tag)
bash
grizzly open-tag --name work --enable-callback --json
选项
常用标志:
- - --dry-run — 预览 URL 而不执行
- --print-url — 显示 x-callback-url
- --enable-callback — 等待 Bear 的响应(读取数据时需要)
- --json — 以 JSON 格式输出(使用回调时)
- --token-file PATH — Bear API 令牌文件路径
配置
Grizzly 按以下优先级读取配置:
- 1. CLI 标志
- 环境变量(GRIZZLYTOKENFILE、GRIZZLYCALLBACKURL、GRIZZLY_TIMEOUT)
- 当前目录下的 .grizzly.toml
- ~/.config/grizzly/config.toml
示例 ~/.config/grizzly/config.toml:
toml
token_file = ~/.config/grizzly/token
callback_url = http://127.0.0.1:42123/success
timeout = 5s
说明
- - Bear 必须正在运行才能执行命令
- 笔记 ID 是 Bear 的内部标识符(可在笔记信息或通过回调查看)
- 需要从 Bear 读取数据时使用 --enable-callback
- 某些操作需要有效令牌(add-text、tags、open-note --selected)