Skip to content

refactor(cli): parse list flags with oclif#2150

Merged
cv merged 6 commits intofeat/list-jsonfrom
feat/oclif-list-bridge
Apr 21, 2026
Merged

refactor(cli): parse list flags with oclif#2150
cv merged 6 commits intofeat/list-jsonfrom
feat/oclif-list-bridge

Conversation

@cv
Copy link
Copy Markdown
Contributor

@cv cv commented Apr 21, 2026

Summary

This stacked PR builds on #2147 by routing nemoclaw list through an @oclif/core command adapter while preserving the current list, list --json, list --help, and invalid-argument behavior. It removes the hand-rolled list flag parser from the legacy dispatcher and establishes the first reusable oclif path for the root CLI.

You thought I gave up on #924? ;)

Changes

  • Add @oclif/core as a root CLI dependency and introduce src/lib/list-command.ts as an oclif-backed adapter for nemoclaw list.
  • Replace the manual parseListArgs() path in src/nemoclaw.ts with buildListCommandDeps() and runListCommand() so the legacy dispatcher only supplies runtime dependencies.
  • Add src/lib/list-command.test.ts plus CLI coverage in test/cli.test.ts for list --help, JSON output, and invalid list arguments.

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: 474d2dd8-6092-4647-8aee-4a7d077d9b88

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 feat/oclif-list-bridge

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

@cv cv added the v0.0.22 Release target label Apr 21, 2026
cv added 3 commits April 21, 2026 13:17
## 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>
@cv cv merged commit ea5b163 into feat/list-json Apr 21, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.22 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant