Skip to content

Commit 01fb089

Browse files
fix: reset command now clears project configuration
The reset command was only removing the SQLite database but leaving project configuration intact in ~/.basic-memory/config.json. This caused projects to be recreated on next startup. Now the reset command: - Removes the SQLite database (existing behavior) - Resets project configuration to default state - Recreates empty database (existing behavior) Fixes #151 Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
1 parent b8191d0 commit 01fb089

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • src/basic_memory/cli/commands

src/basic_memory/cli/commands/db.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""Database management commands."""
22

33
import asyncio
4+
from pathlib import Path
45

56
import typer
67
from loguru import logger
78

89
from basic_memory import db
910
from basic_memory.cli.app import app
10-
from basic_memory.config import app_config
11+
from basic_memory.config import app_config, config_manager
1112

1213

1314
@app.command()
@@ -25,6 +26,12 @@ def reset(
2526
db_path.unlink()
2627
logger.info(f"Database file deleted: {db_path}")
2728

29+
# Reset project configuration
30+
config_manager.config.projects = {"main": str(Path.home() / "basic-memory")}
31+
config_manager.config.default_project = "main"
32+
config_manager.save_config(config_manager.config)
33+
logger.info("Project configuration reset to default")
34+
2835
# Create a new empty database
2936
asyncio.run(db.run_migrations(app_config))
3037
logger.info("Database reset complete")

0 commit comments

Comments
 (0)