refactor(cli): remove list command adapter globals#2152
Merged
cv merged 4 commits intofeat/oclif-list-bridgefrom Apr 21, 2026
Merged
refactor(cli): remove list command adapter globals#2152cv merged 4 commits intofeat/oclif-list-bridgefrom
cv merged 4 commits intofeat/oclif-list-bridgefrom
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 #2152 by registering `nemoclaw list` in an explicit oclif command map and routing the legacy `list` dispatcher through `config.runCommand("list", ...)`. It keeps the existing `list`, `list --json`, `list --help`, and invalid-argument behavior intact while making `list` a first-class oclif command. ## Changes - Add an `oclif` config block to `package.json` and an explicit command map in `src/lib/oclif-commands.ts` that registers the `list` command. - Add `src/lib/list-command-runtime.ts` so the explicit command map can resolve runtime list dependencies without reintroducing adapter-global command state. - Update `src/lib/list-command.ts` with `runRegisteredListCommand()` and extend `src/lib/list-command.test.ts` to cover the explicit command registration path. - Update `src/nemoclaw.ts` to provide list dependencies to the oclif runtime and route the legacy `list` entry through the registered command. ## 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 #2150 by removing the
nemoclaw listadapter's module-global dependency state and switching the command to oclif's built-in JSON flag path. It keeps the currentlist,list --json,list --help, and invalid-argument behavior intact while making the oclif adapter safer and easier to extend.Changes
activeDepspath insrc/lib/list-command.tswithcreateListCommand(deps), so each oclif list command class closes over its own runtime dependencies.nemoclaw listand overridelogJson()so JSON output still flows through the injected command logger.src/lib/list-command.test.tsto cover independent bound commands alongside the existing help, JSON, and parse-error behavior.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