Repository navigation
fix(modules): pass --env / --envfile through the module shortcut - #21
Merged
Merged
Conversation
lucli <module> ... --env=x, lucli --env=x <module> ... and an aliased binary (-Dlucli.binary.name=<module>) re-execute 'modules run ...' on the root command. The re-parse reset the root's options, so the execution strategy set LuCLI.currentEnvironment from a null envOption and the module never saw the environment; only LUCLI_ENV worked. The shortcut now builds its arguments in moduleShortcutArgs(), which re-injects --env / --envfile at the root position (before 'modules'), where the execution strategy reads them. --verbose / --debug stay after the module args for the module's own parser, as before. Upstream: cybersonic#136 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Integration Tests (ubuntu-latest, Java 21)78 tests 78 ✅ 1m 22s ⏱️ Results for commit 23bb2a2. |
Unit Tests (ubuntu-latest, Java 21) 62 files 62 suites 2m 24s ⏱️ Results for commit 23bb2a2. |
Collaborator
Author
|
rev1-r3 review @ 23bb2a2: APPROVE (final) I built
So the RED-before reproduces on base, and the fix covers both the short alias and
|
This was referenced Oct 6, 2026
bpamiri
added a commit
that referenced
this pull request
Oct 8, 2026
- pom.xml version 0.6.2.3 (the Windows file/product version follows
${project.version}); install-validation default 0.6.2.3.
- FORK.md: 'Next queue' becomes the 0.6.2.3 queue (rows 8-15: #19,
#21-#24, #26-#28), with the row-8 compatibility note (Wheels 4.1.x
stays at max 0.6.2.2: no __lucliMcpCall handling), and a new empty
Next queue.
- CHANGELOG unchanged: fork entries stay under Unreleased, as for
0.6.2.2.
Sandboxed mvn test (-Duser.home only): 788 run, 0 failures.
Signed-off-by: Peter Amiri <peter@alurium.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Upstream issue: cybersonic#136
What
--env/--envfilenever reached a module started through the module shortcut:lucli <module> … --env=x,lucli --env=x <module> …, or an aliased binary (-Dlucli.binary.name=<module>, e.g.wheels start --env=prod). Inside the module,LuCLI.getCurrentEnvironment()wasnull; onlyLUCLI_ENVandlucli --env=x modules run …worked.Why
executeViaModulesCommand()re-executesmodules run <module> …on the same rootCommandLine. picocli resets the root's options on that re-parse, and only--verbose/--debugwere re-injected. SoLuCLIExecutionStrategythen setcurrentEnvironment/envFilePathfrom a root with no--env.How
moduleShortcutArgs(...).--env=<x>/--envfile=<path>beforemodules, at the root position the execution strategy reads.--verbose/--debugstay after the module args, where the module's own parser expects them (unchanged).--env, the argument list is exactly as before.Tests
Unit: new
ModuleShortcutArgsTest(4 cases: no flags unchanged; env + envfile at the root position; verbose/debug still after the module args; empty env not re-injected).Full suite:
mvn testgave 773 tests, 0 failures, 0 errors, 6 skipped. I didn't run the BATS suite locally (nobats-corehere); please rely on CI.End to end: an
envprobemodule printingLuCLI.getCurrentEnvironment(), isolatedLUCLI_HOME/user.home.-Dlucli.binary.name=envprobe … show --env=prodNULLprodlucli envprobe show --env=prodNULLprodlucli --env=prod envprobe showNULLprodlucli envprobe show(no--env)NULLNULLFork bookkeeping
CHANGELOG
## Unreleasedentry; FORK.md "Next queue" row 9.Upstream
The same change goes to
cybersonic/LuCLIas acherry-pick -xonto upstreammain(without FORK.md) once this is reviewed.🤖 Generated with Claude Code