Basic Memory
Reference

CLI Reference

Command-line reference for Basic Memory local and cloud workflows.

Use bm (short) or basic-memory (full). Examples below use bm.


Core commands

bm status

Show sync status between files and database.

bm status
bm status --verbose
bm status --json
bm status --project research
FlagDescription
--projectTarget a specific project
--verbose, -vShow detailed file information
--jsonMachine-readable JSON output
--localForce local routing (ignore cloud mode)
--cloudForce cloud routing

bm doctor

Run local consistency checks to verify file/database sync. Defaults to local routing since it scans the local filesystem.

bm doctor
FlagDescription
--localForce local routing (ignore cloud mode)
--cloudForce cloud routing

bm mcp

Run the MCP server with configurable transport options. The server handles initialization, file sync, and cleanup automatically.

# Default: stdio transport (for Claude Desktop, Claude Code, etc.)
bm mcp

# Lock to a single project
bm mcp --project main

# HTTP transport for web deployments
bm mcp --transport streamable-http --port 8000

# SSE transport for compatibility with existing clients
bm mcp --transport sse
FlagDescription
--transportTransport type: stdio (default), streamable-http, sse
--hostHost for HTTP transports (default 0.0.0.0)
--portPort for HTTP transports (default 8000)
--pathPath prefix for streamable-http transport (default /mcp)
--projectRestrict MCP server to a single project
This command works regardless of cloud mode setting. Users with cloud mode enabled can still run a local MCP server for Claude Code and Claude Desktop.

bm reindex

Rebuild search indexes and/or vector embeddings without dropping the database.

# Rebuild everything (search + embeddings)
bm reindex

# Rebuild only full-text search index
bm reindex --search
bm reindex -s

# Rebuild only vector embeddings
bm reindex --embeddings
bm reindex -e

# Reindex a specific project
bm reindex -p main
FlagDescription
--search, -sRebuild only the full-text search index
--embeddings, -eRebuild only vector embeddings
--project, -pTarget a specific project (default: all projects)

When neither --search nor --embeddings is specified, both are rebuilt.

bm reset

Reset database — drops all tables and recreates them. Files are never deleted.

bm reset
bm reset --reindex
FlagDescription
--reindexRebuild the database index from filesystem after reset
This rebuilds the entire database from your files. Safe (files are untouched) but may take time for large knowledge bases.

bm format

Format files using configured formatters. Uses the formatter_command or formatters settings from your config. By default, formats all .md, .json, and .canvas files in the current project.

bm format                         # Format all files in current project
bm format --project research      # Format files in specific project
bm format notes/meeting.md        # Format a specific file
bm format notes/                  # Format all files in a directory
FlagDescription
--project, -pTarget a specific project

Project management

bm project list

List projects from local config and (when available) cloud.

bm project list
bm project list --json
bm project list --workspace my-workspace
FlagDescription
--jsonMachine-readable JSON output
--workspaceCloud workspace name or tenant ID
--localForce local routing
--cloudForce cloud routing

bm project info

Display detailed information and statistics about a project. Shows an htop-inspired compact dashboard with horizontal bar charts for note types, embedding coverage bars, and colored status dots.

bm project info main
bm project info main --json
FlagDescription
--jsonMachine-readable JSON output
--localForce local routing (ignore cloud mode)
--cloudForce cloud routing

bm project add

Add a new project.

# Local project
bm project add research ~/Documents/research

# Cloud project (no local sync)
bm project add research --cloud

# Cloud project with local sync path
bm project add research --cloud --local-path ~/docs

# Add and set as default
bm project add research ~/Documents/research --default
FlagDescription
--local-pathLocal sync path for cloud mode
--defaultSet as default project
--localForce local routing
--cloudForce cloud routing

bm project remove

Remove a project from configuration.

bm project remove research
bm project remove research --delete-notes
FlagDescription
--delete-notesAlso delete project files from disk
--localForce local routing
--cloudForce cloud routing

bm project default

Set the default project used as fallback when no project is specified.

bm project default main

bm project move

Move a local project to a new filesystem location. Updates the configured path in the database.

bm project move research /new/path/to/research

bm project ls

List files in a project directory.

bm project ls --name research
bm project ls --name research subfolder
bm project ls --name research --local
bm project ls --name research --cloud
FlagDescription
--nameProject name (required)
--localList files from local instance
--cloudList files from cloud instance

Routing modes (per project)

Route specific projects through cloud while keeping others local:

bm project set-cloud research
bm project set-local research

Cloud commands

Authentication and status

bm cloud login
bm cloud status
bm cloud logout

API keys

bm cloud api-key save bmc_...
bm cloud api-key create "my-laptop"
bm cloud api-key create requires an active OAuth session. Run bm cloud login first.

Setup and upload

bm cloud setup
bm cloud upload ~/my-notes --project research --create-project

Sync

# One-way sync: local → cloud
bm cloud sync

# Two-way sync: local ↔ cloud
bm cloud bisync

# Verify file integrity between local and cloud
bm cloud check

# Clear bisync state
bm cloud bisync-reset

# Configure local sync for an existing cloud project
bm cloud sync-setup research ~/Documents/research

Snapshots

bm cloud snapshot create "Before migration"
bm cloud snapshot list
bm cloud snapshot show <snapshot-id>
bm cloud snapshot browse <snapshot-id>
bm cloud snapshot delete <snapshot-id>

Restore

bm cloud restore <path> --snapshot <snapshot-id>

Workspaces

bm cloud workspace list

Promo controls

bm cloud promo --off
bm cloud promo --on

Schema commands

Tools for defining, validating, and evolving note structure. See Schema System for concepts and workflow.

bm schema validate

Validate notes against their schema definition. Pass a note type to validate all notes of that type, a specific file path to validate one note, or omit to validate all notes that have schemas.

# Validate all notes with schemas
bm schema validate

# Validate all notes of a type
bm schema validate person

# Validate one specific note
bm schema validate people/ada-lovelace.md

# Strict mode — treat warnings as errors
bm schema validate person --strict

# Machine-readable output
bm schema validate person --json

# Target a specific project
bm schema validate person --project research
FlagDescription
--strictTreat validation warnings as errors (exit code 1 on any issue)
--jsonMachine-readable JSON output
--projectTarget a specific project
--localForce local routing
--cloudForce cloud routing

bm schema infer

Analyze existing notes of a type and suggest a schema based on common observation categories, relation types, and frontmatter fields. Fields present in 95%+ of notes become required; fields above the threshold become optional.

# Infer schema for a note type
bm schema infer person

# Lower the threshold to include less common fields
bm schema infer person --threshold 0.1

# Save the inferred schema directly as a schema note
bm schema infer person --save

# Machine-readable output
bm schema infer person --json

# Target a specific project
bm schema infer person --project research
FlagDescription
--thresholdMinimum field frequency for inclusion (default 0.25 — fields in 25%+ of notes)
--saveSave the inferred schema as a schema note in the schemas/ directory
--jsonMachine-readable JSON output
--projectTarget a specific project
--localForce local routing
--cloudForce cloud routing

bm schema diff

Compare a schema definition against actual note usage to detect drift. Shows new fields appearing, old fields disappearing, and cardinality changes.

# Check drift for a note type
bm schema diff person

# Machine-readable output
bm schema diff person --json

# Target a specific project
bm schema diff person --project research
FlagDescription
--jsonMachine-readable JSON output
--projectTarget a specific project
--localForce local routing
--cloudForce cloud routing

Tool commands (CLI wrapper for MCP tools)

Command group: bm tool (singular). This provides CLI access to the same MCP tools that AI assistants use, useful for scripting, debugging, and quick operations from the terminal.

bm tool write-note

# Create a note with inline content
bm tool write-note --title "API Notes" --folder specs --content "# API Notes"

# Pipe content from stdin
echo "# My Note" | bm tool write-note --title "My Note" --folder notes
FlagDescription
--titleNote title (required)
--folderDestination folder (required)
--contentNote content (reads from stdin if omitted)
--tagsTags to apply
--projectTarget project
--localForce local routing
--cloudForce cloud routing

bm tool read-note

bm tool read-note "specs/api-notes"
bm tool read-note my-note --include-frontmatter
bm tool read-note my-note --page 2 --page-size 5
FlagDescription
--include-frontmatterInclude YAML frontmatter in output
--pagePage number for pagination (default 1)
--page-sizeResults per page (default 10)
--projectTarget project
--localForce local routing
--cloudForce cloud routing

bm tool edit-note

bm tool edit-note my-note --operation append --content "new content"
bm tool edit-note my-note --operation find_replace --find-text "old" --content "new"
bm tool edit-note my-note --operation replace_section --section "## Notes" --content "updated"
FlagDescription
--operationEdit operation: append, prepend, find_replace, replace_section (required)
--contentContent for the edit (required)
--find-textText to find (required for find_replace)
--sectionSection heading (required for replace_section)
--expected-replacementsExpected replacement count for find_replace (default 1)
--projectTarget project
--localForce local routing
--cloudForce cloud routing

bm tool search-notes

# Text search (query is a positional argument)
bm tool search-notes "authentication"

# Tag and metadata filters (query is optional)
bm tool search-notes --tag python --tag async
bm tool search-notes --meta status=draft
bm tool search-notes --type person --type meeting

# Search modes
bm tool search-notes "how to speed up the app" --hybrid
bm tool search-notes "how to speed up the app" --vector
bm tool search-notes --permalink "specs/*"
bm tool search-notes --title "API Design"

# Advanced metadata filter (JSON)
bm tool search-notes --filter '{"priority": {"$in": ["high", "critical"]}}'

# Pagination
bm tool search-notes "api" --page 2 --page-size 20
FlagDescription
--hybridUse hybrid search (keyword + semantic)
--vectorUse vector (semantic-only) search
--permalinkSearch permalink values
--titleSearch title values
--tagFilter by frontmatter tag (repeatable)
--statusFilter by frontmatter status
--typeFilter by frontmatter type (repeatable)
--entity-typeFilter by result type: entity, observation, relation (repeatable)
--metaFilter by frontmatter key=value (repeatable)
--filterJSON metadata filter (advanced)
--after_dateDate filter (e.g., 2d, 1 week)
--pagePage number (default 1)
--page-sizeResults per page (default 10)
--projectTarget project
--localForce local routing
--cloudForce cloud routing

bm tool build-context

bm tool build-context memory://specs/search
bm tool build-context specs/search --depth 2 --timeframe 30d
FlagDescription
--depthTraversal depth (default 1)
--timeframeTime window filter (default 7d)
--pagePage number (default 1)
--page-sizeResults per page (default 10)
--max-relatedMaximum related items (default 10)
--projectTarget project
--localForce local routing
--cloudForce cloud routing

bm tool recent-activity

bm tool recent-activity
bm tool recent-activity --timeframe 30d --page-size 20
bm tool recent-activity --type entity --type observation
FlagDescription
--typeFilter by item type (repeatable)
--depthContext depth (default 1)
--timeframeTime window (default 7d)
--pagePage number (default 1)
--page-sizeResults per page (default 50)
--projectTarget project
--localForce local routing
--cloudForce cloud routing

Schema tool commands

These are CLI wrappers around the schema MCP tools with JSON output:

bm tool schema-validate --entity-type person
bm tool schema-infer person
bm tool schema-diff person
bm tool list-projects
bm tool list-workspaces

Import commands

bm import claude conversations
bm import chatgpt
bm import memory-json /path/to/export.json

Notes on defaults

  • If --project is omitted, Basic Memory falls back to default_project when configured.
  • All bm tool subcommands support --workspace for cloud workspace targeting.
  • --local and --cloud flags are available on most commands for routing overrides.