CLI Reference
Complete command line reference for Basic Memory including auth, import, project management, and tool commands
Core Commands
import
Imports external knowledge sources with support for project targeting:
# Claude conversations
basic-memory import claude conversations
# Claude projects
basic-memory import claude projects
# ChatGPT history
basic-memory import chatgpt
# Memory JSON format
basic-memory import memory-json /path/to/memory.json
# Import to specific project
basic-memory --project=work import claude conversations
status
Shows system status information:
# Basic status check
basic-memory status
# Detailed status
basic-memory status --verbose
# JSON output
basic-memory status --json
project
Manage multiple projects with the new unified database architecture. Projects can now be switched instantly during conversations without restart.
# List all configured projects with status
basic-memory project list
# Create a new project
basic-memory project add work ~/work-basic-memory
# Create a project using an existing directory (like an Obsidian vault)
basic-memory project add notes ~/Documents/MyObsidianVault
# Set the default project
basic-memory project default work
# Remove a project (doesn't delete files)
basic-memory project remove personal
# Show detailed project statistics
basic-memory project info
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:
# Run MCP server for a specific project
basic-memory --project=personal mcp
tools
Direct access to MCP tools via CLI with new editing and file management capabilities:
# Create notes
basic-memory tool write-note --title "My Note" --content "Content here"
# Search notes
basic-memory tool search-notes --query "authentication"
help
The full list of commands and help for each can be viewed with the --help
argument.
basic-memory --help
You need to install Basic Memory via uv
or pip
to use the command line tools. See the Getting Started guide for installation instructions.
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
:
# Pipe output of a command into a new note
echo "# My Note\n\nThis is a test note" | basic-memory tool write-note \
--title "Test Note" --folder "notes"
# Pipe output of a file into a new note
cat README.md | basic-memory tool write-note --title "Project README" --folder "documentation"
# Process text through other tools before saving as a note
cat data.txt | grep "important" | basic-memory tool write-note --title "Important Data" --folder "data"
Method 2: Using Heredoc Syntax
For multi-line content, you can use heredoc syntax:
# Create a note with heredoc
cat << EOF | basic-memory tool write_note --title "Project Ideas" --folder "projects"
# Project Ideas for Q2
## AI Integration
- Improve recommendation engine
- Add semantic search to product catalog
## Infrastructure
- Migrate to Kubernetes
- Implement CI/CD pipeline
EOF
Method 3: Input Redirection
You can redirect input from a file:
# Create a note from file content
basic-memory tool write-note --title "Meeting Notes" --folder "meetings" < meeting_notes.md
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:
echo "# Test Note from Claude\n\nThis is a test note created by Claude to test the stdin functionality." | basic-memory tool write-note --title "Claude Test Note" --folder "test" --tags "test" --tags "claude"
# Stable releases
pip install basic-memory
# Beta/pre-releases
pip install basic-memory --pre
# Latest development builds (auto-published)
pip install basic-memory --pre --force-reinstall
# Check current version
basic-memory --version
Troubleshooting Common Issues
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
- Restart your MCP Client (e.g. Claude Desktop)
- Check file permissions if database access errors occur
- If the errors continue please contact us and we will fix it