refactor(cli): parse list flags with oclif#2150
Merged
cv merged 6 commits intofeat/list-jsonfrom Apr 21, 2026
Merged
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
13 tasks
## Summary This stacked PR builds on #2150 by removing the `nemoclaw list` adapter's module-global dependency state and switching the command to oclif's built-in JSON flag path. It keeps the current `list`, `list --json`, `list --help`, and invalid-argument behavior intact while making the oclif adapter safer and easier to extend. ## Changes - Replace the module-global `activeDeps` path in `src/lib/list-command.ts` with `createListCommand(deps)`, so each oclif list command class closes over its own runtime dependencies. - Enable oclif's built-in JSON flag handling for `nemoclaw list` and override `logJson()` so JSON output still flows through the injected command logger. - Extend `src/lib/list-command.test.ts` to cover independent bound commands alongside the existing help, JSON, and parse-error behavior. ## 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) ## AI Disclosure - [x] AI-assisted — tool: OpenAI Codex --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.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.
Summary
This stacked PR builds on #2147 by routing
nemoclaw listthrough an@oclif/corecommand adapter while preserving the currentlist,list --json,list --help, and invalid-argument behavior. It removes the hand-rolledlistflag parser from the legacy dispatcher and establishes the first reusable oclif path for the root CLI.You thought I gave up on #924? ;)
Changes
@oclif/coreas a root CLI dependency and introducesrc/lib/list-command.tsas an oclif-backed adapter fornemoclaw list.parseListArgs()path insrc/nemoclaw.tswithbuildListCommandDeps()andrunListCommand()so the legacy dispatcher only supplies runtime dependencies.src/lib/list-command.test.tsplus CLI coverage intest/cli.test.tsforlist --help, JSON output, and invalidlistarguments.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)AI Disclosure
Signed-off-by: Carlos Villela cvillela@nvidia.com