Skip to content

fix(installer): show help text on error and document --profile full#963

Open
affaan-m wants to merge 5 commits intomainfrom
fix/install-show-help-on-error
Open

fix(installer): show help text on error and document --profile full#963
affaan-m wants to merge 5 commits intomainfrom
fix/install-show-help-on-error

Conversation

@affaan-m
Copy link
Copy Markdown
Owner

@affaan-m affaan-m commented Mar 27, 2026

Summary

Verification

  • \ exits 1 with zero stdout
  • stderr contains both the error line and the full usage block

Summary by cubic

Improve installer UX by showing usage help on parse errors and sending it to stderr with the error; quick-start now recommends --profile full. CI now supports yarn 4 and pnpm installs via Corepack shims and relaxed pnpm strict mode.

  • Bug Fixes
    • On argument parse errors, write the error plus usage help to stderr and exit 1 (no stdout); tightened spacing.
    • Centralize help text with getHelpText() and route error-path help to stderr for consistent redirects.
    • CI: enable Corepack, set COREPACK_ENABLE_STRICT=0 for pnpm, and use yarn install --mode=skip-build to support yarn 4 and pnpm in the matrix.

Written for commit cc13a51. Summary will update on new commits.

Summary by CodeRabbit

  • Documentation

    • Added recommended full-profile install commands for macOS/Linux and Windows PowerShell; clarified per-language install examples.
  • Refactor

    • Improved CLI help behavior to consistently display full usage/help text, including when errors occur.
  • Chores

    • CI workflow: adjusted package-manager install steps and step environment to better support Yarn and PNPM.

prabithbalagopalan and others added 2 commits March 27, 2026 06:25
…n README

Running install.ps1/install.sh with no arguments gave a cryptic error
with no guidance. Now the usage help is printed after the error so users
know what arguments to pass.

Also added --profile full as the recommended install option in the README
quick-start section, which was previously undocumented.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ream output

Extracted help text into getHelpText() and write both the error message
and usage help to stderr via process.stderr.write(). This ensures that
when output is redirected (e.g. 2>errors.txt), both the error and the
guidance appear in the same stream.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

affaan-m has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3877e306-e218-4957-91a5-d3ef54db5260

📥 Commits

Reviewing files that changed from the base of the PR and between 5d6cd22 and cc13a51.

📒 Files selected for processing (1)
  • scripts/install-apply.js

📝 Walkthrough

Walkthrough

Refined README install instructions (adds --profile full examples), centralized CLI help text in getHelpText() and updated error output, and adjusted CI to conditionally enable Corepack and change pnpm/yarn install commands and pnpm cache env.

Changes

Cohort / File(s) Summary
Documentation
README.md
Added recommended Quick Start install commands using --profile full for macOS/Linux and Windows PowerShell; clarified per-language install example usage (e.g., ./install.sh typescript).
Installer script
scripts/install-apply.js
Extracted inline help into a new getHelpText(); showHelp() now prints that text; error handling now writes Error: ... and appends full help text to stderr.
CI workflow
.github/workflows/ci.yml
Added conditional corepack enable step for yarn/pnpm; set COREPACK_ENABLE_STRICT=0 for pnpm caching; changed install commands to COREPACK_ENABLE_STRICT=0 pnpm install and yarn install --mode=skip-build.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through README under starlit pull,

Added "full" for installs, tidy and full.
Help found a home where errors now sing,
CI wakes Corepack, and yarn takes wing,
A carrot-click for every tiny pull 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: showing help text on installer errors and documenting the --profile full option in README.

✏️ 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 fix/install-show-help-on-error

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.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

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.

🧹 Nitpick comments (1)
scripts/install-apply.js (1)

143-146: Minor formatting nit: extra blank line in error output.

getHelpText() returns a string starting with \n (line 22), so combined with \n\n here, the output will have three consecutive newlines between the error and usage text. Consider either removing one \n here or trimming the leading newline from getHelpText().

🔧 Optional fix
-    process.stderr.write(`Error: ${error.message}\n\n${getHelpText()}`);
+    process.stderr.write(`Error: ${error.message}\n${getHelpText()}`);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/install-apply.js` around lines 143 - 146, The error output currently
produces an extra blank line because getHelpText() already starts with a leading
newline; update the catch block that calls process.stderr.write (the try/catch
around the install/apply flow) to avoid double newlines by either removing one
of the `\n` in the template string or by trimming the leading newline from
getHelpText() so the final write uses a single newline between the error message
and the help text; adjust the call site or the getHelpText() function
accordingly to ensure exactly one newline separation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@scripts/install-apply.js`:
- Around line 143-146: The error output currently produces an extra blank line
because getHelpText() already starts with a leading newline; update the catch
block that calls process.stderr.write (the try/catch around the install/apply
flow) to avoid double newlines by either removing one of the `\n` in the
template string or by trimming the leading newline from getHelpText() so the
final write uses a single newline between the error message and the help text;
adjust the call site or the getHelpText() function accordingly to ensure exactly
one newline separation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ec0b8427-cdc4-4e17-9e39-9a6f56c2fa04

📥 Commits

Reviewing files that changed from the base of the PR and between 8b6140d and 384fe95.

📒 Files selected for processing (2)
  • README.md
  • scripts/install-apply.js

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

affaan-m has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

affaan-m has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

affaan-m has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants