cli: --recreate alias, exec --env, --log-level filter#81
Conversation
Three small CLI follow-ups batched together since they all touch cmd/devcontainer/ files. #76 up --recreate: alias for --remove-existing-container. Same bool, two flag names — keeps muscle memory from upstream @devcontainers/cli while exposing the library's own naming. #75 exec --env: repeatable -e/--env KEY=VALUE. Split on the first '=' so values containing '=' (URLs, base64) survive. Entries without '=' are rejected with a clear message. #74 --log-level: previously parsed but never applied. Now gates the two chatty event types — events.BuildLogEvent (raw docker build output) and events.LifecycleOutputEvent (raw script stdout/stderr) — behind debug+. Progress, warnings, and state changes still render at info. Unknown values are rejected at command entry. trace is reserved (currently == debug) so the flag's contract doesn't break once we have more granular event types to gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR implements log-level-gated event printing, adds environment variable support to the exec command, and introduces a --recreate flag alias for up. Changes span five files across event handling, command configuration, and CLI parsing. ChangesCLI Features and Event Verbosity
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Batches three small CLI follow-ups since they all touch
cmd/devcontainer/.Closes #74, closes #75, closes #76.
#76 — `up --recreate` alias
Same bool as `--remove-existing-container`, two flag names. Keeps muscle memory from upstream `@devcontainers/cli` while exposing the library's own naming.
#75 — `exec -e/--env KEY=VALUE`
Repeatable. Split on the first `=` so values containing `=` (URLs, base64) survive. Entries without `=` are rejected:
```
$ devcontainer exec -e MALFORMED -- echo ok
error: invalid --env "MALFORMED": expected KEY=VALUE
```
#74 — `--log-level` filter
Previously parsed but never applied. Now gates the two chatty event types:
behind `debug`. Progress, warnings, and container state changes still render at `info`. Unknown values rejected at command entry. `trace` is reserved (currently identical to `debug`) so the flag's contract doesn't break once there are more granular event types to gate.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
--log-levelflag to control output verbosity (info, debug, trace levels).--env/-eflags to the exec command for setting environment variables.--recreateflag as an alias for--remove-existing-container.