Summary
cdidx has no --quiet / --silent flag. Query commands write informational messages to stderr ("No results found.", file counts, progress hints) unconditionally, even from inside shell scripts that just want the JSON or a non-zero exit code. Users either redirect stderr to /dev/null (losing genuine errors) or accept noisy pipelines. There is no canonical way to ask cdidx to "shut up unless something is wrong".
Where
src/CodeIndex/Cli/ConsoleUi.cs:13-40 (no --quiet in usage)
- Information emission scattered across
QueryCommandRunner.cs
Suggested approach
(1) Add a global --quiet / -q flag (and CDIDX_QUIET=1 env) that suppresses all stderr output except LogLevel >= Error. (2) Add a --silent alias for symmetry with curl/wget — same behavior. (3) Wrap every informational stderr write behind a ConsoleUi.WriteInfo(...) helper that short-circuits when quiet mode is set. (4) Keep the spinner / progress bar visible when stdout is a TTY but suppress when --quiet is set. (5) Document the precedence: --quiet overrides --verbose; both can coexist for "errors-only with file/line context". (6) Add a regression test that runs cdidx --quiet search nonexistent and asserts zero stderr bytes plus non-zero exit. (7) Document under "Output verbosity controls".
Summary
cdidx has no
--quiet/--silentflag. Query commands write informational messages to stderr ("No results found.", file counts, progress hints) unconditionally, even from inside shell scripts that just want the JSON or a non-zero exit code. Users either redirect stderr to/dev/null(losing genuine errors) or accept noisy pipelines. There is no canonical way to ask cdidx to "shut up unless something is wrong".Where
src/CodeIndex/Cli/ConsoleUi.cs:13-40(no--quietin usage)QueryCommandRunner.csSuggested approach
(1) Add a global
--quiet/-qflag (andCDIDX_QUIET=1env) that suppresses all stderr output exceptLogLevel >= Error. (2) Add a--silentalias for symmetry with curl/wget — same behavior. (3) Wrap every informational stderr write behind aConsoleUi.WriteInfo(...)helper that short-circuits when quiet mode is set. (4) Keep the spinner / progress bar visible when stdout is a TTY but suppress when--quietis set. (5) Document the precedence:--quietoverrides--verbose; both can coexist for "errors-only with file/line context". (6) Add a regression test that runscdidx --quiet search nonexistentand asserts zero stderr bytes plus non-zero exit. (7) Document under "Output verbosity controls".