Skip to content

feat(vault-tui): in-place unlock (master password / PIN)#13

Merged
UnbreakableMJ merged 1 commit into
mainfrom
tui-unlock
Jun 15, 2026
Merged

feat(vault-tui): in-place unlock (master password / PIN)#13
UnbreakableMJ merged 1 commit into
mainfrom
tui-unlock

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Summary

When the agent is locked, vault-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 ) 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.

The structural bit: vault-config

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 tests green, isolated-target-dir clippy -D warnings clean, cargo deny clean, 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

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
UnbreakableMJ merged commit 461eb59 into main Jun 15, 2026
8 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the tui-unlock branch June 15, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant