CLI Reference
Complete command line reference for Basic Memory including auth, sync, import, project management, and tool commands
Core Commands
import
Imports external knowledge sources with support for project targeting:
status
Shows system status information:
project
Manage multiple projects with the new unified database architecture. Projects can now be switched instantly during conversations without restart.
You can also manage projects within an LLM chat via mcp tools.
Using Projects in Commands
All commands support the --project
flag to specify which project to use:
tools
Direct access to MCP tools via CLI with new editing and file management capabilities:
help
The full list of commands and help for each can be viewed with the --help
argument.
You need to install Basic Memory via uv
or pip
to use the command line tools. See the Getting Started guide for installation instructions.
sync
Keeps files and the knowledge graph in sync:
Changes sync automatically - no manual sync required.
Options:
--watch
: Continuously monitor for changes--verbose
: Show detailed output
As of the v0.12.0 release syncing will occur in real time when the mcp process starts.
- The real time sync means that it is no longer necessary to run the
basic-memory sync --watch
process in a terminal to sync changes to the db (so the AI can see them). This will be done automatically.
This behavior can be changed via the config. The config file for Basic Memory is in the home directory under .basic-memory/config.json
.
To change the properties, set the following values:
Using stdin with Basic Memory’s write_note
Tool
The write-note
tool supports reading content from standard input (stdin), allowing for more flexible workflows when creating or updating notes in your Basic Memory knowledge base.
Use Cases
This feature is particularly useful for:
- Piping output from other commands directly into Basic Memory notes
- Creating notes with multi-line content without having to escape quotes or special characters
- Integrating with AI assistants like Claude Code that can generate content and pipe it to Basic Memory
- Processing text data from files or other sources
Basic Usage
Method 1: Using a Pipe
You can pipe content from another command into write_note
:
Method 2: Using Heredoc Syntax
For multi-line content, you can use heredoc syntax:
Method 3: Input Redirection
You can redirect input from a file:
Integration with Claude Code
This feature works well with Claude Code in the terminal:
CLI
In a Claude Code session, let Claude know he can use the basic-memory tools, then he can execute them via the cli:
Troubleshooting Common Issues
Sync Conflicts
If you encounter a file changed during sync error:
- Check the file referenced in the error message
- Resolve any conflicts manually
- Run sync again
Import Errors
If import fails:
- Check that the source file is in the correct format
- Verify permissions on the target directory
- Use —verbose flag for detailed error information
Status Issues
If status shows problems:
- Note any unresolved relations or warnings
- Run a full sync to attempt automatic resolution
- Check file permissions if database access errors occur