Menu ▾ ▴

#19 [Feature]: Standardize non-interactive, quiet, and debug CLI modes

open
nobody
2026-09-11
2026-09-11
Anonymous
No

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-interactive prevents all prompts and returns a clear error when required input was not provided explicitly.
  • --quiet suppresses progress and success messages but keeps requested payloads, warnings, and errors.
  • --debug writes sanitized configuration sources, request paths, durations, retry decisions, and cache decisions to stderr.
  • Allow global flags before or after the subcommand, matching existing --json behavior.
  • Keep stdout stable for command results and child processes.
  • The non-interactive authentication behavior of dopbase run remains 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.
  • --quiet must not suppress security warnings or errors.

Out of scope

  • Changing the JSON response schema.
  • Reworking terminal colors or table layout.
  • Duplicating the dopbase run authentication 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.

Related

Tickets: #13
Tickets: #20
Tickets: #22

Discussion

  • Anonymous

    Anonymous - 2026-09-11
     

Log in to post a comment.