bear-notes

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Bear Notes

Bear笔记

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
    )
在macOS上使用
grizzly
创建、查看和管理Bear中的笔记。

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
  2. Save it:
    echo "YOUR_TOKEN" > ~/.config/grizzly/token
  • 已安装并运行Bear应用
  • 部分操作(add-text、tags、open-note --selected)需要Bear应用令牌(存储在
    ~/.config/grizzly/token
    中)

Common Commands

获取Bear令牌

Create a note
bash
echo "Note content here" | grizzly create --title "My Note" --tag work
grizzly create --title "Quick Note" --tag inbox < /dev/null
Open/read a note by ID
bash
grizzly open-note --id "NOTE_ID" --enable-callback --json
Append text to a note
bash
echo "Additional content" | grizzly add-text --id "NOTE_ID" --mode append --token-file ~/.config/grizzly/token
List all tags
bash
grizzly tags --enable-callback --json --token-file ~/.config/grizzly/token
Search notes (via open-tag)
bash
grizzly open-tag --name "work" --enable-callback --json
对于需要令牌的操作(add-text、tags、open-note --selected),你需要一个认证令牌:
  1. 打开Bear → 帮助 → API令牌 → 复制令牌
  2. 保存令牌:
    echo "YOUR_TOKEN" > ~/.config/grizzly/token

Options

常用命令

创建笔记

Common flags:
  • --dry-run
    — Preview the URL without executing
  • --print-url
    — Show the x-callback-url
  • --enable-callback
    — Wait for Bear's response (needed for reading data)
  • --json
    — Output as JSON (when using callbacks)
  • --token-file PATH
    — Path to Bear API token file
bash
echo "Note content here" | grizzly create --title "My Note" --tag work
grizzly create --title "Quick Note" --tag inbox < /dev/null

Configuration

通过ID打开/查看笔记

Grizzly reads config from (in priority order):
  1. CLI flags
  2. Environment variables (
    GRIZZLY_TOKEN_FILE
    ,
    GRIZZLY_CALLBACK_URL
    ,
    GRIZZLY_TIMEOUT
    )
  3. .grizzly.toml
    in current directory
  4. ~/.config/grizzly/config.toml
Example
~/.config/grizzly/config.toml
:
toml
token_file = "~/.config/grizzly/token"
callback_url = "http://127.0.0.1:42123/success"
timeout = "5s"
bash
grizzly open-note --id "NOTE_ID" --enable-callback --json

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)
bash
echo "Additional content" | 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. 命令行参数
  2. 环境变量(
    GRIZZLY_TOKEN_FILE
    GRIZZLY_CALLBACK_URL
    GRIZZLY_TIMEOUT
  3. 当前目录下的
    .grizzly.toml
  4. ~/.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)