Problem
There's no way to delete a note from the CLI. bm tool surfaces write-note, read-note, edit-note, build-context, recent-activity, search-notes, etc., but delete-note is missing — even though the underlying delete capability is fully implemented everywhere else:
- MCP tool:
src/basic_memory/mcp/tools/delete_note.py (registered in mcp/tools/__init__.py)
- API:
DELETE /v2/projects/{project_id}/knowledge/entities/{entity_id} and POST .../delete-directory (api/v2/routers/knowledge_router.py)
- Service:
entity_service.delete_entity() / delete_entity_by_file_path() / delete_directory()
- Tests:
test-int/mcp/test_delete_note_integration.py
The CLI entry point was simply never wired up.
Proposed solution
Add a delete_note command to src/basic_memory/cli/commands/tool.py, following the existing edit_note / write_note command pattern (around tool.py:182). It should delegate to the existing delete_note MCP tool so behavior matches the agent path exactly.
Suggested surface:
bm tool delete-note "Note Title" (by title or permalink)
--is-directory flag to delete a directory (the MCP tool already supports is_directory)
--project / --project-id options, matching the other bm tool commands
--output-format text|json, consistent with the rest
Notes
- This is purely a CLI wiring task — no service/API changes needed.
- Worth confirming whether
move-note is similarly missing from the CLI while we're here (it appears not to be surfaced either), though that's out of scope for this issue.
Problem
There's no way to delete a note from the CLI.
bm toolsurfaceswrite-note,read-note,edit-note,build-context,recent-activity,search-notes, etc., butdelete-noteis missing — even though the underlying delete capability is fully implemented everywhere else:src/basic_memory/mcp/tools/delete_note.py(registered inmcp/tools/__init__.py)DELETE /v2/projects/{project_id}/knowledge/entities/{entity_id}andPOST .../delete-directory(api/v2/routers/knowledge_router.py)entity_service.delete_entity()/delete_entity_by_file_path()/delete_directory()test-int/mcp/test_delete_note_integration.pyThe CLI entry point was simply never wired up.
Proposed solution
Add a
delete_notecommand tosrc/basic_memory/cli/commands/tool.py, following the existingedit_note/write_notecommand pattern (aroundtool.py:182). It should delegate to the existingdelete_noteMCP tool so behavior matches the agent path exactly.Suggested surface:
bm tool delete-note "Note Title"(by title or permalink)--is-directoryflag to delete a directory (the MCP tool already supportsis_directory)--project/--project-idoptions, matching the otherbm toolcommands--output-format text|json, consistent with the restNotes
move-noteis similarly missing from the CLI while we're here (it appears not to be surfaced either), though that's out of scope for this issue.