feat: multi-instance support with --config parameter
Add support for running multiple nanobot instances with complete isolation: - Add --config parameter to gateway command for custom config file path - Implement set_config_path() in config/loader.py for dynamic config path - Derive data directory from config file location (e.g., ~/.nanobot-xxx/) - Update get_data_path() to use unified data directory from config loader - Ensure cron jobs use instance-specific data directory This enables running multiple isolated nanobot instances by specifying different config files, with each instance maintaining separate: - Configuration files - Workspace (memory, sessions, skills) - Cron jobs - Logs and media Example usage: nanobot gateway --config ~/.nanobot-instance2/config.json --port 18791
This commit is contained in:
@@ -12,8 +12,9 @@ def ensure_dir(path: Path) -> Path:
|
||||
|
||||
|
||||
def get_data_path() -> Path:
|
||||
"""~/.nanobot data directory."""
|
||||
return ensure_dir(Path.home() / ".nanobot")
|
||||
"""Get nanobot data directory (derived from config path)."""
|
||||
from nanobot.config.loader import get_data_dir
|
||||
return ensure_dir(get_data_dir())
|
||||
|
||||
|
||||
def get_workspace_path(workspace: str | None = None) -> Path:
|
||||
|
||||
Reference in New Issue
Block a user