diff --git a/sqlmesh/cli/main.py b/sqlmesh/cli/main.py index 9e5e98f3f..20b4af062 100644 --- a/sqlmesh/cli/main.py +++ b/sqlmesh/cli/main.py @@ -20,6 +20,7 @@ logger = logging.getLogger(__name__) SKIP_LOAD_COMMANDS = ("create_external_models", "migrate", "rollback", "run") +SKIP_CONTEXT_COMMANDS = ("init", "ui") def _sqlmesh_version() -> str: @@ -80,7 +81,7 @@ def cli( if len(paths) == 1: path = os.path.abspath(paths[0]) - if ctx.invoked_subcommand in ("init", "ui"): + if ctx.invoked_subcommand in SKIP_CONTEXT_COMMANDS: ctx.obj = path return elif ctx.invoked_subcommand in SKIP_LOAD_COMMANDS: