Skip to content

refactor(cli): migrate destroy command to oclif - #2806

Merged
cv merged 18 commits into
mainfrom
refactor/oclif-destroy
May 2, 2026
Merged

refactor(cli): migrate destroy command to oclif#2806
cv merged 18 commits into
mainfrom
refactor/oclif-destroy

Conversation

@cv

@cv cv commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrates the destructive destroy sandbox command to oclif while preserving the existing destroy implementation. Confirmation prompts, active-session warnings, NIM cleanup, sandbox deletion, registry cleanup, and gateway cleanup stay unchanged.

Changes

  • Add src/lib/destroy-cli-command.ts for sandbox:destroy.\n- Route <name> destroy [--yes|--force] through runOclif().\n- Preserve public help output for the sandbox-scoped command.\n- Reuse the existing sandboxDestroy() implementation behind the wrapper.

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

Stack position

Note

This PR is part of a stacked refactor. Please review/merge in stack order.
The current PR is highlighted below.

This is PR #2806 in the stacked CLI oclif refactor series.

Full stack

Merge from top to bottom.

Order PR Merge after Title
1 #2775 main refactor(cli): migrate status and tunnel commands to oclif
2 #2776 #2775 refactor(cli): migrate debug uninstall and gateway-token to oclif
3 #2786 #2776 refactor(cli): migrate credentials commands to oclif
4 #2787 #2786 refactor(cli): migrate sandbox inspection commands to oclif
5 #2788 #2787 refactor(cli): migrate maintenance commands to oclif
6 #2796 #2788 refactor(cli): migrate sandbox logs command to oclif
7 #2797 #2796 refactor(cli): migrate skill install command to oclif
8 #2798 #2797 refactor(cli): migrate snapshot list and create to oclif
9 #2802 #2798 refactor(cli): migrate shields commands to oclif
10 #2803 #2802 refactor(cli): migrate channels mutation commands to oclif
11 #2804 #2803 refactor(cli): migrate policy mutation commands to oclif
12 #2805 #2804 refactor(cli): migrate snapshot restore command to oclif
13 #2806 #2805 refactor(cli): migrate destroy command to oclif
14 #2807 #2806 refactor(cli): migrate rebuild command to oclif
15 #2808 #2807 refactor(cli): migrate connect command to oclif
16 #2809 #2808 refactor(cli): migrate deploy command to oclif
17 #2810 #2809 refactor(cli): migrate onboard aliases to oclif
18 #2811 #2810 refactor(cli): migrate help and version commands to oclif
19 #2814 #2811 refactor(cli): centralize legacy oclif dispatch
20 #2815 #2814 refactor(cli): drop trivial oclif wrapper helpers
21 #2816 #2815 refactor(cli): centralize sandbox runtime bridge
22 #2817 #2816 refactor(cli): centralize policy and channels runtime bridge
23 #2818 #2817 refactor(cli): centralize global runtime bridge
24 #2819 #2818 refactor(cli): collapse runtime bridge exports
25 #2826 #2819 refactor(cli): introduce sandbox runtime action facade
26 #2827 #2826 refactor(cli): introduce policy and channels action facade
27 #2828 #2827 refactor(cli): introduce global command action facade
28 #2830 #2828 refactor(cli): extract root help action
29 #2831 #2830 refactor(cli): extract deploy action
30 #2832 #2831 refactor(cli): extract onboard actions
31 #2835 #2832 refactor(cli): extract openshell runtime helpers
32 #2836 #2835 refactor(cli): extract sandbox logs action
33 #2837 #2836 refactor(cli): extract maintenance actions
34 #2838 #2837 refactor(cli): extract snapshot actions
35 #2839 #2838 refactor(cli): extract policy and channels actions
36 #2840 #2839 refactor(cli): extract credentials and list runtime bits
37 #2841 #2840 refactor(cli): shrink runtime bridge

Summary by CodeRabbit

  • New Features

    • Added a new sandbox destroy command that allows users to delete sandboxes. The command includes a --yes flag to automatically confirm deletion without prompting and a --force flag to override safety restrictions.
  • Tests

    • Added CLI command test coverage for the destroy functionality to ensure proper help output and usage information display.

@cv cv self-assigned this May 1, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 1, 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 1, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR introduces a new oclif CLI command sandbox:destroy for destroying sandboxes. The command accepts a required sandbox name argument and optional --yes and --force flags, then delegates to the existing sandboxDestroy function via a runtime bridge. The nemoclaw dispatcher is updated to route sandbox destroy requests through oclif instead of direct invocation, and help test coverage is extended.

Changes

Sandbox Destroy CLI Command

Layer / File(s) Summary
Core Command Implementation
src/lib/destroy-cli-command.ts
New oclif DestroyCliCommand class with required sandboxName argument and optional --yes/--force flags. The run() method converts flags into legacy arguments and calls sandboxDestroy via a runtime bridge loaded from nemoclaw.
Command Registration
src/lib/oclif-commands.ts
DestroyCliCommand is imported and registered in the command map under the "sandbox:destroy" key.
Runtime Bridge & Dispatch
src/nemoclaw.ts
sandboxDestroy function is explicitly exported. The <sandbox> destroy dispatch path switches from direct function call to oclif command dispatch (runOclif("sandbox:destroy", ...)) with a help-flag guard.
Test Coverage
test/cli.test.ts
Assertions added to verify destroy --help shows the public-facing usage (<name> destroy [--yes|--force]) and does not expose the internal sandbox:destroy identifier.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A sandbox falls away, clean and free,
With flags for force and yes's decree,
Through oclif's bridge, the command flows,
Destruction swift—as every rabbit knows! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(cli): migrate destroy command to oclif' accurately describes the main change—migrating the destroy sandbox command to oclif—and is concise and clear.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-destroy

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/destroy-cli-command.ts (1)

12-14: ⚡ Quick win

Add a runtime shape guard for the bridge object.

Line 13 relies on a type assertion only; if the bridge export drifts, this fails late with a generic TypeError. Add an explicit function check and throw a clear error.

Proposed hardening
 function getRuntimeBridge(): RuntimeBridge {
-  return require("../nemoclaw") as RuntimeBridge;
+  const bridge = require("../nemoclaw") as Partial<RuntimeBridge>;
+  if (typeof bridge?.sandboxDestroy !== "function") {
+    throw new Error("Runtime bridge misconfigured: sandboxDestroy is unavailable.");
+  }
+  return bridge as RuntimeBridge;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/destroy-cli-command.ts` around lines 12 - 14, The getRuntimeBridge
function currently uses a type assertion and can throw a generic TypeError if
the "../nemoclaw" export shape drifts; update getRuntimeBridge to
require("../nemoclaw") into a local const, validate that the object conforms to
the expected RuntimeBridge shape (e.g., required functions/properties you rely
on on the returned bridge), and if the checks fail throw a clear, descriptive
Error (mentioning getRuntimeBridge and the missing/invalid members) instead of
relying on the assertion so callers fail fast with a helpful message.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/lib/destroy-cli-command.ts`:
- Around line 12-14: The getRuntimeBridge function currently uses a type
assertion and can throw a generic TypeError if the "../nemoclaw" export shape
drifts; update getRuntimeBridge to require("../nemoclaw") into a local const,
validate that the object conforms to the expected RuntimeBridge shape (e.g.,
required functions/properties you rely on on the returned bridge), and if the
checks fail throw a clear, descriptive Error (mentioning getRuntimeBridge and
the missing/invalid members) instead of relying on the assertion so callers fail
fast with a helpful message.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c0915405-9bd5-4575-a4d2-a6ae3ff05612

📥 Commits

Reviewing files that changed from the base of the PR and between 5e6694a and fd59cd0.

📒 Files selected for processing (4)
  • src/lib/destroy-cli-command.ts
  • src/lib/oclif-commands.ts
  • src/nemoclaw.ts
  • test/cli.test.ts

@cv
cv enabled auto-merge (squash) May 2, 2026 05:30
@cv
cv merged commit a20ddfe into main May 2, 2026
15 checks passed
cv added a commit that referenced this pull request May 2, 2026
## Summary
Migrates the sandbox `rebuild` command to oclif while preserving the
existing backup/delete/recreate/restore flow. This keeps confirmation
prompts, verbose diagnostics, credential preflight, and upgrade
integration unchanged.

## Changes
- Add `src/lib/rebuild-cli-command.ts` for `sandbox:rebuild`.\n- Route
`<name> rebuild [--yes|--force] [--verbose|-v]` through `runOclif()`.\n-
Preserve public help output and existing rebuild 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2807** in the stacked CLI oclif refactor series.

- Merge after: **#2806**
- Next PR: **#2808**
- Stack position: **14 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | **#2807** | #2806 | **refactor(cli): migrate rebuild command to
oclif** |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

* **New Features**
* Added a new sandbox rebuild command to upgrade sandboxes to the
current agent version. Requires a sandbox name and supports --yes,
--force, and --verbose/-v flags. CLI help now shows the public sandbox
rebuild usage.

* **Tests**
* Added regression tests for rebuild help output and new child-process
lifecycle helpers to normalize and assert expected CLI runtime behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Migrates the sandbox `connect` command to oclif, including the default
`<name>` action path. The existing runtime recovery and connection
implementation remains behind the oclif wrapper.

## Changes
- Add `src/lib/connect-cli-command.ts` for `sandbox:connect`.\n- Route
`<name> connect` and the default sandbox action through `runOclif()`.\n-
Preserve public help output and the removed
`--dangerously-skip-permissions` diagnostic path.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2808** in the stacked CLI oclif refactor series.

- Merge after: **#2807**
- Next PR: **#2809**
- Stack position: **15 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | **#2808** | #2807 | **refactor(cli): migrate connect command to
oclif** |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

* **New Features**
* Added `sandbox:connect` command to connect to running sandboxes with
an optional `--probe-only` flag for probe-only connections.

* **Tests**
* Added help text assertions to verify connect command documentation
displays correctly.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Migrates the deprecated global `deploy` compatibility command to oclif.
The existing deploy implementation remains unchanged behind the wrapper.

## Changes
- Add `src/lib/deploy-cli-command.ts` for `deploy`.\n- Route global
`deploy [instance-name]` through `runOclif()`.\n- Add help coverage for
the deprecated deploy usage.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2809** in the stacked CLI oclif refactor series.

- Merge after: **#2808**
- Next PR: **#2810**
- Stack position: **16 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | **#2809** | #2808 | **refactor(cli): migrate deploy command to
oclif** |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

* **New Features**
* Deploy command is now available in the CLI with an optional
instance-name argument and help documentation.

* **Tests**
  * Added test coverage for the deploy command help functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Migrates onboarding and its deprecated compatibility aliases to oclif
while preserving the existing onboarding parser and flows. The wrappers
delegate into the existing `onboard`, `setup`, and `setup-spark`
implementations.

## Changes
- Add `src/lib/onboard-cli-commands.ts` for `onboard`, `setup`, and
`setup-spark`.\n- Route the global onboarding commands through
`runOclif()`.\n- Preserve existing onboarding help, deprecation
messages, third-party notice handling, and option validation.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2810** in the stacked CLI oclif refactor series.

- Merge after: **#2809**
- Next PR: **#2811**
- Stack position: **17 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | **#2810** | #2809 | **refactor(cli): migrate onboard aliases to
oclif** |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

* **New Features**
* Introduced three new CLI commands—`onboard`, `setup`, and
`setup-spark`—to provide enhanced configuration and setup capabilities
via the command line interface.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Migrates top-level help and version aliases to oclif, completing the
command registry migration stack. The custom NemoClaw help renderer and
version output remain unchanged behind hidden oclif commands.

## Changes
- Add `src/lib/help-version-cli-commands.ts` for hidden `root:help` and
`root:version` commands.\n- Route no-arg help, `help`, `--help`, `-h`,
`--version`, and `-v` through `runOclif()`.\n- Ignore command metadata
from the CLI coverage ratchet because it is covered by registry unit
tests.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2811** in the stacked CLI oclif refactor series.

- Merge after: **#2810**
- Next PR: **#2814**
- Stack position: **18 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | **#2811** | #2810 | **refactor(cli): migrate help and version
commands to oclif** |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

* **Refactor**
* Restructured CLI command routing infrastructure for help and version
commands. No changes to visible end-user behavior or functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Centralizes the legacy public CLI shape to oclif command ID mapping in a
table-driven dispatcher. This shrinks the command switch in
`src/nemoclaw.ts` while preserving sandbox recovery, public usage text,
and legacy edge-case diagnostics.

## Changes
- Add `src/lib/legacy-oclif-dispatch.ts` to resolve global and
sandbox-scoped public argv shapes to oclif command IDs.
- Replace the large global/sandbox dispatch switch in `src/nemoclaw.ts`
with `resolveGlobalOclifDispatch()` / `resolveSandboxOclifDispatch()`
plus a small result handler.
- Preserve legacy fallbacks for connect argument errors, skill
help/unknown subcommands, snapshot generic help, and policy-add missing
path diagnostics.
- Update image cleanup guard tests to account for oclif bridge dispatch
instead of a literal `case "gc"` switch.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2814** in the stacked CLI oclif refactor series.

- Merge after: **#2811**
- Next PR: **#2815**
- Stack position: **19 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | **#2814** | #2811 | **refactor(cli): centralize legacy oclif
dispatch** |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Removes dead wrapper helpers that became unnecessary after centralizing
legacy-to-oclif dispatch. The remaining entrypoint now calls the
dispatcher directly instead of bouncing through one-line local
functions.

## Changes
- Delete trivial `runOclif()` forwarding helpers from `src/nemoclaw.ts`
such as `start`, `stop`, `tunnel`, `debug`, `uninstall`,
`credentialsCommand`, `showStatus`, and `listSandboxes`.
- Remove unused local argument helper functions now handled by
`legacy-oclif-dispatch.ts`.
- Keep the shared `runOclif()` helper and public sandbox usage printer
for the dispatcher result handler.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2815** in the stacked CLI oclif refactor series.

- Merge after: **#2814**
- Next PR: **#2816**
- Stack position: **20 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | **#2815** | #2814 | **refactor(cli): drop trivial oclif wrapper
helpers** |
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Consolidated command handling infrastructure through a unified
dispatch system for improved consistency and code maintainability.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Centralizes the sandbox-oriented runtime bridge used by oclif adapters
so individual sandbox command adapters no longer import `../nemoclaw`
directly. This is a transitional cleanup step before extracting the
underlying sandbox command implementations out of `src/nemoclaw.ts`.

## Changes
- Add `src/lib/nemoclaw-runtime-bridge.ts` as a typed bridge to the
remaining entrypoint-hosted command actions.
- Update sandbox-oriented oclif adapters (`connect`, `destroy`,
`rebuild`, `logs`, `skill install`, `snapshot`, and inspection commands)
to use the centralized bridge.
- Add targeted helper coverage for small CLI helper modules to keep the
coverage ratchet stable while adapter files remain intentionally
ignored.
- Keep all public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2816** in the stacked CLI oclif refactor series.

- Merge after: **#2815**
- Next PR: **#2817**
- Stack position: **21 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | **#2816** | #2815 | **refactor(cli): centralize sandbox runtime
bridge** |
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

## Release Notes

* **Refactor**
* Improved internal code organization of runtime bridge acquisition
across CLI commands for better maintainability and testability.

* **Tests**
* Enhanced test coverage for CLI helper utilities including duration
parsing, token handling, and sandbox operations.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Moves policy and messaging-channel oclif adapters onto the centralized
runtime bridge. This removes another group of direct `../nemoclaw`
imports from command adapter files.

## Changes
- Update `src/lib/channels-mutate-cli-commands.ts` to use
`getNemoClawRuntimeBridge()`.
- Update `src/lib/policy-mutate-cli-commands.ts` to use
`getNemoClawRuntimeBridge()`.
- Preserve existing test injection hooks for the adapter unit tests.
- Keep public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2817** in the stacked CLI oclif refactor series.

- Merge after: **#2816**
- Next PR: **#2818**
- Stack position: **22 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | **#2817** | #2816 | **refactor(cli): centralize policy and
channels runtime bridge** |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

## Refactor

- Refactored internal runtime infrastructure for CLI commands managing
channels and policies.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Moves global command oclif adapters onto the centralized runtime bridge.
After this change, direct `../nemoclaw` imports are limited to the
single runtime bridge module.

## Changes
- Update global adapters for deploy, maintenance commands, onboarding
aliases, help/version, credentials, and list dependencies to use
`getNemoClawRuntimeBridge()`.
- Extend the bridge typing to include `captureOpenshell` and typed
registry recovery data needed by list dependencies.
- Keep public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2818** in the stacked CLI oclif refactor series.

- Merge after: **#2817**
- Next PR: **#2819**
- Stack position: **23 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | **#2818** | #2817 | **refactor(cli): centralize global runtime
bridge** |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **New Features**
  * Added `captureOpenshell` capability to the runtime bridge.

* **Refactor**
* Consolidated CLI command implementations to use a centralized runtime
bridge accessor, removing duplicate local bridge definitions across
multiple command modules.
* Enhanced runtime bridge method signatures for improved flexibility in
environment and timeout configuration.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Collapses the many transitional `exports.*` bridge entries in
`src/nemoclaw.ts` into a single exported `runtimeBridge` object. This
reduces entrypoint export surface while preserving the remaining
centralized bridge until command implementations are fully extracted
into library modules.

## Changes
- Replace dozens of individual `exports.foo = foo` assignments with one
`exports.runtimeBridge = { ... }` object.
- Update `src/lib/nemoclaw-runtime-bridge.ts` to read the single
`runtimeBridge` export.
- Keep `mainPromise` exported for existing subprocess test harnesses.
- Keep public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2819** in the stacked CLI oclif refactor series.

- Merge after: **#2818**
- Next PR: **#2826**
- Stack position: **24 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | **#2819** | #2818 | **refactor(cli): collapse runtime bridge
exports** |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Reorganized internal module structure to improve runtime bridge
initialization and module resolution without affecting the public API.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Introduces a sandbox runtime action facade between oclif adapters and
the temporary NemoClaw runtime bridge. This prepares the sandbox command
implementations for a later physical extraction from `src/nemoclaw.ts`
without changing public behavior.

## Changes
- Add `src/lib/sandbox-runtime-actions.ts` for
connect/status/logs/destroy/rebuild/skill/snapshot sandbox actions.
- Update sandbox-oriented oclif adapters to call the action facade
instead of the runtime bridge directly.
- Preserve existing test injection hooks for logs, skill install, and
snapshot wrappers.
- Keep public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2826** in the stacked CLI oclif refactor series.

- Merge after: **#2819**
- Next PR: **#2827**
- Stack position: **25 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | **#2826** | #2819 | **refactor(cli): introduce sandbox runtime
action facade** |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Reorganized internal sandbox runtime operation handling for improved
code maintainability. CLI command behavior remains unchanged—all sandbox
operations (connect, destroy, rebuild, status, logs, skill installation,
snapshots) continue to function as before.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Introduces a policy and channels action facade between oclif adapters
and the temporary NemoClaw runtime bridge. This prepares those command
families for later extraction from `src/nemoclaw.ts` while preserving
behavior.

## Changes
- Add `src/lib/policy-channel-actions.ts` for policy and messaging
channel action calls.
- Update policy/channel mutation adapters to call the facade.
- Update sandbox inspection channel/policy list commands to call the
facade.
- Preserve existing adapter test hooks and public CLI 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2827** in the stacked CLI oclif refactor series.

- Merge after: **#2826**
- Next PR: **#2828**
- Stack position: **26 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | **#2827** | #2826 | **refactor(cli): introduce policy and
channels action facade** |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Improved internal architecture by introducing a facade layer for
sandbox policy and channel management operations.
* Simplified command adapter structure for enhanced testability and
maintainability.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Introduces a global command action facade between oclif adapters and the
temporary NemoClaw runtime bridge. This groups
onboard/deploy/maintenance/help/credentials bridge calls in one place
ahead of moving the actual implementations out of `src/nemoclaw.ts`.

## Changes
- Add `src/lib/global-cli-actions.ts` for global command action calls.
- Update deploy, maintenance, onboard alias, help/version, and
credentials adapters to call the facade.
- Keep public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2828** in the stacked CLI oclif refactor series.

- Merge after: **#2827**
- Next PR: **#2830**
- Stack position: **27 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | **#2828** | #2827 | **refactor(cli): introduce global command
action facade** |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Restructured internal command execution framework to centralize CLI
action handling and improve code organization across multiple commands.
  * All user-facing functionality and CLI behavior remain unchanged.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts the root help and version actions from `src/nemoclaw.ts` into a
dedicated library module. This removes another chunk of entrypoint-owned
command behavior while preserving the existing custom help renderer.

## Changes
- Add `src/lib/root-help-action.ts` with `help()` and `version()`
implementations.
- Update global action facade and `src/nemoclaw.ts` to call the
extracted root help module.
- Remove help/version entries from the temporary runtime bridge.
- Update image cleanup guard tests to look for help rendering in the new
module.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2830** in the stacked CLI oclif refactor series.

- Merge after: **#2828**
- Next PR: **#2831**
- Stack position: **28 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | **#2830** | #2828 | **refactor(cli): extract root help action** |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

* **Refactor**
* Help and version commands consolidated into a dedicated module; CLI
now uses that module for displayed help and version output. Help text
rendering improved (grouped commands, per-command flags, deprecated
styling, uninstall and reconfiguration notes, powered-by and gateway/URL
lines, respects NO_COLOR/TTY/truecolor).

* **Tests**
* Updated tests to validate rendered help output instead of internal
wiring.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts the deploy action wiring from `src/nemoclaw.ts` into a
dedicated library module. The deploy oclif adapter now reaches the
deployment implementation through `global-cli-actions` without the
temporary runtime bridge.

## Changes
- Add `src/lib/deploy-action.ts` to assemble `executeDeploy()`
dependencies outside the entrypoint.
- Update `src/lib/global-cli-actions.ts` to call the extracted deploy
action directly.
- Remove `deploy` from the temporary runtime bridge and from
`src/nemoclaw.ts`.
- Update runner guard tests to look for deploy wiring in the new action
module.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2831** in the stacked CLI oclif refactor series.

- Merge after: **#2830**
- Next PR: **#2832**
- Stack position: **29 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | **#2831** | #2830 | **refactor(cli): extract deploy action** |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Reorganized the internal deployment system architecture for improved
code structure and maintainability.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts onboard, setup, and setup-spark action wiring from
`src/nemoclaw.ts` into a dedicated library module. The onboarding oclif
adapters now call the extracted action facade directly instead of
routing through the temporary runtime bridge.

## Changes
- Add `src/lib/onboard-action.ts` for onboarding and deprecated setup
alias actions.
- Update `src/lib/global-cli-actions.ts` to call the extracted onboard
actions directly.
- Remove onboard/setup/setup-spark from the temporary runtime bridge and
from `src/nemoclaw.ts`.
- Update runner guard tests to look for setup-spark alias behavior in
the new action module.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2832** in the stacked CLI oclif refactor series.

- Merge after: **#2831**
- Next PR: **#2835**
- Stack position: **30 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | **#2832** | #2831 | **refactor(cli): extract onboard actions** |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Reorganized CLI command handling to consolidate onboarding and setup
operations into a unified architecture for improved code organization.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts OpenShell command runtime helpers from `src/nemoclaw.ts` into a
dedicated module. This gives command action modules a single place to
resolve and invoke the OpenShell binary.

## Changes
- Add `src/lib/openshell-runtime.ts` with `getOpenshellBinary()`,
`runOpenshell()`, `captureOpenshell()`, and
`getInstalledOpenshellVersionOrNull()`.
- Update `src/nemoclaw.ts` to import those helpers instead of defining
them inline.
- Keep public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2835** in the stacked CLI oclif refactor series.

- Merge after: **#2832**
- Next PR: **#2836**
- Stack position: **31 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | **#2835** | #2832 | **refactor(cli): extract openshell runtime
helpers** |
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Improved internal code organization and maintainability by
consolidating runtime execution logic into a dedicated module.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts sandbox log handling from `src/nemoclaw.ts` into a dedicated
action module. This moves log source setup, audit-log enabling,
follow-mode process handling, and log argument construction out of the
CLI entrypoint.

## Changes
- Add `src/lib/sandbox-logs-action.ts` with the existing sandbox log
implementation.
- Update `src/lib/sandbox-runtime-actions.ts` to call the extracted logs
action directly.
- Remove the inline sandbox log helpers from `src/nemoclaw.ts`.
- Keep the existing CLI log behavior unchanged, including `--follow`
signal semantics and audit-log warnings.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2836** in the stacked CLI oclif refactor series.

- Merge after: **#2835**
- Next PR: **#2837**
- Stack position: **32 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | **#2836** | #2835 | **refactor(cli): extract sandbox logs
action** |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Tests**
  * Improved test coverage tracking for runtime components.

* **Refactor**
* Extracted sandbox logging functionality into a dedicated module to
improve code organization and maintainability.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts backup-all and garbage-collection maintenance actions from
`src/nemoclaw.ts` into a dedicated module. The maintenance oclif
adapters now call the extracted actions instead of reaching through the
runtime bridge for these commands.

## Changes
- Add `src/lib/maintenance-actions.ts` with `backupAll()` and
`garbageCollectImages()`.
- Update `src/lib/global-cli-actions.ts` to call extracted maintenance
actions directly.
- Remove backup/gc entries from the temporary runtime bridge and remove
inline implementations from `src/nemoclaw.ts`.
- Update image cleanup tests to inspect the new maintenance action
module.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2837** in the stacked CLI oclif refactor series.

- Merge after: **#2836**
- Next PR: **#2838**
- Stack position: **33 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | **#2837** | #2836 | **refactor(cli): extract maintenance
actions** |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Reorganized internal structure of backup and image cleanup operations
for improved code maintainability and organization.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts the snapshot command implementation from `src/nemoclaw.ts` into
a dedicated action module. Snapshot list/create/restore wrappers now
call the extracted action instead of the temporary runtime bridge.

## Changes
- Add `src/lib/snapshot-action.ts` with snapshot create/list/restore
logic and helpers.
- Update `src/lib/sandbox-runtime-actions.ts` to invoke the extracted
snapshot action.
- Remove inline snapshot helpers and `sandboxSnapshot` from the runtime
bridge in `src/nemoclaw.ts`.
- Keep public snapshot CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2838** in the stacked CLI oclif refactor series.

- Merge after: **#2837**
- Next PR: **#2839**
- Stack position: **34 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | **#2838** | #2837 | **refactor(cli): extract snapshot actions** |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Reorganized snapshot functionality implementation to improve code
organization and maintainability.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts policy and messaging-channel command implementations from
`src/nemoclaw.ts` into the policy/channel action module. This moves
policy add/remove/list and channels list/add/remove/start/stop behavior
out of the entrypoint.

## Changes
- Expand `src/lib/policy-channel-actions.ts` from a facade into the home
for policy and channel command actions.
- Update policy/channel oclif adapters and sandbox inspection commands
to call the extracted action functions.
- Remove policy/channel implementations and runtime bridge entries from
`src/nemoclaw.ts`.
- Keep public policy and channel CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2839** in the stacked CLI oclif refactor series.

- Merge after: **#2838**
- Next PR: **#2840**
- Stack position: **35 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | **#2839** | #2838 | **refactor(cli): extract policy and channels
actions** |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Refactor**
* Consolidated internal architecture for policy and channel management
operations, improving code organization and maintainability.
* Restructured runtime bridge wiring to use dynamic module loading
instead of static imports, enabling better separation of concerns.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Extracts credentials and list runtime support out of `src/nemoclaw.ts`.
Gateway recovery and registry recovery logic now live in library action
modules used by credentials and list command paths.

## Changes
- Add `src/lib/gateway-runtime-action.ts` for named NemoClaw gateway
recovery.
- Add `src/lib/registry-recovery-action.ts` for list/sandbox registry
recovery.
- Update credentials and list dependency wiring to use extracted runtime
modules instead of the temporary runtime bridge.
- Remove gateway/registry recovery entries from the runtime bridge.
- Keep public credentials and list behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2840** in the stacked CLI oclif refactor series.

- Merge after: **#2839**
- Next PR: **#2841**
- Stack position: **36 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | **#2840** | #2839 | **refactor(cli): extract credentials and list
runtime bits** |
| 37 | #2841 | #2840 | refactor(cli): shrink runtime bridge |
<!-- STACK-CONTEXT:END -->


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

* **New Features**
* Improved automatic detection and recovery of a selected OpenShell
gateway, including setting the active gateway when recovery succeeds.
* Registry repopulation from session and live gateway state to restore
missing sandbox entries.

* **Refactor**
* Moved gateway lifecycle and registry recovery logic into dedicated
modules for clearer behavior and easier maintenance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
cv added a commit that referenced this pull request May 2, 2026
## Summary
Shrinks the temporary NemoClaw runtime bridge to only the remaining
command actions that still live in `src/nemoclaw.ts`. Credentials
provider operations now call the extracted OpenShell runtime directly.

## Changes
- Remove `runOpenshell` from `NemoClawRuntimeBridge`.
- Update `src/lib/global-cli-actions.ts` to call `runOpenshell()`
directly for provider operations.
- Remove `runOpenshell` from the `runtimeBridge` object exported by
`src/nemoclaw.ts`.
- Keep public CLI behavior unchanged.

## 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>

<!-- STACK-CONTEXT:START -->
## Stack position

> [!NOTE]
> This PR is part of a stacked refactor. Please review/merge in stack
order.
> The current PR is highlighted below.

This is PR **#2841** in the stacked CLI oclif refactor series.

- Merge after: **#2840**
- Next PR: **None — this is the last PR in the stack.**
- Stack position: **37 / 37**

## Full stack

Merge from top to bottom.

| Order | PR | Merge after | Title |
|---:|---|---|---|
| 1 | #2775 | `main` | refactor(cli): migrate status and tunnel commands
to oclif |
| 2 | #2776 | #2775 | refactor(cli): migrate debug uninstall and
gateway-token to oclif |
| 3 | #2786 | #2776 | refactor(cli): migrate credentials commands to
oclif |
| 4 | #2787 | #2786 | refactor(cli): migrate sandbox inspection commands
to oclif |
| 5 | #2788 | #2787 | refactor(cli): migrate maintenance commands to
oclif |
| 6 | #2796 | #2788 | refactor(cli): migrate sandbox logs command to
oclif |
| 7 | #2797 | #2796 | refactor(cli): migrate skill install command to
oclif |
| 8 | #2798 | #2797 | refactor(cli): migrate snapshot list and create to
oclif |
| 9 | #2802 | #2798 | refactor(cli): migrate shields commands to oclif |
| 10 | #2803 | #2802 | refactor(cli): migrate channels mutation commands
to oclif |
| 11 | #2804 | #2803 | refactor(cli): migrate policy mutation commands
to oclif |
| 12 | #2805 | #2804 | refactor(cli): migrate snapshot restore command
to oclif |
| 13 | #2806 | #2805 | refactor(cli): migrate destroy command to oclif |
| 14 | #2807 | #2806 | refactor(cli): migrate rebuild command to oclif |
| 15 | #2808 | #2807 | refactor(cli): migrate connect command to oclif |
| 16 | #2809 | #2808 | refactor(cli): migrate deploy command to oclif |
| 17 | #2810 | #2809 | refactor(cli): migrate onboard aliases to oclif |
| 18 | #2811 | #2810 | refactor(cli): migrate help and version commands
to oclif |
| 19 | #2814 | #2811 | refactor(cli): centralize legacy oclif dispatch |
| 20 | #2815 | #2814 | refactor(cli): drop trivial oclif wrapper helpers
|
| 21 | #2816 | #2815 | refactor(cli): centralize sandbox runtime bridge
|
| 22 | #2817 | #2816 | refactor(cli): centralize policy and channels
runtime bridge |
| 23 | #2818 | #2817 | refactor(cli): centralize global runtime bridge |
| 24 | #2819 | #2818 | refactor(cli): collapse runtime bridge exports |
| 25 | #2826 | #2819 | refactor(cli): introduce sandbox runtime action
facade |
| 26 | #2827 | #2826 | refactor(cli): introduce policy and channels
action facade |
| 27 | #2828 | #2827 | refactor(cli): introduce global command action
facade |
| 28 | #2830 | #2828 | refactor(cli): extract root help action |
| 29 | #2831 | #2830 | refactor(cli): extract deploy action |
| 30 | #2832 | #2831 | refactor(cli): extract onboard actions |
| 31 | #2835 | #2832 | refactor(cli): extract openshell runtime helpers
|
| 32 | #2836 | #2835 | refactor(cli): extract sandbox logs action |
| 33 | #2837 | #2836 | refactor(cli): extract maintenance actions |
| 34 | #2838 | #2837 | refactor(cli): extract snapshot actions |
| 35 | #2839 | #2838 | refactor(cli): extract policy and channels
actions |
| 36 | #2840 | #2839 | refactor(cli): extract credentials and list
runtime bits |
| 37 | **#2841** | #2840 | **refactor(cli): shrink runtime bridge** |
<!-- STACK-CONTEXT:END -->


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

## Summary by CodeRabbit

* **Breaking Changes**
* Removed `runOpenshell` method from the runtime bridge API. External
consumers can no longer invoke this operation through the bridge
interface.

* **Refactor**
* Refactored shell command execution to implement fallback logic,
preferring local implementations when runtime bridge support is
unavailable.

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

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv
cv deleted the refactor/oclif-destroy 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