refactor(cli): model debug flags with oclif - #2912
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 failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe debug CLI was refactored to parse oclif flags strictly and build a ChangesDebug Command Refactoring
Sequence Diagram(s)sequenceDiagram
autonumber
participant CLI as "Debug CLI"
participant Parser as "oclif parser"
participant CmdHelper as "runDebugCommandWithOptions"
participant Deps as "Deps (getDefaultSandbox, runDebug)"
CLI->>Parser: parse flags (quick, output, sandbox)
Parser-->>CLI: parsed flags
CLI->>CmdHelper: call with DebugOptions (from flags)
CmdHelper->>Deps: getDefaultSandbox() if sandbox missing
Deps-->>CmdHelper: sandboxName (e.g., "alpha")
CmdHelper->>Deps: runDebug(options with sandboxName)
Deps-->>CmdHelper: runDebug result
CmdHelper-->>CLI: complete
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
## Summary Split the sandbox share command into explicit oclif subcommands for mount, unmount, and status. This keeps the public `nemoclaw <name> share ...` syntax stable while moving subcommand routing and unknown-subcommand handling into oclif. ## Stack Navigation - Position: 19 of 60 - Previous PR: [#2910 — refactor(cli): add lifecycle confirmation flag aliases](#2910) - Next PR: [#2912 — refactor(cli): model debug flags with oclif](#2912) ## Changes - Added `sandbox:share`, `sandbox:share:mount`, `sandbox:share:unmount`, and `sandbox:share:status` command adapters. - Moved share mount/unmount/status behavior into exported action helpers reused by the adapters and tests. - Updated sandbox dispatch to route share subcommands to explicit oclif command IDs. - Added CLI coverage for unknown share subcommands failing before action dispatch. ## 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-scoped share subcommands: share mount/unmount/status and improved share help/usage. * Added `-y` short flag for `--yes` across destroy, rebuild, upgrade, and garbage-collection; rebuild docs also show `-v/--verbose`. * Added `sandbox:doctor` command and added CLI usage examples for several commands. * **Bug Fixes** * Improved help/usage and argument validation to surface unexpected arguments earlier. * **Tests** * Expanded tests for share help, destroy short-flag usage, and maintenance command help. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
## Summary Model the onboard/setup/setup-spark flag surface in oclif while preserving the existing onboarding action validation for Dockerfile paths, agents, sessions, and third-party notice semantics. This lets oclif own unknown flags and missing flag values before the onboarding action runs. ## Stack Navigation - Position: 21 of 60 - Previous PR: [#2912 — refactor(cli): model debug flags with oclif](#2912) - Next PR: [#2915 — docs: sync oclif UX command reference](#2915) ## Changes - Added oclif flags for onboard, setup, and setup-spark options. - Added onboard examples for common interactive, resume, fresh, custom Dockerfile, and non-interactive invocations. - Reconstructed legacy argv for the existing onboarding action so domain validation stays centralized. - Kept deprecated setup/setup-spark help paths routed through the existing deprecation messaging. - Updated CLI expectations for parser-owned unknown flag errors. ## 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 * **Refactor** * CLI commands now use stricter flag parsing and convert parsed flags into the legacy argument format, improving validation and behavior for onboarding and setup flows. * **Documentation** * Improved usage text, examples, and more predictable handling of help requests for onboard and setup commands. * **Tests** * CLI tests updated for stricter parsing, standardized parser exit codes, and updated error output expectations for invalid flags. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Move
debugflag parsing into its oclif adapter so unknown flags and missing flag values fail through the parser before diagnostic collection. The debug action helpers remain available for existing unit tests and now also accept already-parsed options.Stack Navigation
Changes
--quick/-q,--output/-o, and--sandboxas oclif flags.runDebugCommandWithOptionsfor adapters that already have parsed options.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
New Features
Improvements
Tests