Skip to content

feat(codemode): allow injecting variables into sandbox execution context - #44

Merged
bwebs merged 2 commits into
mainfrom
bryan/codemode-sandbox-extra-vars
Jul 23, 2026
Merged

feat(codemode): allow injecting variables into sandbox execution context#44
bwebs merged 2 commits into
mainfrom
bryan/codemode-sandbox-extra-vars

Conversation

@bwebs

@bwebs bwebs commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a repeatable --var / -v key=value parameter to lkr code-mode sandbox to define top-level variables inside the Python script execution context.

Closes #43

Summary of Changes

  • Added var: list[str] | None option (--var / -v) to the sandbox CLI command in lkr/codemode/main.py.
  • Prepended JSON-serialized assignments of passed key=value pairs into the script before Monty execution.
  • Updated documentation in codemode.md, lkr/codemode/readme.py, and regenerated lkr.md CLI specs.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new --var (or -v) option to the sandbox command in lkr code-mode, allowing users to inject key-value variables directly into the executed Python script. It also updates the documentation across several files (codemode.md, lkr.md, and lkr/codemode/readme.py) to reflect this new feature, as well as documenting the --version option and the single-file -f/--file option for LookML push/pull commands. Feedback is provided on lkr/codemode/main.py to add validation for the injected variables, ensuring they contain an = character and that the keys are valid Python identifiers, preventing silent failures or syntax errors.

Comment thread lkr/codemode/main.py
@bwebs
bwebs merged commit 159db0c into main Jul 23, 2026
1 check passed
@bwebs
bwebs deleted the bryan/codemode-sandbox-extra-vars branch July 23, 2026 21:30
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.

feat(codemode): support injecting variables into via CLI flags

1 participant