Command Line Interface (CLI) for AI and Scripting


library Return to support library

Bear for Mac includes three new tools that let external apps and scripts access your notes: a CLI, a Claude Connector, and an MCP Server. They let you search, read, create, and edit notes from outside the app. It is useful for automation, scripting, or connecting Bear to AI assistants like Claude. The Claude Connector and MCP Server are both built on bearcli, Bear’s command-line tool, so getting familiar with bearcli is a good first step regardless of which you plan to use.

  • Claude Connector: talk to your notes in Claude, one-click setup
  • MCP Server: connect Claude Code, other AI assistants, and any MCP-compatible tool
  • bearcli: the command-line tool the other two are built on

⚠️ Before you begin, we suggest make a backup of your Bear notes

Claude Connector

The Connector turns Claude into a conversational layer over your notes. One-click setup from inside Bear, no config files to edit.

Install: in Bear, open Help → Advanced → Install Claude Connector. Bear handles the rest.

Then just ask Claude:

  • “Find all notes with uncompleted todos I haven’t touched in 30 days”
  • “Summarize everything I’ve written about Project X”
  • “List the notes I created this week, sorted by last modified”
  • “Based on everything in my notes, what kind of person do you think I am?”

⚠️ Claude will ask for your confirmation before making any changes.

MCP Server

The Connector sets up an MCP server for Claude automatically. This section is for connecting other AI assistants yourself.

The Model Context Protocol (MCP) is an open standard that lets AI assistants and other external tools connect to apps like Bear. Claude Code, Cursor, and a growing number of other AI assistants all speak MCP.

Most MCP clients use the same JSON config shape:

{
  "mcpServers": {
    "bear": {
      "command": "/Applications/Bear.app/Contents/MacOS/bearcli",
      "args": ["mcp-server"]
    }
  }
}

Where that config lives and whether you edit a file directly or run a setup command varies by client. Check your tool’s MCP documentation for the specifics. The command/args shape above is the convention and works almost everywhere.

Once connected, the client discovers every operation Bear exposes: search, read, create, tag, and more. Most MCP clients will ask for your confirmation before making changes, but check your tool’s defaults.

No local MCP support? Some AI tools like browser-based assistants or terminal agents can’t run a local MCP server but can run shell commands. In that case you can still give the AI access to your notes by pointing it at bearcli directly. Ask it to start with bearcli help all, which prints the full command reference in one shot, and it can take it from there.

bearcli

bearcli is the command-line tool that the Connector and MCP Server are built on. It exposes every note operation directly including search, read, create, append, tag, pin, attach, archive, trash.

Reach for it when you want to:

  • Script note operations in shell or cron
  • Pipe note content into other Unix tools
  • Run bulk edits without an AI in the loop

Location: /Applications/Bear.app/Contents/MacOS/bearcli

To explore more: /Applications/Bear.app/Contents/MacOS/bearcli -h /Applications/Bear.app/Contents/MacOS/bearcli search -h

The -h output is a complete reference for every command.

Shortening the command

To avoid typing the full path every time, add this line to ~/.zshrc (or your shell’s equivalent):

alias bearcli='/Applications/Bear.app/Contents/MacOS/bearcli'

Reload your shell (or open a new terminal) and bearcli works anywhere you type commands.

Aliases don’t carry into shell scripts or cron jobs, though. If you plan to call bearcli from either, symlink it into a directory on your PATH instead:

sudo mkdir -p /usr/local/bin
sudo ln -s /Applications/Bear.app/Contents/MacOS/bearcli /usr/local/bin/bearcli

Privacy

  • Everything runs locally. bearcli reads and writes your local Bear database on your Mac
  • Nothing connects unless you opt in. The Connector and MCP Server only run after you install and enable them
  • No bulk upload. Connecting a tool does not share anything by itself. The assistant only sees the notes a specific query returns.
  • Encrypted notes stay encrypted. They can be listed, but never read or modified by any of these tools

Requirement and Limitation

  • Requires Bear 2.8 or later
  • All three tools are macOS-only
  • The Claude Connector requires the Claude desktop app
  • This document assumes Bear is located in /Applications/Bear.app. If you’ve installed Bear elsewhere, adjust the paths above
Group 9

Troubleshooting

Some solutions to common problems.

Sync Troubleshooting Conflicted Notes Bear's Database

Still in trouble? Look for answers on the blog, forum or drop us a line.

Contact us

The Bear newsletter

Sign up for tips about working in Bear, news about our apps, and more. No spam, ever. Maybe bear hugs, though.