mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
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:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user