Verbosity levels
Why it matters
CI pipelines need quiet mode — mytool build --quiet so the log does not balloon with per-file output. Debugging sessions need verbose mode — mytool build -v to see which request failed or which config was loaded. A CLI that only outputs one noise level forces users into either information overload in CI or flying blind during incidents. Registering --verbose but never reading it in handlers is a worse sin: the flag looks supported, users trust it, and it silently does nothing.
Severity rationale
Low because missing verbosity flags degrade debugging and CI output but do not affect core functionality.
Remediation
Add --verbose/-v and --quiet/-q as global options in src/cli/index.ts and route all logging through a helper that honors them:
program.option('-v, --verbose').option('-q, --quiet')
function log(msg: string, { quiet, verbose }: Opts) {
if (quiet) return
console.error(msg)
}
function debug(msg: string, { verbose }: Opts) {
if (verbose) console.error(`[debug] ${msg}`)
}
Detection
-
ID:
verbosity-levels -
Severity:
low -
What to look for: Count all logging and output statements. For each, check for
--quiet/-qflag (suppress non-essential output) and--verbose/-vflag (show additional detail). Verify that--quietactually suppresses output (only errors shown) and--verboseshows extra information (debug detail, timing, network requests). Check for stackable verbosity (-vv,-vvv) in CLIs with multiple verbosity levels. -
Pass criteria: At least
--verboseis supported for increased output detail.--quietfor suppressed output is recommended. Verbosity flags actually change the output level (not just registered but ignored) — at least 2 verbosity levels (normal and verbose/debug) must be supported via --verbose or -v flag. Report even on pass: "X verbosity levels supported, --verbose and --quiet flags functional." Report: "X output statements found, Y respect verbosity level settings." -
Fail criteria: No
--verboseor--quietflags, or the flags are registered but have no effect on output. -
Skip (N/A) when: The CLI has minimal output by nature (e.g., a formatter that only outputs the formatted result). All checks skip when no CLI entry point is detected.
-
Detail on fail:
"No --verbose or --quiet flags on any command"or"--verbose flag is registered but never checked in command handlers — has no effect" -
Remediation: Verbosity control helps with debugging and CI integration:
// commander — global verbosity options program .option('-v, --verbose', 'Show detailed output') .option('-q, --quiet', 'Suppress non-essential output') function log(message: string, opts: { verbose?: boolean, quiet?: boolean }) { if (opts.quiet) return console.error(message) // messages to stderr } function debug(message: string, opts: { verbose?: boolean }) { if (opts.verbose) console.error(`[debug] ${message}`) }
Taxons
History
- 2026-04-18·v1.0.0·Initial import from cli-quality·automated