Skip to content

feat: improve help menu#9

Open
reneaaron wants to merge 5 commits intomasterfrom
feat/improve-help-menu
Open

feat: improve help menu#9
reneaaron wants to merge 5 commits intomasterfrom
feat/improve-help-menu

Conversation

@reneaaron
Copy link

@reneaaron reneaaron commented Mar 12, 2026

Tried to cleanup the help menu for a bit and add some structure by separating the most common actions from very advanced ones:

image

Summary by CodeRabbit

  • New Features

    • CLI commands reorganized into Wallet Commands, Advanced Wallet Commands, and Lightning Tools.
    • New Lightning Tools added: verify preimage, request invoice from Lightning Address, and fetch L402.
  • Documentation

    • Expanded CLI description with multi-line example usage.
    • Added a prioritized "Connection Secret Resolution" section and security notes in help text.
  • Chores

    • Updated commander dependency to v14.0.3.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Warning

Rate limit exceeded

@reneaaron has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c014fff0-5ca9-4199-bf03-1cca7387f912

📥 Commits

Reviewing files that changed from the base of the PR and between 5f2e866 and 5a4051f.

📒 Files selected for processing (2)
  • package.json
  • src/index.ts
📝 Walkthrough

Walkthrough

The PR upgrades the commander dependency to v14.0.3 and reorganizes the CLI: adds multi-line examples and security/help text, implements command grouping via a new program.commandsGroup() method, and moves/reclassifies many command registrations into Wallet, Advanced Wallet, and Lightning Tools groups.

Changes

Cohort / File(s) Summary
Dependency Update
package.json
Bumped commander from ^13.1.0 to ^14.0.3.
CLI entry & grouping
src/index.ts
Extended CLI description and help text (examples, Connection Secret Resolution, security notes); added program.commandsGroup(groupName: string); created command groups (Wallet Commands, Advanced Wallet Commands, Lightning Tools) and reorganized command registrations accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through flags and grouped each command,
Wallet, Advanced, Lightning—neat at hand,
Help notes and secrets now lined in a row,
A tidy CLI garden where new features grow. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: improve help menu' directly aligns with the main change: reorganizing CLI commands into groups (Wallet Commands, Advanced Wallet Commands, Lightning Tools) and expanding the help documentation with examples and structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/improve-help-menu
📝 Coding Plan
  • Generate coding plan for human review comments

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

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 39: The package.json currently pins "commander": "^14.0.3" which requires
Node.js 20+ (used for the .commandsGroup() API in src/index.ts); update
package.json to either add an "engines": { "node": ">=20" } field to declare the
new runtime floor, or if you must remain Node 18-compatible, change the
commander dependency back to a 13.x release (e.g. ^13) and adjust any use of
.commandsGroup() in src/index.ts accordingly.

In `@src/index.ts`:
- Around line 29-35: Update the CLI description string in src/index.ts (the
.description(...) call) to stop showing the raw NWC secret in the command-line
example; instead show a secure pattern such as passing a file path or using a
prompt flag (e.g., replace "--connection-secret nostr+walletconnect://..." with
something like "--connection-secret-file /path/to/secret" or
"--connection-secret-stdin" in the examples), and adjust any example lines
referencing get-balance / pay-invoice accordingly so the examples demonstrate
reading the secret from a file or stdin rather than exposing the raw
nostr+walletconnect URI.
- Around line 41-54: The help text block is being attached to all commands via
addHelpText("afterAll", ...) causing connection-secret guidance to appear on
subcommands; change the hook key to "after" so the text is only shown on the
top-level help. Locate the addHelpText call in src/index.ts (the call that
currently uses "afterAll" with the Connection Secret Resolution / Security text)
and replace "afterAll" with "after" so subcommand help no longer includes the
wallet/connection-secret guidance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d560046b-f15f-443e-84f1-4de50ad9dd62

📥 Commits

Reviewing files that changed from the base of the PR and between b559705 and 4ceb3c8.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • package.json
  • src/index.ts

reneaaron and others added 3 commits March 12, 2026 20:31
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
.description(
"CLI for Nostr Wallet Connect (NIP-47) with lightning tools\n\n" +
" Examples:\n" +
" $ alby-cli --connection-secret /path/to/secret.key get-balance\n" +
Copy link
Collaborator

Choose a reason for hiding this comment

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

by default we shouldn't need to pass a secret. Can this be removed?

And is it really good to have more than one example here? doesn't this duplicate the help and waste context?

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