feat(vault-tui): in-place unlock (master password / PIN)#13
Merged
Conversation
When the agent is locked, the TUI no longer dead-ends at a "run vault
unlock" banner — it shows an interactive unlock prompt for the registered
account. Type the master password, or Tab to a PIN when one is enrolled,
and drop straight into the browser. Reuses the readline TextInput (secret
masked with bullets) and the existing Unlock/UnlockPin requests — no
protocol or agent changes. Failed unlocks show the error (incl.
BadPin { attempts_remaining } / PinLockedOut) and clear the field; Esc
quits.
A locked agent reports server/email as None, so the TUI needs the account
from the registered profile. config.rs is extracted from vault-cli into a
shared vault-config crate, now used by both the CLI and the TUI (single
source of truth for config.toml; the agent still doesn't read config).
The locked screen reads vault_config::load().account() and queries
PinStatus to decide whether to offer the PIN toggle.
Tests: vault-config's units moved with it; new vault-tui units for
UnlockState::request (password vs PIN), toggle_pin (no-op without
enrollment, clears on switch), unlock_failed, and a TestBackend smoke
(account shown, secret masked, Tab hint only when a PIN is enrolled). 148
workspace tests green. No new external dependencies.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UnbreakableMJ
force-pushed
the
tui-unlock
branch
from
June 15, 2026 10:33
7fa06d9 to
dc49b51
Compare
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
When the agent is locked,
vault-tuino longer dead-ends at a "runvault unlock" banner — it shows an interactive unlock prompt for the registered account. Type the master password, orTabto a PIN when one is enrolled, and drop straight into the browser. Reuses the readlineTextInput(secret masked with•) and the existingUnlock/UnlockPinrequests — no protocol or agent changes. Failed unlocks show the error (incl.BadPin { attempts_remaining }/PinLockedOut) and clear the field;Escquits.The structural bit:
vault-configA locked agent reports
server/emailasNone, so the TUI needs the account from the registered profile.config.rsis extracted fromvault-cliinto a sharedvault-configcrate, now used by both the CLI and the TUI (single source of truth forconfig.toml; the agent still doesn't read config). The locked screen readsvault_config::load().account()and queriesPinStatusto decide whether to offer the PIN toggle.Tests
vault-config's units moved with it; newvault-tuiunits forUnlockState::request(password vs PIN),toggle_pin(no-op without enrollment, clears on switch),unlock_failed, and aTestBackendsmoke (account shown, secret masked,Tabhint only when a PIN is enrolled). 148 tests green, isolated-target-dirclippy -D warningsclean,cargo denyclean, both headless builds green. No new external dependencies.Out of scope (tracked)
Bitwarden personal API-key auth; config-registry growth (
clipboard.backend,set vim, reduced-motion).🤖 Generated with Claude Code