refactor(cli): add shared oclif command base - #2926
Conversation
This reverts commit 4ebeae4.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughA new shared base class ChangesCLI Command Consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
## Summary Introduce a public oclif help renderer for sandbox-scoped help paths that still use compatibility routing. This lets those paths display public NemoClaw syntax while pulling summaries and examples from oclif command metadata. ## Stack Navigation - Position: 32 of 60 - Previous PR: [#2924 — refactor(cli): normalize gateway token command id](#2924) - Next PR: [#2926 — refactor(cli): add shared oclif command base](#2926) ## Changes - Added a public help renderer that combines public usage with registered oclif metadata. - Extended help dispatch results with the oclif command ID that owns the help text. - Updated the top-level dispatcher to render public oclif help when command metadata is available. - Added coverage that public help output avoids internal command IDs. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
## Summary Move simple cross-flag validation into oclif metadata so NemoClaw does not maintain duplicate parser logic for relationships oclif already supports. ## Stack Navigation - Position: 34 of 60 - Previous PR: [#2926 — refactor(cli): add shared oclif command base](#2926) - Next PR: [#2928 — refactor(cli): pass lifecycle typed options](#2928) ## Changes - Made onboard `--resume` and `--fresh` mutually exclusive through oclif flag metadata. - Made policy `--from-file` and `--from-dir` mutually exclusive through oclif flag metadata. - Added command-level tests showing invalid flag combinations fail before action dispatch. - Updated policy CLI expectations for oclif's relationship validation wording. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## New Features * Added `sandbox doctor` command for comprehensive health diagnostics * Enhanced logs streaming with `--follow`, `--tail`, and `--since` filtering options ## Improvements * Added short flag aliases: `-y` for `--yes`, `-q` for `--quick`, `-n` for `--tail`, `-v` for `--verbose`, `-o` for `--output` * Improved CLI help output with command examples across all subcommands * Enhanced error messages and argument validation for better user guidance * Extended sandbox rebuild workflow with credential preflight and workspace backup/restore ## Documentation * Updated documented CLI flag syntax for all major commands with new short forms and options <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Introduce a shared NemoClaw oclif command base so common parser conventions live in one place instead of every command class redefining them.
Stack Navigation
Changes
NemoClawCommandwith common-h/--helpbase flag handling.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit