Skip to content

refactor(cli): remove list command adapter globals#2152

Merged
cv merged 4 commits intofeat/oclif-list-bridgefrom
refactor/oclif-list-command-cleanups
Apr 21, 2026
Merged

refactor(cli): remove list command adapter globals#2152
cv merged 4 commits intofeat/oclif-list-bridgefrom
refactor/oclif-list-command-cleanups

Conversation

@cv
Copy link
Copy Markdown
Contributor

@cv cv commented Apr 21, 2026

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

  • 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

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • 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 (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

AI Disclosure

  • AI-assisted — tool: OpenAI Codex

Signed-off-by: Carlos Villela cvillela@nvidia.com

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Apr 21, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: Pro Plus

Run ID: 91ecc8a5-a267-4ff6-912f-0a3cd51c72d9

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 refactor/oclif-list-command-cleanups

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

@wscurran wscurran added NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). refactor This is a refactor of the code and/or architecture. labels Apr 21, 2026
cv added 3 commits April 21, 2026 11:15
## 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>
@cv cv merged commit 5650653 into feat/oclif-list-bridge Apr 21, 2026
11 of 12 checks passed
@cv cv added the v0.0.22 Release target label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). refactor This is a refactor of the code and/or architecture. v0.0.22 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants