feat(cli): add -e/--env flag for passing env vars as scrubbed secrets - #132
Draft
sd2k wants to merge 1 commit into
Draft
feat(cli): add -e/--env flag for passing env vars as scrubbed secrets#132sd2k wants to merge 1 commit into
sd2k wants to merge 1 commit into
Conversation
Prior to this commit, there was no way to pass environment variables to the sandbox via the CLI. This commit adds Docker-style `-e KEY=VALUE` and `-e KEY` (inherit from host) flags. Values are passed through the existing secrets API so they are automatically scrubbed from stdout/stderr/file output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sd2k
marked this pull request as ready for review
February 10, 2026 17:40
sd2k
marked this pull request as draft
February 11, 2026 08:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-e KEY=VALUE/-e KEYCLI flags (Docker-style) to pass environment variables into the sandbox-e KEY(without value) inherits from the host environment, errors if not setChanges
_cli.py: New "environment" argument group with-e/--env, newmake_secrets()helper__main__.py: Wiremake_secrets()into both_run_once()and_repl()pathstest_cli.py: 12 new tests (7 unit tests formake_secrets, 5 integration tests for CLI flag)Example
Testing
🤖 Generated with Claude Code