Support non-interactive mode in npx-thunderid for AI tools and CI environments#3077
Support non-interactive mode in npx-thunderid for AI tools and CI environments#3077rajithacharith wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 18 minutes and 7 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesNon-interactive install directory support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/npx-thunderid/src/index.ts`:
- Around line 37-40: The loop handling CLI args currently lets a bare
"--install-dir" fall through to forwardedArgs when it's the last token; update
the branch that checks "arg === '--install-dir'" to fail fast if there is no
following value (i + 1 >= argv.length) by printing a clear error and exiting (or
throwing) instead of forwarding it, and still consume the next token into
installDir when present (i.e., keep the existing installDir = argv[++i] behavior
and do not push the flag to forwardedArgs in the error or success cases);
reference the variables argv, arg, installDir, forwardedArgs and the
argument-parsing loop in index.ts.
🪄 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 Plus
Run ID: b00b80b7-f8fa-408c-a969-e291db9add39
📒 Files selected for processing (1)
tools/npx-thunderid/src/index.ts
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
1e3b439 to
6c11323
Compare
Purpose
npx thunderidhangs in non-interactive environments (AI coding tools, CI pipelines) because the install directory prompt uses@clack/promptstext(), which requires a TTY. There was no way to run a fully unattended setup without interactive input.Approach
Added
--install-dir <path>CLI flag andTHUNDER_INSTALL_DIRenv var totools/npx-thunderid/src/index.ts. When either is provided, the interactive install directory prompt is skipped entirely. Admin credentials already flow through tosetup.shvia--admin-username/--admin-passwordflags andADMIN_USERNAME/ADMIN_PASSWORDenv vars.Non-interactive usage:
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks
Summary by CodeRabbit
New Features
--install-dir <path>CLI option to specify custom installation directory.THUNDER_INSTALL_DIRenvironment variable support for installation path configuration.Bug Fixes