Merged
Conversation
- Add terminal utility for password input (no-echo) - Implement vault initialization with password confirmation - Validate minimum password length (8 chars) - Create vault at XDG_DATA_HOME/zault/vault.zault
- Open and unlock vault with master password - Accept entry name as argument or prompt - Prompt for username (optional), password, and URL (optional) - Create password entry and save to vault - Handle errors: vault not found, invalid password, duplicate entry
- Retrieve entry by name from vault - Copy password to clipboard with configurable timeout - Display username and URL if available - Handle TOTP and passkey entry types - Respect clipboard_enabled config setting
- List all entries in vault with name, type, and username/issuer - Display entry count - Handle empty vault case
- Generate random passwords with configurable length - Generate passphrases with configurable word count - Show entropy calculation - Optional clipboard copy with --copy flag - Respects config defaults for generator options
- Move each command to src/cli/commands/*.zig - Add delete command implementation - Keep main.zig as router only
- Add TOTP entries with secret and issuer - Generate and display current TOTP codes - List all TOTP entries - Copy codes to clipboard - Add createTotpEntry helper in entry.zig
- List all passkey entries with RP ID and user - Show passkey details (algorithm, counter, etc.) - Delete passkeys with confirmation
- Mask TOTP secret input (was visible on screen) - Secure zero generated passwords before deallocation - Secure zero TOTP code buffer after use - Consume newline after confirmation prompts
Allow adding TOTP to existing password entries instead of requiring separate TOTP entries. This enables users to run 'zault totp add github.com' on an existing password entry to attach 2FA. Changes: - Add optional TOTP fields to PasswordEntry (secret, algorithm, digits, period) - Update serializer with backwards-compatible TOTP field handling - totp add: Modify existing password entries or create standalone TOTP - totp get: Check password entries for TOTP configuration - totp list: Show both standalone TOTP and password+TOTP entries
- Add vault_helpers.zig with openAndUnlock() helper - Reduces ~40 lines of boilerplate per command using vault - Add 'zault totp remove <name>' to remove TOTP from entries - Improve TOTP error messages (invalid base32, etc.) - Validate base32 secret on add before storing totp.zig reduced from 482 to 331 lines.
Apply openAndUnlock() helper to all vault-accessing commands: - add.zig: 125 → 89 lines - delete.zig: 85 → 51 lines - get.zig: 95 → 56 lines - list.zig: 72 → 33 lines - passkey.zig: 281 → 172 lines Total reduction: 257 lines (22%) across CLI commands.
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
Commands Implemented
initadd <name>get <name>listdelete <name>generatetotp add/list/<name>passkey list/show/deleteChanges
src/cli/terminal.zig- Password input without echo, line readingsrc/cli/commands/*.zig- Individual command implementationssrc/core/entry.zig- AddedcreateTotpEntryhelpersrc/main.zig- Command routing to separate modulesTest plan
zig buildcompiles without errorszig build testpasses all testszault initcreates vault with password confirmationzault add github.comprompts for credentials and saveszault get github.comcopies password to clipboardzault listshows all entrieszault generateoutputs random password with entropyzault generate --passphraseoutputs word-based passphrasezault totp add github.comadds TOTP entryzault totp github.comdisplays current codezault passkey listshows passkey entries