Skip to content

refactor(cli): add public command display ids - #2921

Merged
cv merged 31 commits into
mainfrom
refactor/oclif-arch-display-metadata
May 5, 2026
Merged

cv merged 31 commits into
mainfrom
refactor/oclif-arch-display-metadata

Conversation

@cv

@cv cv commented May 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Introduce explicit public-display-to-oclif command IDs in the command registry. This prepares root help and docs tooling to combine NemoClaw's public syntax with oclif command metadata without changing runtime behavior.

Stack Navigation

Changes

  • Added commandId to command display metadata entries.
  • Mapped every public and hidden display entry to the oclif command that handles it.
  • Added metadata coverage to ensure display entries point at registered oclif commands.

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)

Signed-off-by: Carlos Villela [email protected]

Summary by CodeRabbit

Release Notes

  • Tests

    • Added validation suite to ensure command metadata consistency across all registered commands.
  • Chores

    • Updated command registration system to include identifiers for all commands, improving command organization and tracking.

cv added 30 commits May 2, 2026 13:36
@cv cv self-assigned this May 3, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 3, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented May 3, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b596880d-8388-49a7-a185-eea320506973

📥 Commits

Reviewing files that changed from the base of the PR and between 1875fe9 and 51d7069.

📒 Files selected for processing (1)
  • src/lib/command-registry.ts

📝 Walkthrough

Walkthrough

A new required commandId field is added to the CommandDef interface, all entries in the COMMANDS registry are populated with this field, and validation tests are added to ensure every command has a registered ID and complete metadata.

Changes

Command Registry commandId Requirement

Layer / File(s) Summary
Interface Definition
src/lib/command-registry.ts
CommandDef interface adds required commandId: string property to track internal oclif command registration.
Command Registry Population
src/lib/command-registry.ts
All entries in COMMANDS array—including visible commands, hidden subcommands, and compatibility aliases—are updated with corresponding commandId values.
Validation Tests
src/lib/command-display-metadata.test.ts
Tests verify every COMMANDS entry has a matching registered command ID in the built oclif registry, and that visibleCommands() results contain complete metadata (group, scope, commandId).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A hop through metadata, so fine and true,
Each command now knows its ID, tried and new,
Consistency checked from top to toe,
The registry blooms with fields all aglow! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/oclif-arch-display-metadata

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

@cv cv added the v0.0.34 label May 4, 2026
@wscurran wscurran added CI/CD refactor PR restructures code without intended behavior change and removed v0.0.34 labels May 4, 2026

@cjagwani cjagwani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as part of stack from #2886 (auto-approve: CI green, no scope/behavior flags).

@cv cv added v0.0.35 and removed v0.0.34 labels May 5, 2026
cv added a commit that referenced this pull request May 5, 2026
## Summary
Start moving process-exit behavior toward CLI boundaries by adding a
typed parse result path for debug arguments. Existing command helpers
keep their compatibility wrapper, but callers can now inspect debug
parse failures without triggering `process.exit()`.

## Stack Navigation
- Position: 27 of 60
- Previous PR: [#2919 — test(cli): require oclif command
metadata](#2919)
- Next PR: [#2921 — refactor(cli): add public command display
ids](#2921)

## Changes
- Added `DebugParseResult` and `parseDebugArgsResult`.
- Reworked `parseDebugArgs` to map typed parse outcomes to output and
exit behavior.
- Added unit coverage for typed debug parse 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 <[email protected]>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added `sandbox doctor` command for sandbox and gateway health
diagnostics.
* Added log filtering: `--tail/-n` and `--since` options for `logs`
command.
* Restructured `share` command into subcommands (`mount`, `unmount`,
`status`).
* Added short flag aliases: `-y` for `--yes`, `-q` for `--quick`, `-o`
for `--output`.

* **Improvements**
  * Enhanced help text and usage examples across CLI commands.
* Better error messages for missing required arguments and invalid
flags.
  * Reorganized policy subcommands with clearer naming.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <[email protected]>
@cv
cv marked this pull request as ready for review May 5, 2026 18:10
@cv
cv changed the base branch from refactor/oclif-arch-debug-typed-parse to main May 5, 2026 18:10
@cv
cv enabled auto-merge (squash) May 5, 2026 18:11
@cv
cv merged commit 9aba792 into main May 5, 2026
11 checks passed
cv added a commit that referenced this pull request May 5, 2026
## Summary
Start generating root help content from oclif command metadata by using
registered command summaries for visible help descriptions. The public
usage/group display remains driven by the NemoClaw display metadata.

## Stack Navigation
- Position: 29 of 60
- Previous PR: [#2921 — refactor(cli): add public command display
ids](#2921)
- Next PR: [#2923 — refactor(cli): table-drive sandbox
dispatch](#2923)

## Changes
- Added an oclif metadata lookup helper.
- Updated root help rendering to prefer each command class summary by
command ID.
- Added tests for metadata lookup 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)

---
Signed-off-by: Carlos Villela <[email protected]>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Help system now displays registered command summaries alongside
command descriptions, providing users with more detailed information
when viewing help.

* **Tests**
* Added test suite validating command metadata retrieval and lookup
functionality.
* Enhanced help output tests to verify additional descriptive
information is displayed correctly.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <[email protected]>
@cv
cv deleted the refactor/oclif-arch-display-metadata branch May 27, 2026 21:17
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output and removed NemoClaw CLI labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output refactor PR restructures code without intended behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants