Repository navigation
feat(cli): command-line scaffold - #27
Merged
Merged
Conversation
Every v1.0 command is declared so `pwv --help` shows the full surface; each one exits 1 with "not implemented yet" until its own PR lands. Secrets are never accepted as arguments, and PWV_VAULT holds only the vault path. Refs #26
Any pwv-core error about the vault's contents exits 3, so scripts can tell a wrong password or tampered file apart from a missing file (1) or a usage mistake (2). The core error is found anywhere in the anyhow chain, so adding context never changes the code. Refs #26
Secrets are read with rpassword and kept in zeroizing buffers until they become a SecretString. With --password-stdin every answer is one stdin line, so tests and scripts can drive the binary without a terminal. Refs #26
Owner
Author
|
Self-review: read the full
Left for later PRs: each command's flags and behaviour. Interactive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
pwvcommand-line skeleton: clap definitions for every v1.0 command and the global--vault/--password-stdinflags, the mapping from errors to exit codes (3 for vault integrity or authentication failures, 1 otherwise, 2 from clap for usage errors), and a prompt module that reads secrets with a hidden terminal prompt or, with--password-stdin, one line each from stdin. Commands still report "not implemented"; each one arrives in its own PR with its flags.Closes #26
Type of change
How was this tested?
cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo test --workspace --all-features,cargo deny checktests/cli.rs(assert_cmd): help lists every command, help marks--password-stdinas automation-only,--version, usage errors exit 2Security checklist
PWV_VAULTholds the path only)pwv-core::kdf/pwv-core::cryptoNotes for the reviewer
pwv-coreerror exceptIoexits 3, so a malformed or downgraded header counts as an integrity failure, not a user error.Zeroizing<String>. Rust can't guarantee no other copies; that limit goes in the README.prompt.rscarries#[expect(dead_code)]until init uses it; the expectation fails the build once it is unnecessary.