Skip to content

feat: add top-level account and receive commands - #31

Merged
Drincann merged 1 commit into
mainfrom
feat/command-shortcuts
Jun 10, 2026
Merged

feat: add top-level account and receive commands#31
Drincann merged 1 commit into
mainfrom
feat/command-shortcuts

Conversation

@Drincann

@Drincann Drincann commented Jun 10, 2026

Copy link
Copy Markdown
Owner

PR Type

Enhancement, Tests


Description

  • Add top-level account command aliases

  • Add top-level receive command alias

  • Refactor wallet command factories

  • Cover aliases with E2E tests


Diagram Walkthrough

flowchart LR
  A["bitcold CLI"] 
  B["wallet account / wallet receive"]
  C["account / receive shortcuts"]
  D["shared command factories"]
  E["same wallet behavior"]

  A -- "supports existing commands" --> B
  A -- "adds top-level aliases" --> C
  B -- "created by" --> D
  C -- "created by" --> D
  D -- "executes" --> E
Loading

File Walkthrough

Relevant files
Tests
wallet-lifecycle.test.ts
Test top-level account and receive aliases                             

tests/e2e/wallet-lifecycle.test.ts

  • Adds E2E coverage for top-level account add.
  • Verifies wallet listing includes the aliased account.
  • Adds E2E coverage for top-level receive.
  • Confirms shortcut receive address matches wallet receive.
+34/-0   
Enhancement
index.mts
Export reusable top-level shortcut commands                           

src/cli/commands/index.mts

  • Imports command factory creators for account and receive.
  • Exports top-level accountCommand.
  • Exports top-level receiveCommand.
  • Keeps existing wallet and transaction command exports.
+6/-3     
account.mts
Refactor account commands into factories                                 

src/cli/commands/wallet/account.mts

  • Wraps account add/remove definitions in factory functions.
  • Adds createWalletAccountCommand() for reusable command construction.
  • Preserves existing exported walletAccount*Command constants.
  • Keeps account validation, prompting, and persistence behavior
    unchanged.
+85/-75 
receive.mts
Refactor receive command into factory                                       

src/cli/commands/wallet/receive.mts

  • Wraps receive command definition in createWalletReceiveCommand().
  • Preserves address derivation, output, and QR behavior.
  • Exports existing walletReceiveCommand from the factory.
+19/-15 
index.mts
Register top-level account and receive commands                   

src/cli/index.mts

  • Imports new accountCommand and receiveCommand.
  • Registers account as a top-level CLI command.
  • Registers receive as a top-level CLI command.
  • Keeps existing wallet and tx command registration.
+4/-2     

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@Drincann
Drincann merged commit f307f3b into main Jun 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant