-
Notifications
You must be signed in to change notification settings - Fork 2.1k
refactor(cli): port debug.sh to TypeScript #1296
Copy link
Copy link
Open
Labels
NemoClaw CLIUse this label to identify issues with the NemoClaw command-line interface (CLI).Use this label to identify issues with the NemoClaw command-line interface (CLI).refactorThis is a refactor of the code and/or architecture.This is a refactor of the code and/or architecture.
Description
Summary
Port scripts/debug.sh (355 lines) to src/lib/debug.ts as part of the #924 shell consolidation.
This is the diagnostic collection script that gathers system info, Docker state, gateway logs, and sandbox status for nemoclaw debug. Currently implemented as a bash script that bin/nemoclaw.js shells out to.
Approach
- Write
src/lib/debug.tsusing execa (not child_process) for subprocess execution - Replace
bin/nemoclaw.js'sspawnSync("bash", ["scripts/debug.sh", ...])with a direct call to the TS module - Secret redaction must be preserved (the script filters API keys from output)
- Follow the established pattern: TS source in
src/lib/, compiled todist/lib/vianpm run build:cli - Co-locate tests in
src/lib/debug.test.ts, importing from../../dist/lib/debugfor coverage attribution
Context
- Part of refactor(cli): shell consolidation, TypeScript migration & oclif #924 PR 2 scope (port shell scripts to TS)
- No blocker PRs touch this file — safe to proceed immediately
- See refactor(cli): extract pure functions from onboard.js to typed TypeScript modules #1240 and refactor(cli): migrate preflight.js to TypeScript #1262 for the established migration pattern (thin shim in
bin/lib/, TS source insrc/lib/) - Coverage ratchet must pass — add tests, never lower thresholds
Not blocked by
Any of the #924 blocker PRs (#781, #782, #819, #672, #794, #634).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
NemoClaw CLIUse this label to identify issues with the NemoClaw command-line interface (CLI).Use this label to identify issues with the NemoClaw command-line interface (CLI).refactorThis is a refactor of the code and/or architecture.This is a refactor of the code and/or architecture.