Skip to content

refactor(cli): delete setup.sh, route all setup through nemoclaw onboard#1235

Merged
cv merged 4 commits intomainfrom
cv/delete-setup-sh-v2
Apr 1, 2026
Merged

refactor(cli): delete setup.sh, route all setup through nemoclaw onboard#1235
cv merged 4 commits intomainfrom
cv/delete-setup-sh-v2

Conversation

@cv
Copy link
Copy Markdown
Contributor

@cv cv commented Apr 1, 2026

Summary

  • Delete scripts/setup.sh (324 lines) — every step it performed is already handled by nemoclaw onboard with better error recovery (exponential backoff via pRetry), interactive prompts, registry management, and WSL2-aware Ollama binding
  • nemoclaw setup now delegates to onboard instead of shelling out to the deleted script
  • brev-setup.sh installs the nemoclaw CLI and runs nemoclaw onboard --non-interactive instead of calling setup.sh
  • Remove setup.sh-specific tests and assertions (3 test removals across 3 files); all equivalent assertions against onboard.js already exist

Test plan

  • 541 CLI tests pass (vitest run --project cli)
  • Verify nemoclaw setup prints deprecation notice and runs onboard
  • Verify brev-setup.sh bootstraps correctly on a fresh Brev VM (E2E)

Relates to #924 (shell consolidation). Supersedes #1230.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Migrated legacy setup to a unified onboarding flow and removed the old top-level setup orchestration.
  • Chores

    • Updated bootstrap to build/install the CLI locally and run onboarding non-interactively.
    • Adjusted setup walkthrough instructions to reference onboarding.
  • Tests

    • Removed tests tied to the removed setup script and sandbox-name behavior.
    • Added CLI dispatch tests verifying setup argument forwarding into onboarding.

scripts/setup.sh (324 lines) duplicated every step that
`nemoclaw onboard` already handles with better error recovery,
exponential backoff, interactive prompts, and registry management.

- Delete scripts/setup.sh and its dedicated test file
- `nemoclaw setup` now delegates to onboard instead of shelling out to
  the deleted script
- brev-setup.sh installs the CLI and runs `nemoclaw onboard
  --non-interactive` instead of calling setup.sh
- Remove setup.sh assertions from gateway-cleanup and runner tests
- Update comments in walkthrough.sh and brev-e2e.test.js

Relates to #924 (shell consolidation).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1442e157-7399-42ef-9031-ad538c708687

📥 Commits

Reviewing files that changed from the base of the PR and between c7940c3 and a7b7a65.

📒 Files selected for processing (3)
  • bin/nemoclaw.js
  • test/cli.test.js
  • test/e2e/brev-e2e.test.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/e2e/brev-e2e.test.js
  • bin/nemoclaw.js

📝 Walkthrough

Walkthrough

The changes replace the legacy scripts/setup.sh bash installer with a unified CLI onboarding flow: bin/nemoclaw.js's setup delegates to onboard, bootstrap scripts install and run the local nemoclaw CLI, and multiple tests referencing setup.sh were removed or updated.

Changes

Cohort / File(s) Summary
CLI Setup Consolidation
bin/nemoclaw.js
setup(args=[]) now accepts CLI args and delegates entirely to the onboard(args) flow; legacy orchestration (prints, ensureApiKey, sanitized sandbox name, and invoking setup.sh) removed.
Bootstrap & Walkthrough Scripts
scripts/brev-setup.sh, scripts/walkthrough.sh
brev-setup.sh now resolves repo path, configures npm_config_prefix and PATH, installs/builds/links local nemoclaw CLI (suppressed output), and runs nemoclaw onboard --non-interactive; walkthrough.sh docs updated to reference nemoclaw onboard.
Removed Legacy Installer
scripts/setup.sh
Deleted full legacy bash setup script that performed environment checks, Docker/gateway orchestration, provider registration, sandbox build/create, DNS and coredns tweaks, and post-create validation.
E2E & Test Adjustments
test/e2e/brev-e2e.test.js, test/cli.test.js
E2E beforeAll no longer builds/links CLI from repo; verifies installed CLI via npm_config_prefix/PATH and checks ~/.nemoclaw/sandboxes.json contents. New CLI dispatch tests added asserting setup forwards args and emits deprecation/errors.
Removed Legacy Tests
test/gateway-cleanup.test.js, test/runner.test.js, test/setup-sandbox-name.test.js
Deleted tests that statically inspected scripts/setup.sh for Docker cleanup, credential exposure patterns, and sandbox-name parameterization; removed related assertions and suites.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~55 minutes

Poem

🐇 I hopped through scripts both old and new,
Swapped bash for CLI and tidy glue.
setup.sh retired with a grateful thump,
onboard now runs—one lighter jump. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: deleting setup.sh and routing all setup through the nemoclaw onboard command, which is the primary objective of this refactoring PR.

✏️ 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 cv/delete-setup-sh-v2

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

@cv cv requested review from ericksoa and jyaunches April 1, 2026 07:16
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
test/e2e/brev-e2e.test.js (2)

172-187: Drop the second CLI install and just verify visibility.

scripts/brev-setup.sh now performs the same npm_config_prefix/npm link sequence, so this re-runs a networked install for no new state and adds more flake to an already long E2E bootstrap. A which nemoclaw && nemoclaw --version sanity check should be enough here.

💡 Suggested simplification
-    // Install nemoclaw CLI into ~/.local so test helper scripts can find it.
-    // brev-setup.sh already installs and runs onboard, but npm link there uses
-    // the default prefix; re-linking here with npm_config_prefix ensures the
-    // binary lands on the PATH used by runRemoteTest.
-    console.log(`[${elapsed()}] Installing nemoclaw CLI...`);
+    // Verify the CLI installed by brev-setup.sh is visible to the non-login
+    // SSH sessions used by runRemoteTest.
+    console.log(`[${elapsed()}] Verifying nemoclaw CLI...`);
     ssh(
       [
         `export npm_config_prefix=$HOME/.local`,
         `export PATH=$HOME/.local/bin:$PATH`,
-        `cd ${remoteDir}/nemoclaw && npm install && npm run build`,
-        `cd ${remoteDir} && npm install --ignore-scripts && npm link`,
         `which nemoclaw && nemoclaw --version`,
       ].join(" && "),
       { timeout: 120_000 },
     );
-    console.log(`[${elapsed()}] nemoclaw CLI installed`);
+    console.log(`[${elapsed()}] nemoclaw CLI verified`);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/brev-e2e.test.js` around lines 172 - 187, Remove the redundant
second CLI install in the SSH command sequence inside the E2E test: the ssh(...)
call currently runs `cd ${remoteDir}/nemoclaw && npm install && npm run build`
plus a separate `cd ${remoteDir} && npm install --ignore-scripts && npm link`;
since brev-setup.sh already performs the npm_config_prefix/npm link step, drop
the latter install/link commands and only run the visibility check (`which
nemoclaw && nemoclaw --version`) after the build step (or replace the whole ssh
command block with a simpler visibility-only check), updating the ssh invocation
in test/e2e/brev-e2e.test.js accordingly so the test no longer re-runs networked
installs.

189-211: Assert the onboard-written registry instead of replacing it.

bin/lib/onboard.js already writes ~/.nemoclaw/sandboxes.json during successful onboarding. Replacing the file here means the suite stops checking that the new onboard-based bootstrap actually persisted the sandbox entry. If you need determinism, normalize only the volatile fields like createdAt.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/brev-e2e.test.js` around lines 189 - 211, Replace the hard overwrite
of ~/.nemoclaw/sandboxes.json with an assertion that the onboard step actually
persisted the registry: use the existing ssh(...) helper to cat
~/.nemoclaw/sandboxes.json, parse the JSON, assert that
json.sandboxes['e2e-test'] exists and json.defaultSandbox === 'e2e-test', and
when comparing to an expected object normalize volatile fields (e.g., set
createdAt, model, nimContainer to fixed values or delete them) before doing
deep-equality checks; update the code around the ssh(...) call and the elapsed()
log to perform these reads/assertions instead of writing the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bin/nemoclaw.js`:
- Around line 623-629: Change setup so it forwards the CLI arguments into the
existing onboard parser instead of dropping them: update async function setup()
to accept an argv parameter (or use process.argv.slice(2) if not passed) and
call the onboard entry (the runOnboard export from ./lib/onboard) with that argv
so the onboard parser handles --non-interactive, --resume and unknown flags
(e.g. await runOnboard({ argv }) or await runOnboard({ argv, nonInteractive:
false, resume: false }) depending on runOnboard's signature); make the same
change to the duplicate setup alias at the other location so both deprecated
aliases forward args to runOnboard.

---

Nitpick comments:
In `@test/e2e/brev-e2e.test.js`:
- Around line 172-187: Remove the redundant second CLI install in the SSH
command sequence inside the E2E test: the ssh(...) call currently runs `cd
${remoteDir}/nemoclaw && npm install && npm run build` plus a separate `cd
${remoteDir} && npm install --ignore-scripts && npm link`; since brev-setup.sh
already performs the npm_config_prefix/npm link step, drop the latter
install/link commands and only run the visibility check (`which nemoclaw &&
nemoclaw --version`) after the build step (or replace the whole ssh command
block with a simpler visibility-only check), updating the ssh invocation in
test/e2e/brev-e2e.test.js accordingly so the test no longer re-runs networked
installs.
- Around line 189-211: Replace the hard overwrite of ~/.nemoclaw/sandboxes.json
with an assertion that the onboard step actually persisted the registry: use the
existing ssh(...) helper to cat ~/.nemoclaw/sandboxes.json, parse the JSON,
assert that json.sandboxes['e2e-test'] exists and json.defaultSandbox ===
'e2e-test', and when comparing to an expected object normalize volatile fields
(e.g., set createdAt, model, nimContainer to fixed values or delete them) before
doing deep-equality checks; update the code around the ssh(...) call and the
elapsed() log to perform these reads/assertions instead of writing the file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1c47e23f-9a56-42ff-8ef1-4f892e87570b

📥 Commits

Reviewing files that changed from the base of the PR and between 39e9b1f and c7940c3.

📒 Files selected for processing (8)
  • bin/nemoclaw.js
  • scripts/brev-setup.sh
  • scripts/setup.sh
  • scripts/walkthrough.sh
  • test/e2e/brev-e2e.test.js
  • test/gateway-cleanup.test.js
  • test/runner.test.js
  • test/setup-sandbox-name.test.js
💤 Files with no reviewable changes (4)
  • test/gateway-cleanup.test.js
  • test/runner.test.js
  • test/setup-sandbox-name.test.js
  • scripts/setup.sh

@cv cv enabled auto-merge (squash) April 1, 2026 20:31
@cv cv merged commit 7c3687e into main Apr 1, 2026
8 checks passed
@wscurran wscurran added NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). refactor This is a refactor of the code and/or architecture. labels Apr 1, 2026
laitingsheng pushed a commit that referenced this pull request Apr 2, 2026
…ard (#1235)

## Summary

- Delete `scripts/setup.sh` (324 lines) — every step it performed is
already handled by `nemoclaw onboard` with better error recovery
(exponential backoff via pRetry), interactive prompts, registry
management, and WSL2-aware Ollama binding
- `nemoclaw setup` now delegates to `onboard` instead of shelling out to
the deleted script
- `brev-setup.sh` installs the nemoclaw CLI and runs `nemoclaw onboard
--non-interactive` instead of calling setup.sh
- Remove setup.sh-specific tests and assertions (3 test removals across
3 files); all equivalent assertions against `onboard.js` already exist

## Test plan

- [x] 541 CLI tests pass (`vitest run --project cli`)
- [ ] Verify `nemoclaw setup` prints deprecation notice and runs onboard
- [ ] Verify `brev-setup.sh` bootstraps correctly on a fresh Brev VM
(E2E)

Relates to #924 (shell consolidation). Supersedes #1230.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* **Refactor**
* Migrated legacy setup to a unified onboarding flow and removed the old
top-level setup orchestration.

* **Chores**
* Updated bootstrap to build/install the CLI locally and run onboarding
non-interactively.
  * Adjusted setup walkthrough instructions to reference onboarding.

* **Tests**
* Removed tests tied to the removed setup script and sandbox-name
behavior.
* Added CLI dispatch tests verifying setup argument forwarding into
onboarding.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lakamsani pushed a commit to lakamsani/NemoClaw that referenced this pull request Apr 4, 2026
…ard (NVIDIA#1235)

## Summary

- Delete `scripts/setup.sh` (324 lines) — every step it performed is
already handled by `nemoclaw onboard` with better error recovery
(exponential backoff via pRetry), interactive prompts, registry
management, and WSL2-aware Ollama binding
- `nemoclaw setup` now delegates to `onboard` instead of shelling out to
the deleted script
- `brev-setup.sh` installs the nemoclaw CLI and runs `nemoclaw onboard
--non-interactive` instead of calling setup.sh
- Remove setup.sh-specific tests and assertions (3 test removals across
3 files); all equivalent assertions against `onboard.js` already exist

## Test plan

- [x] 541 CLI tests pass (`vitest run --project cli`)
- [ ] Verify `nemoclaw setup` prints deprecation notice and runs onboard
- [ ] Verify `brev-setup.sh` bootstraps correctly on a fresh Brev VM
(E2E)

Relates to NVIDIA#924 (shell consolidation). Supersedes NVIDIA#1230.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* **Refactor**
* Migrated legacy setup to a unified onboarding flow and removed the old
top-level setup orchestration.

* **Chores**
* Updated bootstrap to build/install the CLI locally and run onboarding
non-interactively.
  * Adjusted setup walkthrough instructions to reference onboarding.

* **Tests**
* Removed tests tied to the removed setup script and sandbox-name
behavior.
* Added CLI dispatch tests verifying setup argument forwarding into
onboarding.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants