-
-
Notifications
You must be signed in to change notification settings - Fork 389
Add CLI #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add CLI #142
Conversation
…ands - Add CLI entry point using Click - Add Click as runtime dependency Signed-off-by: Willian Paixao <willian@ufpa.br>
There was a problem hiding this 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 adds a command-line interface to the python-mnemonic library, enabling users to generate, validate, and derive seeds from BIP-39 mnemonic phrases directly from the terminal.
Key changes:
- Implements three CLI commands using Click framework:
create(generate mnemonics),check(validate mnemonics), andto-seed(derive seeds) - Adds Click as a runtime dependency with flexible version constraint (^8.0)
- Updates documentation with CLI usage examples and command descriptions
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mnemonic/cli.py | New file implementing the CLI with three commands for mnemonic generation, validation, and seed derivation |
| pyproject.toml | Adds Click dependency and configures the mnemonic script entry point |
| README.rst | Adds CLI usage documentation with examples and fixes spelling error ("mnenomic" → "mnemonic") |
| CHANGELOG.rst | Documents the new CLI feature in version 0.22 |
| .github/workflows/python-package.yml | Enhances CI workflow to build distribution packages and validate package metadata |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Willian Paixao <willian@ufpa.br>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Copilot gave me a lot more feedback than I expected. I thought it would be simpler/easier PR. @matejcik this is ready for review. |
Summary
This PR adds a command-line interface to the python-mnemonic library, making it easy to generate, validate, and derive seeds from BIP-39 mnemonic phrases directly from the terminal.
New Commands
mnemonic create- Generate a new mnemonic phrase and its derived seed-l, --language- Wordlist language (default: english)-s, --strength- Entropy bits: 128, 160, 192, 224, or 256 (default: 128)-p, --passphrase- Optional passphrase for seed derivationmnemonic check- Validate a mnemonic phrase's checksum-l, --language- Wordlist language (auto-detected if not specified)mnemonic to-seed- Derive a 64-byte seed from a mnemonic phrase-p, --passphrase- Optional passphrase for seed derivationUsage Examples
Test Plan
mnemonic creategenerates valid mnemonic and seedmnemonic checkreturns exit 0 for valid mnemonicmnemonic checkreturns exit 1 for invalid mnemonicmnemonic to-seedoutputs correct seed in hex formatcheckandto-seedcheck