refactor(cli): require skill install path in oclif - #2909
Conversation
|
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe ChangesSkill Install Path Requirement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
## Summary Improve the oclif shape for sandbox snapshot commands by adding examples and making the parent command a strict adapter. This keeps public snapshot help stable while allowing unknown snapshot subcommands to fail before reaching the snapshot action. ## Stack Navigation - Position: 16 of 60 - Previous PR: [#2907 — refactor(cli): tighten policy and channel parser validation](#2907) - Next PR: [#2909 — refactor(cli): require skill install path in oclif](#2909) ## Changes - Added examples for the snapshot parent plus `create`, `list`, and `restore` subcommands. - Made the parent `sandbox:snapshot` command strict and sandbox-arg aware. - Routed `nemoclaw <name> snapshot --help` through the parent adapter while preserving public usage text. - Added adapter and CLI coverage for parent usage and unknown snapshot subcommands. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added usage examples and clearer help documentation for snapshot commands. * **Bug Fixes** * Help flag now shows snapshot usage instead of being treated as an argument. * Invalid snapshot subcommands are rejected earlier (extra/unknown args now error). * Installer: tightened non-interactive check to fail fast when stdin is not a TTY. * **Tests** * Added tests verifying snapshot help display and invalid-subcommand error handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
prekshivyas
left a comment
There was a problem hiding this comment.
LGTM. Tiny, well-tested tightening — 3 files / +20 / -8.
SkillInstallCliCommand.skillPath flips to required: true; oclif now rejects <name> skill install (no path) at parse time before the action runs. run() simplifies accordingly. The PR description explicitly preserves filesystem + OpenClaw-plugin-shape detection in the action layer for the path-provided-but-invalid case — the friendly remediation text stays.
Tests: unit test renamed and rewritten to assert the rejection (/path/i thrown, action not called); new CLI integration test in test/cli.test.ts:797-805 asserts non-zero exit + "path" in output. Examples added to parent SkillCliCommand and SkillInstallCliCommand.
CI: pr.yaml mostly green (lint/dco/check-hash/legacy-path-guard/changes PASS); pr-self-hosted builds and macos/wsl-e2e + checks still in flight at review time. No failures.
Scope hygiene clean — no drive-by drift this round. src/nemoclaw.ts untouched.
## Summary Add consistent `-y` confirmation aliases and examples across lifecycle-oriented oclif commands. This keeps confirmation semantics unchanged while documenting the parser-owned aliases in command help and root help metadata. ## Stack Navigation - Position: 18 of 60 - Previous PR: [#2909 — refactor(cli): require skill install path in oclif](#2909) - Next PR: [#2911 — refactor(cli): split share into oclif subcommands](#2911) ## Changes - Added `-y` aliases for `destroy`, `rebuild`, `upgrade-sandboxes`, and `gc` confirmation flags. - Added examples for `destroy` and `rebuild` command metadata. - Updated public help/registry usage strings for lifecycle commands. - Exercised `destroy -y` through an existing lifecycle CLI subprocess test. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Move missing
skill install <path>validation into the oclif adapter while keeping plugin-shape detection in the skill install action. This also adds help examples for the parent skill command and direct install command.Stack Navigation
Changes
skillandskill installcommand metadata.sandbox:skill:installrequire a skill directory orSKILL.mdpath before dispatch.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Documentation
skill installcommand, showing how to install a skill package from a directory or SKILL.md file.Bug Fixes
skill installcommand now enforces the requirement for a path argument. The command previously allowed invocation without specifying a path.