Skip to content

More bitcore-cli tweaks and improvements#4177

Open
kajoseph wants to merge 5 commits into
bitpay:masterfrom
kajoseph:bitcoreCli
Open

More bitcore-cli tweaks and improvements#4177
kajoseph wants to merge 5 commits into
bitpay:masterfrom
kajoseph:bitcoreCli

Conversation

@kajoseph
Copy link
Copy Markdown
Collaborator

Description

Fixes various bitcore-cli bugs and makes some flow improvements

Changelog

  • TSS Creation flow:
    • Adds helper instructions for the pub key/join code exchange
    • Replaces mnemonic backup with keyshare file backup
  • Creation flow: skips address type prompt if only 1 address type available (e.g. DOGE)
  • Creation flow: updated wallet password setting prompts to better reflect the Unlock wallet prompt. This is to assist user comprehension when exporting a wallet, which asks for an encryption password immediately followed by an unlock password (non read-only export).
  • Improves text modding functions (colorText, boldText, etc.) to undo the mods rather than resetting to \x1b[0m (which also removes any previous text formatting)
  • Fixed opts.readonly being false in exportWallet()
  • Blocks --register from working on a TSS wallet since that'll register the wallet as just a single-sig wallet
  • Fixes tests
  • Updates the bin from wallet (very generic) to bitcore-cli (more specific)

Testing Notes

Add any helpful notes for reviewers to test your code here.


Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.

@kajoseph kajoseph added the bitcore-cli This pull request modifies the bitcore-cli package label May 27, 2026
@kajoseph kajoseph requested a review from Copilot May 27, 2026 00:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves bitcore-cli wallet creation/export UX, especially for TSS wallets, and updates tests for the new flows and ANSI formatting behavior.

Changes:

  • Reworks TSS creation/join completion to prompt for encrypted keyshare backups instead of showing mnemonic-only recovery.
  • Updates CLI prompt wording, address-type prompting, TSS registration handling, and export/import password labels.
  • Adjusts ANSI formatting helpers/tests and renames the package bin command to bitcore-cli.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/bitcore-cli/package.json Renames the exposed CLI bin from wallet to bitcore-cli.
packages/bitcore-cli/src/constants.ts Changes color reset sequences and marks constants readonly.
packages/bitcore-cli/src/utils.ts Uses targeted ANSI style-off sequences for text formatting helpers.
packages/bitcore-cli/src/prompts.ts Adds single-option address type shortcut and TSS keyshare backup prompt.
packages/bitcore-cli/src/wallet.ts Uses cached reload after TSS creation and updates unlock prompt wording.
packages/bitcore-cli/src/commands/create/index.ts Skips mnemonic display when TSS creation returns no mnemonic.
packages/bitcore-cli/src/commands/create/createSingleSig.ts Updates wallet password prompt wording.
packages/bitcore-cli/src/commands/create/createMultiSig.ts Updates wallet password prompt wording.
packages/bitcore-cli/src/commands/create/createThresholdSig.ts Adds TSS exchange instructions and keyshare backup export flow.
packages/bitcore-cli/src/commands/join/index.ts Skips mnemonic display for TSS join flow.
packages/bitcore-cli/src/commands/join/joinMultiSig.ts Updates wallet password prompt wording.
packages/bitcore-cli/src/commands/join/joinThresholdSig.ts Adds TSS keyshare backup export flow after joining.
packages/bitcore-cli/src/commands/export.ts Fixes programmatic readonly: false handling and renames export password prompt.
packages/bitcore-cli/src/commands/import.ts Renames import password prompt.
packages/bitcore-cli/src/commands/register.ts Blocks registering existing TSS wallets as regular single-sig wallets.
packages/bitcore-cli/src/commands/status.ts Updates wallet info title casing.
packages/bitcore-cli/test/utils.test.ts Updates ANSI formatting expectations.
packages/bitcore-cli/test/proposals.test.ts Updates proposal badge ANSI reset expectations.
packages/bitcore-cli/test/create.test.ts Updates TSS create tests for keyshare backup export and assertions.
packages/bitcore-cli/test/tssCoordinator.ts Changes TSS test process EOF coordination.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/bitcore-cli/src/commands/register.ts Outdated
Comment thread packages/bitcore-cli/test/tssCoordinator.ts Outdated
@kajoseph kajoseph requested a review from MichaelAJay May 27, 2026 01:04

if (key.isPrivKeyEncrypted() || (key as TssKey.TssKey).isKeyChainEncrypted?.()) {
const walletPassword = await getPassword('Wallet password:');
const walletPassword = await getPassword('Unlock wallet:');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fine as is, but "Unlock wallet with wallet password", on the same terminal screen as "File encryption password", would be even more friendly.

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

Labels

bitcore-cli This pull request modifies the bitcore-cli package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants