basic-memory- Full command namebm- Short alias for faster typing
bm for brevity.
Installation
Basic Memory requires Python 3.12 or later:Basic Usage
Command Categories
The CLI is organized into several command groups:Status & Diagnostics
Check sync status and run consistency checks:bm status - Shows sync status including:
- Pending file changes
- New, modified, and deleted files
- Sync statistics
bm doctor - Runs end-to-end consistency checks:
- Creates temporary project
- Tests file → database → file round-trip
- Validates note creation, search, and sync
- Cleans up automatically
Project Management
Manage multiple Basic Memory projects:Cloud Operations
Authenticate and sync with Basic Memory Cloud (requires subscription):MCP Tools
Access Model Context Protocol tools directly from the CLI:Import Data
Import data from external sources:Routing Modes
Basic Memory supports both local and cloud routing:Local Mode (Default)
Commands run against your local database:Cloud Mode
Route commands to Basic Memory Cloud:Per-Project Cloud Routing
Individual projects can be configured to route through cloud:Output Formats
Many commands support JSON output for scripting:Common Workflows
Initial Setup
Working with Projects
Cloud Synchronization
Searching and Reading
Exit Codes
The CLI uses standard exit codes:0- Success1- Error (invalid arguments, command failed, etc.)
Logging
CLI operations are logged to:Environment Variables
BASIC_MEMORY_FORCE_LOCAL=true- Force all commands to use local routingBASIC_MEMORY_TEST_POSTGRES=1- Use Postgres backend for testing
Getting Help
Every command and subcommand supports--help:
Next Steps
- Project Commands - Manage multiple projects
- Cloud Commands - Cloud sync and authentication
- Tool Commands - MCP tools via CLI
- Import Commands - Import external data