Skip to content

feat(cli): expose env-only infrastructure settings as CLI flags#538

Draft
binaryaaron wants to merge 3 commits into
mainfrom
binaryaaron/cli-flags-for-everything
Draft

feat(cli): expose env-only infrastructure settings as CLI flags#538
binaryaaron wants to merge 3 commits into
mainfrom
binaryaaron/cli-flags-for-everything

Conversation

@binaryaaron
Copy link
Copy Markdown
Collaborator

Summary

  • Add CLI flags for five env-only runtime settings: --nim-endpoint-url, --nim-api-key, --nim-model-id, --local-files-only, and --cpu-count (closes feat: add CLI flags for env-only settings (NIM, offline mode, CPU count) #155).
  • Route resolved values through CLISettings with canonical NSS_INFERENCE_* env names and legacy NIM_* alias precedence; propagate to os.environ before pii_replacer imports.
  • Restructure docs/user-guide/environment.md with master reference table, precedence section, and CLI flag mappings.

Test plan

  • make check
  • tests/cli/ (settings, utils, run help)
  • tests/test_env_flags.py, tests/pii_replacer/test_detect.py
  • make docs-build

Notes

Follow-up work (not in this PR): thread PiiRuntimeSettings into pii_replacer to remove env propagation shim.

5 settings were configurable only via environment variables with no CLI
flag equivalent, making them undiscoverable through --help. Expose
--nim-endpoint-url, --nim-api-key, --nim-model-id, --local-files-only,
and --cpu-count as CLISettings fields with AliasChoices so env vars
continue to work and CLI flags take precedence. Resolved values are
propagated back to os.environ in common_setup before the deferred
pii_replacer imports so the existing deep readers honor CLI overrides
without threading a settings handle through every callsite.

Closes #155

Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
Align CLISettings and env propagation with runtime readers in pii_replacer
(NSS_INFERENCE_ENDPOINT/KEY), add NSS-over-NIM alias precedence and
NSS_LOG_COLOR, share env_flag_is_true for GLiNER offline parsing, and
restructure environment docs with CLI flag mappings.

Closes #155

Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e764c8ce-4984-471b-8a52-6a3caa633561

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch binaryaaron/cli-flags-for-everything

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 98.10127% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/nemo_safe_synthesizer/cli/settings.py 91.42% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
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: add CLI flags for env-only settings (NIM, offline mode, CPU count)

1 participant