feat: Add SPEC-15 for configuration persistence via Tigris (#343)

Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Paul Hernandez
2025-10-08 18:07:00 -05:00
committed by GitHub
parent 032de7e3f2
commit 53438d1eab
4 changed files with 306 additions and 16 deletions
+11 -15
View File
@@ -129,25 +129,21 @@ def display_changes(
async def run_status(project: Optional[str] = None, verbose: bool = False): # pragma: no cover
"""Check sync status of files vs database."""
try:
from basic_memory.config import ConfigManager
from basic_memory.config import ConfigManager
config = ConfigManager().config
auth_headers = {}
if config.cloud_mode_enabled:
auth_headers = await get_authenticated_headers()
config = ConfigManager().config
auth_headers = {}
if config.cloud_mode_enabled:
auth_headers = await get_authenticated_headers()
project_item = await get_active_project(client, project, None)
response = await call_post(
client, f"{project_item.project_url}/project/status", headers=auth_headers
)
sync_report = SyncReportResponse.model_validate(response.json())
project_item = await get_active_project(client, project, None, auth_headers)
response = await call_post(
client, f"{project_item.project_url}/project/status", headers=auth_headers
)
sync_report = SyncReportResponse.model_validate(response.json())
display_changes(project_item.name, "Status", sync_report, verbose)
display_changes(project_item.name, "Status", sync_report, verbose)
except (ValueError, ToolError) as e:
console.print(f"[red]✗ Error: {e}[/red]")
raise typer.Exit(1)
@app.command()
+6 -1
View File
@@ -251,7 +251,12 @@ class ConfigManager:
if isinstance(home, str):
home = Path(home)
self.config_dir = home / DATA_DIR_NAME
# Allow override via environment variable
if config_dir := os.getenv("BASIC_MEMORY_CONFIG_DIR"):
self.config_dir = Path(config_dir)
else:
self.config_dir = home / DATA_DIR_NAME
self.config_file = self.config_dir / CONFIG_FILE_NAME
# Ensure config directory exists