feat(cli): add generic --config.<key>=<value> flags#447
Conversation
pnpm-style `--config.<key>` and `--config.<key>=<value>` flags now reach any setting in settings.toml, including those without a declared sources.cli alias (e.g. strictDepBuilds). Argv is pre-parsed before clap; parsed pairs feed a process-global slot in aube-settings that every *_from_cli helper consults after the per-callsite cli slice. The matcher also accepts the canonical setting name in kebab/camel/snake form so `--config.strict-dep-builds=true`, `--config.strictDepBuilds=true`, and `--config.STRICT_DEP_BUILDS=true` all work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR adds pnpm-style Confidence Score: 4/5Safe to merge; the one inline comment is purely stylistic and does not affect correctness No new P0 or P1 findings from this review. The global-state approach via OnceLock is sound for a single-process CLI binary, the crates/aube-settings/src/values.rs — the Important Files Changed
Reviews (2): Last reviewed commit: "fix(cli): preserve parse-fall-through fo..." | Re-trigger Greptile |
Restore the original loop semantics in `bool_from_cli` / `u64_from_cli`: when a key matches but its value won't parse, keep scanning earlier entries rather than returning the first match unconditionally. This matters now that raw user strings flow through the global slot — a typo'd `--config.strictDepBuilds=garbage` no longer masks an earlier valid duplicate. Mirrors how `bool_from_npmrc` / `u64_from_npmrc` behave on the same input. Also tighten the `to_kebab_case` doc to describe what the function actually does (consecutive uppercase runs collapse to a single token, matching `aube-settings/build.rs`'s alias generator), since no current pnpm setting contains an internal acronym to expose the imperfection. Addresses greptile P2 review feedback on PR #447. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for the review. Pushed 0d23eb9 to address the parse-fall-through regression in For the typo-warning concern ( For This comment was generated by Claude. |
Benchmark changesVersions:
Public ratios: warm installs vs Bun 4x -> 5x; warm installs vs pnpm 5x -> 12x.
0d23eb9 vs 60ff453 | aube/bun/pnpm | 3 scenarios | 3 runs | 500mbit/50ms | generated by Codex. |
Summary
--config.<key>and--config.<key>=<value>flags so any setting insettings.tomlis reachable from the CLI, even ones without a declaredsources.clialias (e.g.strictDepBuilds).aube-settingsthat every*_from_clihelper consults after the per-callsiteclislice.--config.strict-dep-builds=true,--config.strictDepBuilds=true, and--config.STRICT_DEP_BUILDS=trueall resolve.Behavior notes
--config.<key>(first-match-wins), so existing flags like--frozen-lockfilekeep priority.--config.<key>still beats env /.npmrc/ workspace yaml — same precedence as any other CLI source.--separator is left untouched, soaube exec -- node --config.foo=barpasses--config.foo=barthrough to the child.--config.<key>with no=defaults to"true"(matches pnpm/commander). The--config.<key> <value>space form is intentionally NOT consumed to avoid eating positional args.Test plan
cargo test -p aube-settings— covers canonical-name matching across kebab/camel/screaming-snake.cargo test -p aube --bin aube— coversextract_config_overrides(=, bool, multiple,--, no-op).cargo clippy --all-targets -- -D warningsclean.mise run test:bats test/lifecycle_scripts.bats— new--config.strict-dep-builds=truetest plus existing 21 pass.aube install --config.strict-dep-builds=truetriggers the gate;--config.strict-dep-builds=falseoverrides.npmrc strictDepBuilds=true.🤖 Generated with Claude Code
Note
Medium Risk
Modifies top-level argv handling and settings CLI resolution precedence, which could change how flags are parsed/overridden across commands if edge cases are missed.
Overview
Adds pnpm-compatible generic
--config.<key>/--config.<key>=<value>support by stripping these flags from argv before clap parsing and registering them as process-wide setting overrides.Updates
aube-settingsCLI resolvers to consult these global overrides (after command-specific CLI flags), including matching keys by canonical setting name across kebab/camel/snake forms and skipping unparseable values so earlier valid duplicates still win. Adds unit tests plus a bats regression test proving--config.strict-dep-builds=truecan flipstrictDepBuildsfor a singleaube installrun.Reviewed by Cursor Bugbot for commit 0d23eb9. Bugbot is set up for automated code reviews on this repo. Configure here.