bitwarden / bitwarden/agent-access
[Feature] aac listen — allow presetting auto-approval duration via CLI flag or accept typed input in TUI
- Dominant language
- Rust
- Stars
- 145
- Forks
- 11
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 1
Description
# [Feature] `aac listen` — allow presetting auto-approval duration via CLI flag or accept typed input in TUI
## Problem
The `aac listen` TUI (`CredentialConfirm` mode) only accepts `Up` / `Down` arrow keys for the auto-approval timer:
- `Up` = +5 minutes
- `Down` = -1 minute (floor 1)
- Default = 10 minutes (hardcoded at `auto_approve_minutes: 10` in `crates/ap-cli/src/command/tui.rs`)
Digits (0-9), PageUp/PageDown, and Home/End are not bound to the timer field.
## Use case
Persistent `aac listen --reusable-psk` sessions on unattended-cron hosts (e.g., a Mac mini serving multi-day AI-agent workloads while the operator is away) need multi-thousand-minute auto-approval windows so the listener doesn't lapse mid-window.
Reaching a value like **4000 minutes from the default 10 requires ~798 Up-arrow presses**, which is untenable ergonomically.
## Proposed alternatives (any one would solve it)
1. **CLI flag on `listen`:**
```
aac listen --reusable-psk --default-auto-approve-minutes 4000
```
Sets the initial TUI value; user can still adjust with arrows before pressing `a`.
2. **Typed-digit input in the TUI's `CredentialConfirm` mode** — capture `KeyCode::Char(c)` where c is 0-9 into a temporary buffer; commit on Enter.
3. **PageUp/PageDown bindings for coarse stepping** (e.g., ±60min) — cheapest option; keeps the arrow-key UX pattern.
4. **Env-var override:**
```
AAC_DEFAULT_AUTO_APPROVE_MINUTES=4000 aac listen ...
```
Any single one solves the ergonomic problem. Options (1) and (4) are the smallest surface changes.
## Relevant files
- `crates/ap-cli/src/command/listen.rs` — `ListenArgs` struct (add flag here for option 1)
- `crates/ap-cli/src/command/tui.rs` — `CredentialConfirm` key handler (add digit or PageUp/Down bindings for options 2/3)
## Willing to contribute
Yes — happy to submit a PR if maintainers agree on which of (1)–(4) fits the project's design direction.
Contributor guide
Research direction
Start with ListenArgs in crates/ap-cli/src/command/listen.rs and the CredentialConfirm key handler in crates/ap-cli/src/command/tui.rs. Confirm with maintainers which proposed input method fits the design direction, then verify that the chosen method allows a large initial auto-approval duration while preserving adjustment before approval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100