- assigned_to: thomijasir
#19 [Feature]: Standardize non-interactive, quiet, and debug CLI modes
Originally created by: thomijasir
Originally owned by: thomijasir
Feature description
Add global execution modes so scripts can forbid prompts, suppress status text, or collect sanitized diagnostics.
Current behavior
Some commands have --yes or --stdin, and JSON errors are structured. Prompt behavior and diagnostic controls are not consistent across the full command tree.
Why we need this
Automation must never stop for an unexpected prompt. Troubleshooting also needs enough context to identify configuration, connection, and cache problems without exposing credentials.
Proposed CLI interface
dopbase --no-interactive <command>dopbase --quiet <command>dopbase --debug <command>
Expected behavior
--no-interactiveprevents all prompts and returns a clear error when required input was not provided explicitly.--quietsuppresses progress and success messages but keeps requested payloads, warnings, and errors.--debugwrites sanitized configuration sources, request paths, durations, retry decisions, and cache decisions to stderr.- Allow global flags before or after the subcommand, matching existing
--jsonbehavior. - Keep stdout stable for command results and child processes.
- The non-interactive authentication behavior of
dopbase runremains owned by [#13].
Security and compatibility
- Never log tokens, passwords, authorization headers, secret values, decrypted cache data, or plaintext request bodies.
- Debug output must redact sensitive query parameters if any are added later.
--quietmust not suppress security warnings or errors.
Out of scope
- Changing the JSON response schema.
- Reworking terminal colors or table layout.
- Duplicating the
dopbase runauthentication work in [#13].
Acceptance criteria
- [ ] Every prompt-capable command respects
--no-interactive. - [ ] Commands explain which explicit flag or input is missing.
- [ ] Quiet mode preserves data output and exit codes.
- [ ] Debug mode provides useful context entirely on stderr.
- [ ] Debug tests prove that representative tokens and secret values are absent.
- [ ] Existing command output is unchanged when none of the new flags is used.
Test scenarios
- Add parser and command tests under
app/tests/cli/. - Cover confirmation prompts, password prompts, login behavior, stdin, quiet output, debug redaction, JSON output, and flag placement.
Documentation
Document intended use in scripts, stdout and stderr contracts, and the relationship to command-specific --yes and --stdin flags.
Dependencies
Coordinate with [#13] so run authentication has one source of truth.