- assigned_to: thomijasir
#35 [Feature]: Add an interactive secret management TUI
Originally created by: thomijasir
Originally owned by: thomijasir
Feature description
Add an optional terminal interface for reviewing and editing one environment's secrets as a buffered change set.
Current behavior
Secret operations are individual CLI commands, bulk import and export, or actions in the web interface.
Why we need this
Some terminal-focused users need to review several keys, prepare a batch of edits, and inspect the change summary before applying it.
Proposed CLI interface
dopbase tui [ENVIRONMENT]dopbase tui ENVIRONMENT --read-only
Expected behavior
- Use the normal environment precedence when no environment argument is supplied.
- List secret names and metadata with values masked by default.
- Support filtering by name, adding a key, editing a value through masked input, marking a key for deletion, undoing unsaved edits, and viewing a final change summary.
- Keep all edits local until the user confirms save.
- Apply the batch through the existing import preview and expected-revision protection.
- If the environment changes after loading, stop the save and show a refresh choice instead of overwriting newer data.
- Require recent human authentication only when the user explicitly reveals an existing value.
- Provide a read-only mode for metadata review.
- Support keyboard-only navigation, terminal resize, cancellation, and restoration of the terminal state after errors.
Security and compatibility
- Never place plaintext values in the terminal scrollback by default.
- Clear value buffers when edits are discarded or the application exits.
- Do not write drafts, plaintext values, or screen state to disk.
- Do not add clipboard operations in the first version.
- Keep logs and panic messages free of values and restore terminal echo reliably.
Out of scope
- Replacing the web interface.
- Managing projects, users, backups, or server settings.
- Mouse-only interactions.
- A separate API or persistence model for the TUI.
Acceptance criteria
- [ ] A user can filter, add, edit, delete, undo, preview, and save a secret batch using only the keyboard.
- [ ] Values remain masked unless explicitly revealed after recent authentication.
- [ ] Cancellation leaves the server unchanged.
- [ ] Concurrent server changes prevent a stale save.
- [ ] Terminal state is restored after success, cancellation, API failure, and panic handling.
- [ ] Read-only mode cannot create a mutation request.
- [ ] The TUI reuses shared CLI and API services instead of duplicating business rules.
Test scenarios
- Add state-machine unit tests and pseudo-terminal integration tests.
- Cover navigation, filtering, masked input, undo, deletion, preview, save, cancellation, concurrent revision failure, resize, terminal restoration, read-only mode, authentication, and value redaction.
Documentation
Document keyboard controls, masking, buffered edits, save conflicts, read-only mode, platform support, and recovery if a terminal session is interrupted.
Dependencies
Schedule after the non-interactive command behavior and batch import path are stable. Select a terminal UI library only after checking binary size, maintenance status, accessibility, and supported platforms.