ms-cli v0.1.0 — companion CLI for ms-codec
Companion CLI to ms-codec v0.1.0. Encode BIP-39 entropy as ms1 strings for steel-plate engraving; decode/inspect/verify engraved strings; dump the SHA-pinned test-vector corpus.
Install
cargo install ms-cliThe installed binary is ms.
What's new
- 5 subcommands: encode / decode / inspect / verify / vectors.
- Phrase-first encode (
--phraseheadline;--hexcodec-thin escape hatch); structured--jsonoutput mode across every command. - Strip-whitespace stdin uniform across commands — handles pipe round-trip (
ms encode | ms verify -), engraver-typed-back chunked form (printf "ms10e ntrsq…" | ms decode -), and copy-paste artifacts with one mechanism. Doubling-detection guard (SPEC §3.2 r7) handles the multi-line encode stdout cleanly. - BIP-39 wordlist enforcement: all 10 wordlists supported via
--language(defaultenglish); non-suppressible stderr warning surfaces the SPEC §6.3 wordlist hazard at decode time. - Exit codes per SPEC §6: 0 (success) / 1 (user-input error) / 2 (format violation) / 3 (valid future v0.2+ format) / 4 (verify round-trip mismatch — distinct so scripts can detect engraving/transcription bugs) / 64 (clap usage error — overrides clap's default of 2 to keep ms1 format violations distinct).
- Engraving-friendly stdout: encode emits
<ms1>\n\n<chunked-form>(5-char groups, 10/line max, never mid-chunk) for hand-engraving proofreading. verify --phraseround-trip check: the engraver's end-to-end integrity check. Phrases never echoed to stdout/stderr (secrets discipline).
Engraving caveat
ms1 v0.1 does NOT carry the BIP-39 wordlist language on the wire. Users with non-English wallets MUST record their wordlist language alongside the engraved card. A future v0.2+ payload kind mnem (reserved tag) is allocated to address this. See SPEC §6.3 for full discussion of the hazard.
Quickstart
# Encode a 12-word BIP-39 mnemonic.
ms encode --phrase "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
# Recover from an engraved string.
ms decode ms10entrsqqqqqqqqqqqqqqqqqqqqqqqqqqqqcj9sxraq34v7f
# Verify an engraved string round-trips against the original phrase.
ms verify <ms1> --phrase "abandon abandon ... about"
# Inspect a candidate string for structural validity (verdict + fields + failure reasons).
ms inspect <ms1>
# Dump the SHA-pinned test-vector corpus.
ms vectors --prettyTests
77 tests across the surface: 29 unit + 48 integration (assert_cmd). cargo build / cargo clippy --all-targets -D warnings / cargo fmt --check all clean. Per-phase opus reviewer-loops persisted to design/agent-reports/.
Documentation
design/SPEC_ms_cli_v0_1.md— full CLI surface specification.design/IMPLEMENTATION_PLAN_ms_cli_v0_1.md— phase-by-phase build plan (reviewer-converged at r3).crates/ms-cli/README.md— crate-level quickstart.
Family
ms-cli is one of three sibling format crates plus a future toolkit:
- md-codec (repo) — wallet descriptors / templates (
md1, HRPmd). - mk-codec (repo) — xpubs (
mk1, HRPmk). - ms-codec (release) — BIP-39 entropy library (
ms1, HRPms). - ms-cli (this release) — companion CLI for ms-codec.
- mnemonic-toolkit (planned) — top-level integration: take a BIP-39 phrase, emit a complete ms1 + mk1 + md1 engravable bundle.