Skip to content

feat(cli): support project paths and options from environment variables - #6151

Open
Vamsi-klu wants to merge 2 commits into
SQLMesh:mainfrom
Vamsi-klu:codex/feat-4874-cli-env-options
Open

Vamsi-klu wants to merge 2 commits into
SQLMesh:mainfrom
Vamsi-klu:codex/feat-4874-cli-env-options

Conversation

@Vamsi-klu

@Vamsi-klu Vamsi-klu commented Oct 17, 2026 •

Copy link
Copy Markdown

Description

Fixes #4874.

Allow project selection through SQLMESH_PATHS in both sqlmesh and sqlmesh_cicd. Path lists use the platform separator and preserve spaces and Unicode; explicit -p options replace the environment list.

Enable Click's SQLMESH automatic prefix for main CLI options, including nested commands. Resolve environment-provided local mode after dotenv loading and before constructing Context so test and lint avoid state access when local mode is selected. Document naming, precedence, path separators, and dotenv timing.

Suggested reviewers: erindru, cmgoffena13.

Test Plan

  • New CLI parsing and bot-option tests: 27 passed.
  • Complete tests/cli/test_cli.py: 139 passed, with DLT_DATA_DIR set to a writable temporary directory.
  • Complete tests/integrations/github/cicd suite: 85 passed.
  • Regression tests fail with the original option/group behavior; prefix-only handling also fails the path-with-spaces case.
  • All 47 new command-level cases restore the relevant environment variables after teardown.
  • MkDocs build and installed CLI smoke tests passed.
  • make style and make fast-test passed on this branch.

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

Signed-off-by: Vamsi-klu <nrvamsi13@gmail.com>
@Vamsi-klu
Vamsi-klu marked this pull request as ready for review October 17, 2026 11:12
Signed-off-by: Vamsi-klu <nrvamsi13@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Allow setting the project path in an environment variable

1 participant